diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-05-08 13:14:09 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-09 13:40:23 +0200 |
commit | 4e4403d69c60ea6429b3ad5e7898a84b1dc92be5 (patch) | |
tree | 4d8c3f222412438643fe54508036a452c6967152 /src/network/bearer | |
parent | b316c3ac5e4acac75505bfd77677cecc181599af (diff) |
No longer use deprecated methods for plugin loading.
Change-Id: I19c66b1c41ea4dd236726c86d7d071b210ec9244
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/network/bearer')
-rw-r--r-- | src/network/bearer/qnetworkconfigmanager_p.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp index 527e55008e..ce04934865 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.cpp +++ b/src/network/bearer/qnetworkconfigmanager_p.cpp @@ -366,6 +366,10 @@ void QNetworkConfigurationManagerPrivate::configurationChanged(QNetworkConfigura void QNetworkConfigurationManagerPrivate::updateConfigurations() { +#ifndef QT_NO_LIBRARY + typedef QMultiMap<int, QString> PluginKeyMap; + typedef PluginKeyMap::const_iterator PluginKeyMapConstIterator; +#endif QMutexLocker locker(&mutex); if (firstUpdate) { @@ -376,15 +380,12 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations() #ifndef QT_NO_LIBRARY QBearerEngine *generic = 0; - QFactoryLoader *l = loader(); - foreach (const QString &key, l->keys()) { - QBearerEnginePlugin *plugin = qobject_cast<QBearerEnginePlugin *>(l->instance(key)); - if (plugin) { - QBearerEngine *engine = plugin->create(key); - if (!engine) - continue; - + const PluginKeyMap keyMap = l->keyMap(); + const PluginKeyMapConstIterator cend = keyMap.constEnd(); + for (PluginKeyMapConstIterator it = keyMap.constBegin(); it != cend; ++it) { + const QString &key = it.value(); + if (QBearerEngine *engine = qLoadPlugin<QBearerEngine, QBearerEnginePlugin>(l, key)) { if (key == QLatin1String("generic")) generic = engine; else |