diff options
author | hjk <qthjk@ovi.com> | 2011-11-19 22:57:59 +0100 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2011-11-21 13:15:41 +0100 |
commit | 77e3bf712c785b4d68695933ac929ec6a22555fc (patch) | |
tree | ed0d5856746d74a4bd47967c772885633d197259 /installerbuilder | |
parent | 3a8b2248814e468d86355b2992dca76464db70dd (diff) |
De-pimpl KDSysInfo::Volume.
Change-Id: Ie40e6e442a41dba11ed8b9bcb93aa0e09eece28d
Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'installerbuilder')
-rw-r--r-- | installerbuilder/libinstaller/3rdparty/kdtools/kdsysinfo.cpp | 65 | ||||
-rw-r--r-- | installerbuilder/libinstaller/3rdparty/kdtools/kdsysinfo.h | 18 |
2 files changed, 21 insertions, 62 deletions
diff --git a/installerbuilder/libinstaller/3rdparty/kdtools/kdsysinfo.cpp b/installerbuilder/libinstaller/3rdparty/kdtools/kdsysinfo.cpp index d00b55eaa..50ee8ce74 100644 --- a/installerbuilder/libinstaller/3rdparty/kdtools/kdsysinfo.cpp +++ b/installerbuilder/libinstaller/3rdparty/kdtools/kdsysinfo.cpp @@ -27,14 +27,6 @@ #include <algorithm> -KDSysInfo::KDSysInfo() -{ -} - -KDSysInfo::~KDSysInfo() -{ -} - QDebug operator<<(QDebug dbg, KDSysInfo::Volume volume) { return dbg << "KDSysInfo::Volume(" << volume.path() << ")"; @@ -43,96 +35,65 @@ QDebug operator<<(QDebug dbg, KDSysInfo::Volume volume) QPair<quint64, quint64> volumeSpace(const QString &volume); QString volumeName(const QString &volume); -class KDSysInfo::Volume::Private : public QSharedData -{ -public: - QString p; - QString name; - quint64 size; - QString fileSystemType; - quint64 availableSpace; -}; - - KDSysInfo::Volume::Volume() - : d(new Private) -{ -} - -KDSysInfo::Volume::Volume(const Volume &other) - : d(other.d) -{ -} - -KDSysInfo::Volume::~Volume() -{ -} - -void KDSysInfo::Volume::swap(KDSysInfo::Volume& other) -{ - std::swap(d, other.d); -} - -KDSysInfo::Volume& KDSysInfo::Volume::operator=(const KDSysInfo::Volume &other) { - KDSysInfo::Volume tmp(other); - swap(tmp); - return *this; + m_size = 0; + m_availableSpace = 0; } void KDSysInfo::Volume::setPath(const QString &path) { - d->p = path; + m_path = path; } bool KDSysInfo::Volume::operator==(const Volume &other) const { - return d->name == other.d->name && d->p == other.d->p; + return m_name == other.m_name && m_path == other.m_path; } void KDSysInfo::Volume::setName(const QString &name) { - d->name = name; + m_name = name; } QString KDSysInfo::Volume::name() const { - return d->name; + return m_name; } QString KDSysInfo::Volume::path() const { - return d->p; + return m_path; } quint64 KDSysInfo::Volume::size() const { - return d->size; + return m_size; } void KDSysInfo::Volume::setSize(const quint64 &size) { - d->size = size; + m_size = size; } QString KDSysInfo::Volume::fileSystemType() const { - return d->fileSystemType; + return m_fileSystemType; } void KDSysInfo::Volume::setFileSystemType(const QString &type) { - d->fileSystemType = type; + m_fileSystemType = type; } quint64 KDSysInfo::Volume::availableSpace() const { - return d->availableSpace; + return m_availableSpace; } void KDSysInfo::Volume::setAvailableSpace(const quint64 &available) { - d->availableSpace = available; + m_availableSpace = available; } struct PathLongerThan diff --git a/installerbuilder/libinstaller/3rdparty/kdtools/kdsysinfo.h b/installerbuilder/libinstaller/3rdparty/kdtools/kdsysinfo.h index 60b13ede2..0072b8f67 100644 --- a/installerbuilder/libinstaller/3rdparty/kdtools/kdsysinfo.h +++ b/installerbuilder/libinstaller/3rdparty/kdtools/kdsysinfo.h @@ -32,20 +32,17 @@ class KDTOOLS_EXPORT KDSysInfo : public QSysInfo { private: - KDSysInfo(); + KDSysInfo() {} public: - ~KDSysInfo(); + ~KDSysInfo() {} class KDTOOLS_EXPORT Volume { friend class ::KDSysInfo; public: - static Volume fromPath(const QString &path); - Volume(); - Volume(const Volume &other); - ~Volume(); + static Volume fromPath(const QString &path); QString name() const; QString path() const; @@ -53,8 +50,6 @@ public: QString fileSystemType() const; quint64 availableSpace() const; - void swap(Volume &other); - Volume &operator=(const Volume &other); bool operator==(const Volume &other) const; private: @@ -65,8 +60,11 @@ public: void setAvailableSpace(const quint64 &available); private: - class Private; - QSharedDataPointer<Private> d; + QString m_path; + QString m_name; + QString m_fileSystemType; + quint64 m_size; + quint64 m_availableSpace; }; struct ProcessInfo |