diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2009-12-01 05:46:59 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2009-12-22 04:41:49 (GMT) |
commit | 27b47c630f8b71897ba56c983c24afe1538f33dc (patch) | |
tree | 1c9c3695c97fd2e1626e7a5c6ca0d3296d71d887 /src/network/bearer/qnetworkconfigmanager_p.cpp | |
parent | d5b6c723973449914134231c01a381ef9af9f6d4 (diff) | |
download | Qt-27b47c630f8b71897ba56c983c24afe1538f33dc.zip Qt-27b47c630f8b71897ba56c983c24afe1538f33dc.tar.gz Qt-27b47c630f8b71897ba56c983c24afe1538f33dc.tar.bz2 |
Convert generic engine into a plugin.
Diffstat (limited to 'src/network/bearer/qnetworkconfigmanager_p.cpp')
-rw-r--r-- | src/network/bearer/qnetworkconfigmanager_p.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp index 47b23d2..3e82ab7 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.cpp +++ b/src/network/bearer/qnetworkconfigmanager_p.cpp @@ -40,7 +40,6 @@ ****************************************************************************/ #include "qnetworkconfigmanager_p.h" -#include "qgenericengine_p.h" #ifdef Q_OS_WIN #include "qnlaengine_win_p.h" @@ -55,12 +54,19 @@ #include "qcorewlanengine_mac_p.h" #endif +#include "qbearerplugin.h" + +#include <QtCore/private/qfactoryloader_p.h> + #include <QtCore/qdebug.h> #include <QtCore/qtimer.h> #include <QtCore/qstringlist.h> QT_BEGIN_NAMESPACE +Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, + (QBearerEngineFactoryInterface_iid, QLatin1String("/bearer"))) + void QNetworkConfigurationManagerPrivate::registerPlatformCapabilities() { capFlags = QNetworkConfigurationManager::ForcedRoaming; @@ -228,6 +234,9 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations() updateState = NotUpdating; onlineConfigurations = 0; + QFactoryLoader *l = loader(); + QStringList keys = l->keys(); + #if defined (Q_OS_DARWIN) coreWifi = QCoreWlanEngine::instance(); if (coreWifi) { @@ -242,10 +251,14 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations() this, SLOT(updateConfigurations())); } else { #endif - generic = QGenericEngine::instance(); - if (generic) { - connect(generic, SIGNAL(configurationsChanged()), - this, SLOT(updateConfigurations())); + QBearerEnginePlugin *genericPlugin = + qobject_cast<QBearerEnginePlugin *>(l->instance(QLatin1String("generic"))); + if (genericPlugin) { + generic = genericPlugin->create(QLatin1String("generic")); + if (generic) { + connect(generic, SIGNAL(configurationsChanged()), + this, SLOT(updateConfigurations())); + } } #if defined(BACKEND_NM) } |