summaryrefslogtreecommitdiffstats
path: root/src/network/bearer
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-07-23 05:16:30 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-07-23 05:20:28 (GMT)
commit959efa8daab2715d18440ed8b890b9dd2b501fc7 (patch)
tree14e46780e6d910e3a911dadd68e4273f14b25f1a /src/network/bearer
parent618aa624538eb0f591cfa817e1520bc8810792c7 (diff)
downloadQt-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')
-rw-r--r--src/network/bearer/qnetworkconfiguration.cpp19
-rw-r--r--src/network/bearer/qnetworkconfiguration_p.h3
2 files changed, 13 insertions, 9 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
diff --git a/src/network/bearer/qnetworkconfiguration_p.h b/src/network/bearer/qnetworkconfiguration_p.h
index 6e146e0..966dfb2 100644
--- a/src/network/bearer/qnetworkconfiguration_p.h
+++ b/src/network/bearer/qnetworkconfiguration_p.h
@@ -57,6 +57,7 @@
#include <QtCore/qshareddata.h>
#include <QtCore/qmutex.h>
+#include <QtCore/qmap.h>
QT_BEGIN_NAMESPACE
@@ -84,7 +85,7 @@ public:
return bearer;
}
- QList<QNetworkConfigurationPrivatePointer> serviceNetworkMembers;
+ QMap<unsigned int, QNetworkConfigurationPrivatePointer> serviceNetworkMembers;
mutable QMutex mutex;