src/network/bearer/qnetworkconfiguration.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
child 37 758a864f9613
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
   341     QMutexLocker locker(&d->mutex);
   341     QMutexLocker locker(&d->mutex);
   342     return d->roamingSupported;
   342     return d->roamingSupported;
   343 }
   343 }
   344 
   344 
   345 /*!
   345 /*!
   346     Returns all sub configurations of this network configuration.
   346     Returns all sub configurations of this network configuration in priority order. The first sub
   347     Only network configurations of type \l ServiceNetwork can have children. Otherwise
   347     configuration in the list has the highest priority.
   348     this function returns an empty list.
   348 
       
   349     Only network configurations of type \l ServiceNetwork can have children. Otherwise this
       
   350     function returns an empty list.
   349 */
   351 */
   350 QList<QNetworkConfiguration> QNetworkConfiguration::children() const
   352 QList<QNetworkConfiguration> QNetworkConfiguration::children() const
   351 {
   353 {
   352     QList<QNetworkConfiguration> results;
   354     QList<QNetworkConfiguration> results;
   353 
   355 
   354     if (type() != QNetworkConfiguration::ServiceNetwork || !isValid())
   356     if (type() != QNetworkConfiguration::ServiceNetwork || !isValid())
   355         return results;
   357         return results;
   356 
   358 
   357     QMutexLocker locker(&d->mutex);
   359     QMutexLocker locker(&d->mutex);
   358 
   360 
   359     QMutableListIterator<QNetworkConfigurationPrivatePointer> iter(d->serviceNetworkMembers);
   361     QMutableMapIterator<unsigned int, QNetworkConfigurationPrivatePointer> i(d->serviceNetworkMembers);
   360     while (iter.hasNext()) {
   362     while (i.hasNext()) {
   361         QNetworkConfigurationPrivatePointer p = iter.next();
   363         i.next();
       
   364 
       
   365         QNetworkConfigurationPrivatePointer p = i.value();
   362 
   366 
   363         //if we have an invalid member get rid of it -> was deleted earlier on
   367         //if we have an invalid member get rid of it -> was deleted earlier on
   364         {
   368         {
   365             QMutexLocker childLocker(&p->mutex);
   369             QMutexLocker childLocker(&p->mutex);
   366 
   370 
   367             if (!p->isValid) {
   371             if (!p->isValid) {
   368                 iter.remove();
   372                 i.remove();
   369                 continue;
   373                 continue;
   370             }
   374             }
   371         }
   375         }
   372 
   376 
   373         QNetworkConfiguration item;
   377         QNetworkConfiguration item;
   426         return QString();
   430         return QString();
   427 
   431 
   428     return d->bearerName();
   432     return d->bearerName();
   429 }
   433 }
   430 
   434 
   431 
       
   432 QT_END_NAMESPACE
   435 QT_END_NAMESPACE
   433 
   436