diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-03-04 05:22:31 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-03-04 05:22:31 (GMT) |
commit | 1e7b2415bf1bc853655e0a85a8cb21ecd24b149e (patch) | |
tree | 242ddf36c289b84d7d09054bf05230772f9f05af /src/plugins/bearer/corewlan | |
parent | 2c6de1ce1489668253b7d3a5df3f2194fbd1bee7 (diff) | |
download | Qt-1e7b2415bf1bc853655e0a85a8cb21ecd24b149e.zip Qt-1e7b2415bf1bc853655e0a85a8cb21ecd24b149e.tar.gz Qt-1e7b2415bf1bc853655e0a85a8cb21ecd24b149e.tar.bz2 |
Updating polling mechanism for bearer management engines.
Improves the polling mechanism by sharing a single timer for all poll
based engines. Updates are only performed for a poll based engine iff a
QNetworkConfigurationManager object has been constructed or a
QNetworkConfiguration is held externally from the engine.
Diffstat (limited to 'src/plugins/bearer/corewlan')
-rw-r--r-- | src/plugins/bearer/corewlan/qcorewlanengine.h | 3 | ||||
-rw-r--r-- | src/plugins/bearer/corewlan/qcorewlanengine.mm | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.h b/src/plugins/bearer/corewlan/qcorewlanengine.h index cfd89e4..3289ffb 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.h +++ b/src/plugins/bearer/corewlan/qcorewlanengine.h @@ -80,13 +80,14 @@ public: bool getAllScInterfaces(); + bool requiresPolling() const; + private Q_SLOTS: void doRequestUpdate(); private: bool isWifiReady(const QString &dev); QMap<QString, QString> configurationInterface; - QTimer pollTimer; QStringList scanForSsids(const QString &interfaceName); bool isKnownSsid(const QString &interfaceName, const QString &ssid); diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm index 598d2f0..5870b01 100644 --- a/src/plugins/bearer/corewlan/qcorewlanengine.mm +++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm @@ -243,8 +243,7 @@ void QCoreWlanEngine::requestUpdate() { QMutexLocker locker(&mutex); - pollTimer.stop(); - QTimer::singleShot(0, this, SLOT(doRequestUpdate())); + doRequestUpdate(); } void QCoreWlanEngine::doRequestUpdate() @@ -343,8 +342,6 @@ void QCoreWlanEngine::doRequestUpdate() emit configurationRemoved(ptr); } - pollTimer.start(); - emit updateCompleted(); } @@ -610,4 +607,9 @@ QNetworkConfigurationPrivatePointer QCoreWlanEngine::defaultConfiguration() return QNetworkConfigurationPrivatePointer(); } +bool QCoreWlanEngine::requiresPolling() const +{ + return true; +} + QT_END_NAMESPACE |