From 926979b6816c630adf83f7ac0d0f6276bb26efb3 Mon Sep 17 00:00:00 2001 From: lsgunda Date: Wed, 29 Sep 2010 12:21:47 +1000 Subject: Fix for bug QTMOBILITY-448 to list the default network configuration in Bearermonitor example Merge-request: 827 Reviewed-by: Aaron McCarthy --- examples/network/bearermonitor/bearermonitor.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 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); -- cgit v0.12