summaryrefslogtreecommitdiffstats
path: root/src/network/bearer/qnetworkconfigmanager_p.cpp
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-01-24 23:53:12 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-01-26 23:36:04 (GMT)
commitd3b580fe8b2b0c185f0eadbf794156058496eff3 (patch)
tree5567ec5a433349ba8a7bfceb0e3c910745baa21d /src/network/bearer/qnetworkconfigmanager_p.cpp
parent084c9659719ac310630ac0c1a81d013176f9c350 (diff)
downloadQt-d3b580fe8b2b0c185f0eadbf794156058496eff3.zip
Qt-d3b580fe8b2b0c185f0eadbf794156058496eff3.tar.gz
Qt-d3b580fe8b2b0c185f0eadbf794156058496eff3.tar.bz2
Return default configuration from engines.
Diffstat (limited to 'src/network/bearer/qnetworkconfigmanager_p.cpp')
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp34
1 files changed, 8 insertions, 26 deletions
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index c00d6d3..bc3cfbd 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -212,42 +212,24 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
}
/*!
- Returns the first active configuration found, if one exists; otherwise returns the first
- discovered configuration found, if one exists; otherwise returns an empty configuration.
+ Returns the default configuration of the first plugin, if one exists; otherwise returns an
+ invalid configuration.
\internal
*/
QNetworkConfiguration QNetworkConfigurationManagerPrivate::defaultConfiguration()
{
- QNetworkConfigurationPrivatePointer firstActive;
- QNetworkConfigurationPrivatePointer firstDiscovered;
-
foreach (QNetworkSessionEngine *engine, sessionEngines) {
- QHash<QString, QNetworkConfigurationPrivatePointer>::const_iterator i =
- engine->accessPointConfigurations.constBegin();
-
- while (i != engine->accessPointConfigurations.constEnd()) {
- QNetworkConfigurationPrivatePointer priv = i.value();
-
- if (!firstActive && priv->isValid &&
- (priv->state & QNetworkConfiguration::Active) == QNetworkConfiguration::Active)
- firstActive = priv;
- if (!firstDiscovered && priv->isValid &&
- (priv->state & QNetworkConfiguration::Discovered) == QNetworkConfiguration::Discovered)
- firstDiscovered = priv;
+ QNetworkConfigurationPrivatePointer ptr = engine->defaultConfiguration();
- ++i;
+ if (ptr) {
+ QNetworkConfiguration config;
+ config.d = ptr;
+ return config;
}
}
- QNetworkConfiguration item;
-
- if (firstActive)
- item.d = firstActive;
- else if (firstDiscovered)
- item.d = firstDiscovered;
-
- return item;
+ return QNetworkConfiguration();
}
void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate()