summaryrefslogtreecommitdiffstats
path: root/examples/network
diff options
context:
space:
mode:
authorlsgunda <leena.gunda@wipro.com>2010-09-29 02:21:47 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-09-29 03:08:07 (GMT)
commit926979b6816c630adf83f7ac0d0f6276bb26efb3 (patch)
tree6939eed5ae3dbd87e9e7835feec944ab0732587d /examples/network
parent6fdfbffc9d37338dab8a0062d8e8b99ba3322b49 (diff)
downloadQt-926979b6816c630adf83f7ac0d0f6276bb26efb3.zip
Qt-926979b6816c630adf83f7ac0d0f6276bb26efb3.tar.gz
Qt-926979b6816c630adf83f7ac0d0f6276bb26efb3.tar.bz2
Fix for bug QTMOBILITY-448 to list the default network configuration in Bearermonitor example
Merge-request: 827 Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'examples/network')
-rw-r--r--examples/network/bearermonitor/bearermonitor.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/network/bearermonitor/bearermonitor.cpp b/examples/network/bearermonitor/bearermonitor.cpp
index 1959919..2c976ff 100644
--- a/examples/network/bearermonitor/bearermonitor.cpp
+++ b/examples/network/bearermonitor/bearermonitor.cpp
@@ -220,11 +220,26 @@ void BearerMonitor::updateConfigurations()
itemMap.insert(item->data(0, Qt::UserRole).toString(), item);
}
+ QNetworkConfiguration defaultConfiguration = manager.defaultConfiguration();
+ QTreeWidgetItem *defaultItem = itemMap.take(defaultConfiguration.identifier());
+
+ if (defaultItem) {
+ updateItem(defaultItem, defaultConfiguration);
+
+ if (defaultConfiguration.type() == QNetworkConfiguration::ServiceNetwork)
+ updateSnapConfiguration(defaultItem, defaultConfiguration);
+ } else {
+ configurationAdded(defaultConfiguration);
+ }
+
QList<QNetworkConfiguration> allConfigurations = manager.allConfigurations();
while (!allConfigurations.isEmpty()) {
QNetworkConfiguration config = allConfigurations.takeFirst();
+ if (config.identifier() == defaultConfiguration.identifier())
+ continue;
+
QTreeWidgetItem *item = itemMap.take(config.identifier());
if (item) {
updateItem(item, config);