phoneplugins/infowidgetplugin/infowidget/src/infowidgetnetworkhandler.cpp
changeset 56 5bcb308bd24d
parent 46 bc5a64e5bc3c
equal deleted inserted replaced
46:bc5a64e5bc3c 56:5bcb308bd24d
    50     InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler()
    50     InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler()
    51 */
    51 */
    52 InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler()
    52 InfoWidgetNetworkHandler::~InfoWidgetNetworkHandler()
    53 {
    53 {
    54     DPRINT;
    54     DPRINT;
    55     // Disable MCN setting, 
    55     try {
    56     // display client is being deleted 
    56         // Disable MCN setting, 
    57     disableMcn(); 
    57         // display client is being deleted
       
    58         disableMcn(); 
       
    59     } catch (const std::exception& ex) {
       
    60         DCRITICAL << ": exception detected: " << ex.what();  
       
    61     }      
       
    62      
    58 }    
    63 }    
    59 
    64 
    60 /*!
    65 /*!
    61     InfoWidgetNetworkHandler::createSession()
    66     InfoWidgetNetworkHandler::createSession()
    62 */
    67 */
    63 bool InfoWidgetNetworkHandler::createSession()
    68 bool InfoWidgetNetworkHandler::createSession()
    64 {
    69 {
    65     DPRINT;
    70     DPRINT;
    66     bool success(false);
    71     bool success(false);
    67     if (!m_nwSession) {
    72     if (!m_nwSession) {
    68         try {
    73         QT_TRAP_THROWING(m_nwSession.reset(
    69             QT_TRAP_THROWING(m_nwSession.reset(
    74                 CreateL(*this, m_nwInfo)));
    70                     CreateL(*this, m_nwInfo)));
    75         if (m_nwSession) {
    71         } catch (const std::exception& ex) {
       
    72             DCRITICAL << ": exception " << ex.what(); 
       
    73         }
       
    74         
       
    75         if (!m_nwSession.isNull()) {
       
    76             DPRINT << ": session created"; 
    76             DPRINT << ": session created"; 
    77             success = true;
    77             success = true;
    78         }
    78         }
    79     } else {
    79     } else {
    80         DWARNING << ": session already created!"; 
    80         DWARNING << ": session already created!"; 
   290         DPRINT << ": Exception occured while emitting signal:" << result;
   290         DPRINT << ": Exception occured while emitting signal:" << result;
   291     }
   291     }
   292 }
   292 }
   293 
   293 
   294 /*!
   294 /*!
   295     InfoWidgetNetworkHandler::writeMcnDisplayState()
   295     Write Mcn cenrep key.   
   296     
       
   297     Handler for cenrep key writing   
       
   298 */
   296 */
   299 void InfoWidgetNetworkHandler::writeMcnDisplayState(bool enabled)
   297 void InfoWidgetNetworkHandler::writeMcnDisplayState(bool enabled)
   300 {
   298 {
   301     QScopedPointer<XQSettingsManager> settingsManager(new XQSettingsManager); 
   299     QScopedPointer<XQSettingsManager> settingsManager(new XQSettingsManager); 
   302     XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, 
   300     XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, 
   312     DPRINT << ": write success: " << result << " mcn enabled: " << enabled;
   310     DPRINT << ": write success: " << result << " mcn enabled: " << enabled;
   313      
   311      
   314 }
   312 }
   315 
   313 
   316 /*!
   314 /*!
   317     InfoWidgetNetworkHandler::readMcnDisplayState()
   315     Read Mcn cenrep key.
   318 */
   316 */
   319 bool InfoWidgetNetworkHandler::readMcnDisplayState()
   317 bool InfoWidgetNetworkHandler::readMcnDisplayState()
   320 {
   318 {
   321     QScopedPointer<XQSettingsManager> settingsManager(new XQSettingsManager); 
   319     QScopedPointer<XQSettingsManager> settingsManager(new XQSettingsManager); 
   322     XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository, 
   320     XQSettingsKey settingsKey(XQSettingsKey::TargetCentralRepository,