phoneplugins/infowidgetplugin/infowidget/src/infowidgetnetworkhandler.cpp
changeset 46 bc5a64e5bc3c
parent 45 6b911d05207e
child 50 377c906a8701
child 56 5bcb308bd24d
--- a/phoneplugins/infowidgetplugin/infowidget/src/infowidgetnetworkhandler.cpp	Wed Jun 23 18:12:20 2010 +0300
+++ b/phoneplugins/infowidgetplugin/infowidget/src/infowidgetnetworkhandler.cpp	Tue Jul 06 14:15:47 2010 +0300
@@ -37,12 +37,10 @@
     InfoWidgetNetworkHandler::InfoWidgetNetworkHandler()
 */
 InfoWidgetNetworkHandler::InfoWidgetNetworkHandler(QObject *parent) 
-    : 
-    QObject(parent), 
+    :QObject(parent), 
     m_nwSession(NULL) 
 {
     DPRINT;
-    
     if (!createSession()) {
         DCRITICAL << ": session creation failed!"; 
     } 
@@ -54,7 +52,6 @@
 InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler()
 {
     DPRINT;
-
     // Disable MCN setting, 
     // display client is being deleted 
     disableMcn(); 
@@ -87,14 +84,6 @@
 }
 
 /*!
-    InfoWidgetNetworkHandler::sessionExists()
-*/
-bool InfoWidgetNetworkHandler::sessionExists()
-{
-    return !m_nwSession.isNull(); 
-}
-
-/*!
     InfoWidgetNetworkHandler::suspend()
 */
 void InfoWidgetNetworkHandler::suspend()
@@ -220,17 +209,18 @@
 bool InfoWidgetNetworkHandler::isOnline() const
 {
     bool online(false); 
-    
-    switch (networkRegistrationStatus()) {
-        case ENWRegisteredBusy: // Fall through
-        case ENWRegisteredOnHomeNetwork: // Fall through
-        case ENWRegisteredRoaming: 
-            online = true;
-            break; 
-        default: 
-            break; 
+
+    if (!m_nwSession.isNull()) {
+        switch (networkRegistrationStatus()) {
+            case ENWRegisteredBusy: // Fall through
+            case ENWRegisteredOnHomeNetwork: // Fall through
+            case ENWRegisteredRoaming: 
+                online = true;
+                break; 
+            default: 
+                break; 
+        }
     }
-    
     DPRINT << ": online: " << online;
     return online; 
 }