diff options
-rw-r--r-- | examples/network/bearermonitor/bearermonitor.cpp | 15 |
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); |