diff options
author | Steffen Hahn <steffen.hahn@nokia.com> | 2012-03-13 15:56:44 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-13 16:43:03 +0100 |
commit | 34725c640691dacac9744189dfbc7da47b5eeb46 (patch) | |
tree | 2b4543d817d7570191b7e41d6af9cd06a002d10e /src/imports | |
parent | 856ac5ef769283633ccff8e1309743addb0e48b7 (diff) |
Remove monitor*Locks properties.
Change-Id: I1980bcda7a330b07d88333ad8833b0e2001946bf
Reviewed-by: Xizhi Zhu <xizhi.zhu@nokia.com>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/systeminfo/qdeclarativedeviceinfo.cpp | 58 | ||||
-rw-r--r-- | src/imports/systeminfo/qdeclarativedeviceinfo_p.h | 11 |
2 files changed, 6 insertions, 63 deletions
diff --git a/src/imports/systeminfo/qdeclarativedeviceinfo.cpp b/src/imports/systeminfo/qdeclarativedeviceinfo.cpp index d2348e2e..ae126f4f 100644 --- a/src/imports/systeminfo/qdeclarativedeviceinfo.cpp +++ b/src/imports/systeminfo/qdeclarativedeviceinfo.cpp @@ -56,8 +56,6 @@ QT_BEGIN_NAMESPACE QDeclarativeDeviceInfo::QDeclarativeDeviceInfo(QObject *parent) : QObject(parent) , deviceInfo(new QDeviceInfo(this)) - , isMonitorActivatedLocks(false) - , isMonitorEnabledLocks(false) , isMonitorThermalState(false) { } @@ -70,31 +68,6 @@ QDeclarativeDeviceInfo::~QDeclarativeDeviceInfo() } /*! - \qmlproperty bool DeviceInfo::monitorActivatedLocks - - This property holds whether or not monitor the change of activated locks. - */ -bool QDeclarativeDeviceInfo::monitorActivatedLocks() const -{ - return isMonitorActivatedLocks; -} - -void QDeclarativeDeviceInfo::setMonitorActivatedLocks(bool monitor) -{ - if (monitor != isMonitorActivatedLocks) { - isMonitorActivatedLocks = monitor; - if (monitor) { - connect(deviceInfo, SIGNAL(activatedLocksChanged(QDeviceInfo::LockTypeFlags)), - this, SIGNAL(activatedLocksChanged())); - } else { - disconnect(deviceInfo, SIGNAL(activatedLocksChanged(QDeviceInfo::LockTypeFlags)), - this, SIGNAL(activatedLocksChanged())); - } - emit monitorActivatedLocksChanged(); - } -} - -/*! \qmlproperty flag DeviceInfo::activatedLocks This property holds the activated locks. Available locks include: @@ -106,6 +79,9 @@ void QDeclarativeDeviceInfo::setMonitorActivatedLocks(bool monitor) */ QDeclarativeDeviceInfo::LockTypeFlags QDeclarativeDeviceInfo::activatedLocks() const { + connect(deviceInfo, SIGNAL(activatedLocksChanged(QDeviceInfo::LockTypeFlags)), + this, SIGNAL(activatedLocksChanged())); + QDeviceInfo::LockTypeFlags locks(deviceInfo->activatedLocks()); LockTypeFlags declarativeLocks(NoLock); if (locks.testFlag(QDeviceInfo::PinLock)) @@ -116,31 +92,6 @@ QDeclarativeDeviceInfo::LockTypeFlags QDeclarativeDeviceInfo::activatedLocks() c } /*! - \qmlproperty bool DeviceInfo::monitorEnabledLocks - - This property holds whether or not monitor the change of enabled locks. - */ -bool QDeclarativeDeviceInfo::monitorEnabledLocks() const -{ - return isMonitorEnabledLocks; -} - -void QDeclarativeDeviceInfo::setMonitorEnabledLocks(bool monitor) -{ - if (monitor != isMonitorEnabledLocks) { - isMonitorEnabledLocks = monitor; - if (monitor) { - connect(deviceInfo, SIGNAL(enabledLocksChanged(QDeviceInfo::LockTypeFlags)), - this, SIGNAL(enabledLocksChanged())); - } else { - disconnect(deviceInfo, SIGNAL(enabledLocksChanged(QDeviceInfo::LockTypeFlags)), - this, SIGNAL(enabledLocksChanged())); - } - emit monitorActivatedLocksChanged(); - } -} - -/*! \qmlproperty flag DeviceInfo::enabledLocks This property holds the enabled locks. Available locks include: @@ -152,6 +103,9 @@ void QDeclarativeDeviceInfo::setMonitorEnabledLocks(bool monitor) */ QDeclarativeDeviceInfo::LockTypeFlags QDeclarativeDeviceInfo::enabledLocks() const { + connect(deviceInfo, SIGNAL(enabledLocksChanged(QDeviceInfo::LockTypeFlags)), + this, SIGNAL(enabledLocksChanged())); + QDeviceInfo::LockTypeFlags locks(deviceInfo->enabledLocks()); LockTypeFlags declarativeLocks(NoLock); if (locks.testFlag(QDeviceInfo::PinLock)) diff --git a/src/imports/systeminfo/qdeclarativedeviceinfo_p.h b/src/imports/systeminfo/qdeclarativedeviceinfo_p.h index 2b0ae2af..1cf29143 100644 --- a/src/imports/systeminfo/qdeclarativedeviceinfo_p.h +++ b/src/imports/systeminfo/qdeclarativedeviceinfo_p.h @@ -69,8 +69,6 @@ class QDeclarativeDeviceInfo : public QObject Q_FLAGS(LockType LockTypeFlags) - Q_PROPERTY(bool monitorActivatedLocks READ monitorActivatedLocks WRITE setMonitorActivatedLocks NOTIFY monitorActivatedLocksChanged) - Q_PROPERTY(bool monitorEnabledLocks READ monitorEnabledLocks WRITE setMonitorEnabledLocks NOTIFY monitorEnabledLocksChanged) Q_PROPERTY(bool monitorThermalState READ monitorThermalState WRITE setMonitorThermalState NOTIFY monitorThermalStateChanged) Q_PROPERTY(LockTypeFlags activatedLocks READ activatedLocks NOTIFY activatedLocksChanged) @@ -119,12 +117,7 @@ public: QDeclarativeDeviceInfo(QObject *parent = 0); virtual ~QDeclarativeDeviceInfo(); - bool monitorActivatedLocks() const; - void setMonitorActivatedLocks(bool monitor); LockTypeFlags activatedLocks() const; - - bool monitorEnabledLocks() const; - void setMonitorEnabledLocks(bool monitor); LockTypeFlags enabledLocks() const; bool monitorThermalState() const; @@ -141,8 +134,6 @@ public: Q_INVOKABLE QString version(Version type) const; Q_SIGNALS: - void monitorActivatedLocksChanged(); - void monitorEnabledLocksChanged(); void monitorThermalStateChanged(); void activatedLocksChanged(); @@ -152,8 +143,6 @@ Q_SIGNALS: private: QDeviceInfo *deviceInfo; - bool isMonitorActivatedLocks; - bool isMonitorEnabledLocks; bool isMonitorThermalState; }; |