diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-07-23 05:16:30 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-07-23 05:20:28 (GMT) |
commit | 959efa8daab2715d18440ed8b890b9dd2b501fc7 (patch) | |
tree | 14e46780e6d910e3a911dadd68e4273f14b25f1a /src/network/bearer/qnetworkconfiguration.cpp | |
parent | 618aa624538eb0f591cfa817e1520bc8810792c7 (diff) | |
download | Qt-959efa8daab2715d18440ed8b890b9dd2b501fc7.zip Qt-959efa8daab2715d18440ed8b890b9dd2b501fc7.tar.gz Qt-959efa8daab2715d18440ed8b890b9dd2b501fc7.tar.bz2 |
Order network configurations in service networks in priority order.
It is useful to know the priority order of the sub configurations of
a service network.
Task-number: QTBUG-11678
RevBy: juhvu <qt-info@nokia.com>
Diffstat (limited to 'src/network/bearer/qnetworkconfiguration.cpp')
-rw-r--r-- | src/network/bearer/qnetworkconfiguration.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp index 4108fee..d7fceba 100644 --- a/src/network/bearer/qnetworkconfiguration.cpp +++ b/src/network/bearer/qnetworkconfiguration.cpp @@ -343,9 +343,11 @@ bool QNetworkConfiguration::isRoamingAvailable() const } /*! - Returns all sub configurations of this network configuration. - Only network configurations of type \l ServiceNetwork can have children. Otherwise - this function returns an empty list. + Returns all sub configurations of this network configuration in priority order. The first sub + configuration in the list has the highest priority. + + Only network configurations of type \l ServiceNetwork can have children. Otherwise this + function returns an empty list. */ QList<QNetworkConfiguration> QNetworkConfiguration::children() const { @@ -356,16 +358,18 @@ QList<QNetworkConfiguration> QNetworkConfiguration::children() const QMutexLocker locker(&d->mutex); - QMutableListIterator<QNetworkConfigurationPrivatePointer> iter(d->serviceNetworkMembers); - while (iter.hasNext()) { - QNetworkConfigurationPrivatePointer p = iter.next(); + QMutableMapIterator<unsigned int, QNetworkConfigurationPrivatePointer> i(d->serviceNetworkMembers); + while (i.hasNext()) { + i.next(); + + QNetworkConfigurationPrivatePointer p = i.value(); //if we have an invalid member get rid of it -> was deleted earlier on { QMutexLocker childLocker(&p->mutex); if (!p->isValid) { - iter.remove(); + i.remove(); continue; } } @@ -428,6 +432,5 @@ QString QNetworkConfiguration::bearerName() const return d->bearerName(); } - QT_END_NAMESPACE |