diff options
author | Steffen Hahn <steffen.hahn@nokia.com> | 2012-03-26 15:36:15 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-27 09:44:16 +0200 |
commit | 2899b14cebc8cd4e5b14967d6f13e70321b35082 (patch) | |
tree | caaddf2602c3bc11f660bd6c7724576d72138ce0 /src/imports | |
parent | 4151cd3912d236c6d289308b4bd5f579e183a61c (diff) |
Set monitorAllLogicalDrives to obsoleted
Change-Id: I05b3c22d162ab856a4dba29e5f8a10a9c7e37a39
Reviewed-by: Xizhi Zhu <xizhi.zhu@nokia.com>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/systeminfo/qdeclarativestorageinfo.cpp | 26 | ||||
-rw-r--r-- | src/imports/systeminfo/qdeclarativestorageinfo_p.h | 9 |
2 files changed, 35 insertions, 0 deletions
diff --git a/src/imports/systeminfo/qdeclarativestorageinfo.cpp b/src/imports/systeminfo/qdeclarativestorageinfo.cpp index ac3d0adf..f13bd7ea 100644 --- a/src/imports/systeminfo/qdeclarativestorageinfo.cpp +++ b/src/imports/systeminfo/qdeclarativestorageinfo.cpp @@ -56,6 +56,7 @@ QT_BEGIN_NAMESPACE QDeclarativeStorageInfo::QDeclarativeStorageInfo(QObject *parent) : QObject(parent) , storageInfo(new QStorageInfo(this)) + , isMonitorAllLogicalDrives(false) { } @@ -67,6 +68,31 @@ QDeclarativeStorageInfo::~QDeclarativeStorageInfo() } /*! + \qmlproperty bool StorageInfo::monitorAllLogicalDrives + + This property is obsoleted, and will be removed soon. You don't need to use it at all. + */ +bool QDeclarativeStorageInfo::monitorAllLogicalDrives() const +{ + return isMonitorAllLogicalDrives; +} + +void QDeclarativeStorageInfo::setMonitorAllLogicalDrives(bool monitor) +{ + if (monitor != isMonitorAllLogicalDrives) { + isMonitorAllLogicalDrives = monitor; + if (monitor) { + connect(storageInfo, SIGNAL(logicalDriveChanged(QString,bool)), + this, SIGNAL(logicalDriveChanged(QString,bool))); + } else { + disconnect(storageInfo, SIGNAL(logicalDriveChanged(QString,bool)), + this, SIGNAL(logicalDriveChanged(QString,bool))); + } + emit monitorAllLogicalDrivesChanged(); + } +} + +/*! \qmlproperty stringlist StorageInfo::allLogicalDrives This property holds a list of all the available logical drives. diff --git a/src/imports/systeminfo/qdeclarativestorageinfo_p.h b/src/imports/systeminfo/qdeclarativestorageinfo_p.h index 2f638f86..eb93b662 100644 --- a/src/imports/systeminfo/qdeclarativestorageinfo_p.h +++ b/src/imports/systeminfo/qdeclarativestorageinfo_p.h @@ -66,6 +66,9 @@ class QDeclarativeStorageInfo : public QObject Q_PROPERTY(QStringList allLogicalDrives READ allLogicalDrives NOTIFY logicalDriveChanged) + // obsoleted + Q_PROPERTY(bool monitorAllLogicalDrives READ monitorAllLogicalDrives WRITE setMonitorAllLogicalDrives NOTIFY monitorAllLogicalDrivesChanged) + public: enum DriveType { UnknownDrive = QStorageInfo::UnknownDrive, @@ -79,6 +82,8 @@ public: QDeclarativeStorageInfo(QObject *parent = 0); virtual ~QDeclarativeStorageInfo(); + bool monitorAllLogicalDrives() const; + void setMonitorAllLogicalDrives(bool monitor); QStringList allLogicalDrives() const; Q_INVOKABLE qlonglong availableDiskSpace(const QString &drive) const; @@ -87,10 +92,14 @@ public: Q_INVOKABLE int driveType(const QString &drive) const; Q_SIGNALS: + void monitorAllLogicalDrivesChanged(); + void logicalDriveChanged(const QString &drive, bool added); private: QStorageInfo *storageInfo; + + bool isMonitorAllLogicalDrives; }; QT_END_NAMESPACE |