qtmobility/examples/bearermonitor/bearermonitor.cpp
changeset 14 6fbed849b4f4
parent 11 06b8e2af4411
--- a/qtmobility/examples/bearermonitor/bearermonitor.cpp	Fri Jun 11 14:26:25 2010 +0300
+++ b/qtmobility/examples/bearermonitor/bearermonitor.cpp	Wed Jun 23 19:08:38 2010 +0300
@@ -80,7 +80,7 @@
             break;
         }
     }
-
+    connect(&manager, SIGNAL(onlineStateChanged(bool)), this ,SLOT(onlineStateChanged(bool)));
     connect(&manager, SIGNAL(configurationAdded(const QNetworkConfiguration&)),
             this, SLOT(configurationAdded(const QNetworkConfiguration&)));
     connect(&manager, SIGNAL(configurationRemoved(const QNetworkConfiguration&)),
@@ -88,7 +88,6 @@
     connect(&manager, SIGNAL(configurationChanged(const QNetworkConfiguration&)),
             this, SLOT(configurationChanged(const QNetworkConfiguration)));
     connect(&manager, SIGNAL(updateCompleted()), this, SLOT(updateConfigurations()));
-    connect(&manager, SIGNAL(onlineStateChanged(bool)), this ,SLOT(onlineStateChanged(bool)));
 
 #ifdef Q_OS_WIN
     connect(registerButton, SIGNAL(clicked()), this, SLOT(registerNetwork()));
@@ -111,6 +110,10 @@
 #endif
     connect(scanButton, SIGNAL(clicked()),
             this, SLOT(performScan()));
+
+    // Just in case update all configurations so that all
+    // configurations are up to date.
+    manager.updateConfigurations();
 }
 
 BearerMonitor::~BearerMonitor()
@@ -209,6 +212,10 @@
     progressBar->hide();
     scanButton->show();
 
+    // Just in case update online state, on Symbian platform
+    // WLAN scan needs to be triggered initially to have their true state.
+    onlineStateChanged(manager.isOnline());
+
     QList<QTreeWidgetItem *> items = treeWidget->findItems(QLatin1String("*"), Qt::MatchWildcard);
     QMap<QString, QTreeWidgetItem *> itemMap;
     while (!items.isEmpty()) {