summaryrefslogtreecommitdiffstats
path: root/src/network/bearer/qnetworkconfigmanager_p.cpp
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2009-12-22 05:08:34 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2009-12-22 05:08:34 (GMT)
commit5c07b6b24144774f16a20115eec1a6700d0db254 (patch)
tree0bd004ec8151036e38f212512c549ddfb956679c /src/network/bearer/qnetworkconfigmanager_p.cpp
parent70d0623570936696ca28536a46a3be63c691f50b (diff)
downloadQt-5c07b6b24144774f16a20115eec1a6700d0db254.zip
Qt-5c07b6b24144774f16a20115eec1a6700d0db254.tar.gz
Qt-5c07b6b24144774f16a20115eec1a6700d0db254.tar.bz2
Convert NetworkManager engine into a plugin.
Conflicts: src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp src/plugins/bearer/networkmanager/qnetworkmanagerservice.h src/plugins/bearer/networkmanager/qnmdbushelper.cpp src/plugins/bearer/networkmanager/qnmdbushelper.h src/plugins/bearer/networkmanager/qnmwifiengine.cpp src/plugins/bearer/networkmanager/qnmwifiengine.h
Diffstat (limited to 'src/network/bearer/qnetworkconfigmanager_p.cpp')
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index 3e82ab7..7b68394 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -47,9 +47,6 @@
#ifdef Q_OS_WIN32
#include "qnativewifiengine_win_p.h"
#endif
-#if defined(BACKEND_NM)
-#include "qnmwifiengine_unix_p.h"
-#endif
#ifdef Q_OS_DARWIN
#include "qcorewlanengine_mac_p.h"
#endif
@@ -244,13 +241,21 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
this, SLOT(updateConfigurations()));
}
#else
-#if defined(BACKEND_NM)
- nmWifi = QNmWifiEngine::instance();
- if (nmWifi) {
- connect(nmWifi, SIGNAL(configurationsChanged()),
- this, SLOT(updateConfigurations()));
- } else {
+#ifdef BACKEND_NM
+ if (keys.contains(QLatin1String("networkmanager"))) {
+ QBearerEnginePlugin *nmPlugin =
+ qobject_cast<QBearerEnginePlugin *>(l->instance(QLatin1String("networkmanager")));
+ if (nmPlugin) {
+ nmWifi = nmPlugin->create(QLatin1String("networkmanager"));
+ if (nmWifi) {
+ connect(nmWifi, SIGNAL(configurationsChanged()),
+ this, SLOT(updateConfigurations()));
+ }
+ }
+ }
#endif
+
+ if (keys.contains(QLatin1String("generic"))) {
QBearerEnginePlugin *genericPlugin =
qobject_cast<QBearerEnginePlugin *>(l->instance(QLatin1String("generic")));
if (genericPlugin) {
@@ -260,10 +265,8 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
this, SLOT(updateConfigurations()));
}
}
-#if defined(BACKEND_NM)
}
#endif
-#endif
#ifdef Q_OS_WIN
nla = QNlaEngine::instance();
@@ -293,7 +296,7 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
#if defined(BACKEND_NM)
if (engine == nmWifi)
updateState &= ~NmUpdating;
- else if (engine == generic)
+ if (engine == generic)
updateState &= ~GenericUpdating;
#else
if (engine == generic)
@@ -319,7 +322,7 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
#if defined(BACKEND_NM)
if (nmWifi)
engines << nmWifi;
- else if (generic)
+ if (generic)
engines << generic;
#else
if (generic)
@@ -431,7 +434,8 @@ void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate()
if (nmWifi) {
updateState |= NmUpdating;
nmWifi->requestUpdate();
- } else if (generic) {
+ }
+ if (generic) {
updateState |= GenericUpdating;
generic->requestUpdate();
}