diff options
Diffstat (limited to 'src/network/bearer')
-rw-r--r-- | src/network/bearer/qnetworkconfiguration.cpp | 19 | ||||
-rw-r--r-- | src/network/bearer/qnetworkconfiguration_p.h | 3 |
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; |