phoneplugins/infowidgetplugin/infowidget/src/infowidgetnetworkhandler.cpp
changeset 46 bc5a64e5bc3c
parent 45 6b911d05207e
child 50 377c906a8701
child 56 5bcb308bd24d
equal deleted inserted replaced
45:6b911d05207e 46:bc5a64e5bc3c
    35 
    35 
    36 /*!
    36 /*!
    37     InfoWidgetNetworkHandler::InfoWidgetNetworkHandler()
    37     InfoWidgetNetworkHandler::InfoWidgetNetworkHandler()
    38 */
    38 */
    39 InfoWidgetNetworkHandler::InfoWidgetNetworkHandler(QObject *parent) 
    39 InfoWidgetNetworkHandler::InfoWidgetNetworkHandler(QObject *parent) 
    40     : 
    40     :QObject(parent), 
    41     QObject(parent), 
       
    42     m_nwSession(NULL) 
    41     m_nwSession(NULL) 
    43 {
    42 {
    44     DPRINT;
    43     DPRINT;
    45     
       
    46     if (!createSession()) {
    44     if (!createSession()) {
    47         DCRITICAL << ": session creation failed!"; 
    45         DCRITICAL << ": session creation failed!"; 
    48     } 
    46     } 
    49 }
    47 }
    50 
    48 
    52     InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler()
    50     InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler()
    53 */
    51 */
    54 InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler()
    52 InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler()
    55 {
    53 {
    56     DPRINT;
    54     DPRINT;
    57 
       
    58     // Disable MCN setting, 
    55     // Disable MCN setting, 
    59     // display client is being deleted 
    56     // display client is being deleted 
    60     disableMcn(); 
    57     disableMcn(); 
    61 }    
    58 }    
    62 
    59 
    85     
    82     
    86     return success; 
    83     return success; 
    87 }
    84 }
    88 
    85 
    89 /*!
    86 /*!
    90     InfoWidgetNetworkHandler::sessionExists()
       
    91 */
       
    92 bool InfoWidgetNetworkHandler::sessionExists()
       
    93 {
       
    94     return !m_nwSession.isNull(); 
       
    95 }
       
    96 
       
    97 /*!
       
    98     InfoWidgetNetworkHandler::suspend()
    87     InfoWidgetNetworkHandler::suspend()
    99 */
    88 */
   100 void InfoWidgetNetworkHandler::suspend()
    89 void InfoWidgetNetworkHandler::suspend()
   101 {
    90 {
   102     DPRINT;
    91     DPRINT;
   218     return status accordingly 
   207     return status accordingly 
   219 */
   208 */
   220 bool InfoWidgetNetworkHandler::isOnline() const
   209 bool InfoWidgetNetworkHandler::isOnline() const
   221 {
   210 {
   222     bool online(false); 
   211     bool online(false); 
   223     
   212 
   224     switch (networkRegistrationStatus()) {
   213     if (!m_nwSession.isNull()) {
   225         case ENWRegisteredBusy: // Fall through
   214         switch (networkRegistrationStatus()) {
   226         case ENWRegisteredOnHomeNetwork: // Fall through
   215             case ENWRegisteredBusy: // Fall through
   227         case ENWRegisteredRoaming: 
   216             case ENWRegisteredOnHomeNetwork: // Fall through
   228             online = true;
   217             case ENWRegisteredRoaming: 
   229             break; 
   218                 online = true;
   230         default: 
   219                 break; 
   231             break; 
   220             default: 
   232     }
   221                 break; 
   233     
   222         }
       
   223     }
   234     DPRINT << ": online: " << online;
   224     DPRINT << ": online: " << online;
   235     return online; 
   225     return online; 
   236 }
   226 }
   237 
   227 
   238 /*!
   228 /*!