summaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorSteffen Hahn <steffen.hahn@nokia.com>2012-04-26 09:02:53 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-26 18:59:15 +0200
commitacdcc6f911fc7bbdbc048263da43ae0b0f668477 (patch)
tree75266ad7d6dd088f8a82b5f49627a2f235405f3d /src/imports
parent854d95c8a21266f163bbe213f205ecfb449e51d1 (diff)
Ensure unique connections in QML wrappers
Connect QML-Wrapper's signals that are used to NOTIFY properties on changes uniquely when reading the property the first time. This avoids unnecessary multiple emissions of the same signal. Change-Id: I0776f1fbd4b6605cc1b5ac4688a86d528461e783 Reviewed-by: Cristiano di Flora <cristiano.di-flora@nokia.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/systeminfo/qdeclarativenetworkinfo.cpp2
-rw-r--r--src/imports/systeminfo/qdeclarativestorageinfo.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/imports/systeminfo/qdeclarativenetworkinfo.cpp b/src/imports/systeminfo/qdeclarativenetworkinfo.cpp
index 997d0fec..2cafa472 100644
--- a/src/imports/systeminfo/qdeclarativenetworkinfo.cpp
+++ b/src/imports/systeminfo/qdeclarativenetworkinfo.cpp
@@ -132,7 +132,7 @@ void QDeclarativeNetworkInfo::setMonitorCurrentNetworkMode(bool monitor)
QDeclarativeNetworkInfo::NetworkMode QDeclarativeNetworkInfo::currentNetworkMode() const
{
connect(networkInfo, SIGNAL(currentNetworkModeChanged(QNetworkInfo::NetworkMode)),
- this, SIGNAL(currentNetworkModeChanged()));
+ this, SIGNAL(currentNetworkModeChanged()), Qt::UniqueConnection);
return static_cast<QDeclarativeNetworkInfo::NetworkMode>(networkInfo->currentNetworkMode());
}
diff --git a/src/imports/systeminfo/qdeclarativestorageinfo.cpp b/src/imports/systeminfo/qdeclarativestorageinfo.cpp
index f13bd7ea..e8515c42 100644
--- a/src/imports/systeminfo/qdeclarativestorageinfo.cpp
+++ b/src/imports/systeminfo/qdeclarativestorageinfo.cpp
@@ -99,7 +99,8 @@ void QDeclarativeStorageInfo::setMonitorAllLogicalDrives(bool monitor)
*/
QStringList QDeclarativeStorageInfo::allLogicalDrives() const
{
- connect(storageInfo, SIGNAL(logicalDriveChanged(QString,bool)), this, SIGNAL(logicalDriveChanged(QString,bool)));
+ connect(storageInfo, SIGNAL(logicalDriveChanged(QString,bool)),
+ this, SIGNAL(logicalDriveChanged(QString,bool)), Qt::UniqueConnection);
return storageInfo->allLogicalDrives();
}