messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp
changeset 48 4f501b74aeb1
parent 37 518b245aa84c
child 51 3507212d340e
equal deleted inserted replaced
46:b1f0785c289d 48:4f501b74aeb1
    46     q_ptr(MsgNotifier), mCvServer(NULL), iMsgStoreHandler(NULL),
    46     q_ptr(MsgNotifier), mCvServer(NULL), iMsgStoreHandler(NULL),
    47     mSettingsManager(NULL),mPSUtils(NULL)
    47     mSettingsManager(NULL),mPSUtils(NULL)
    48 {
    48 {
    49     QDEBUG_WRITE("MsgNotifierPrivate::MsgNotifierPrivate : Enter")
    49     QDEBUG_WRITE("MsgNotifierPrivate::MsgNotifierPrivate : Enter")
    50 
    50 
    51     TRAP_IGNORE(initL());
    51     initL();
    52     QDEBUG_WRITE("MsgNotifierPrivate::MsgNotifierPrivate : Exit")
    52     QDEBUG_WRITE("MsgNotifierPrivate::MsgNotifierPrivate : Exit")
    53 }
    53 }
    54 
    54 
    55 // ----------------------------------------------------------------------------
    55 // ----------------------------------------------------------------------------
    56 // MsgNotifierPrivate::~MsgNotifierPrivate
    56 // MsgNotifierPrivate::~MsgNotifierPrivate
    58 // ----------------------------------------------------------------------------
    58 // ----------------------------------------------------------------------------
    59 MsgNotifierPrivate::~MsgNotifierPrivate()
    59 MsgNotifierPrivate::~MsgNotifierPrivate()
    60 {
    60 {
    61     QDEBUG_WRITE("MsgNotifierPrivate::~MsgNotifierPrivate : Enter")
    61     QDEBUG_WRITE("MsgNotifierPrivate::~MsgNotifierPrivate : Enter")
    62     if (mCvServer) {
    62     if (mCvServer) {
    63         mCvServer->RemoveConversationListChangeEventL(this);
    63         TRAP_IGNORE(mCvServer->RemoveConversationListChangeEventL(this));
    64         delete mCvServer;
    64         delete mCvServer;
    65         mCvServer = NULL;
    65         mCvServer = NULL;
    66     }
    66     }
    67 
    67 
    68     if (iMsgStoreHandler) {
    68     if (iMsgStoreHandler) {
   101     mCvServer->RequestConversationListChangeEventL(this);
   101     mCvServer->RequestConversationListChangeEventL(this);
   102     iMsgStoreHandler = new MsgStoreHandler(this, mCvServer);
   102     iMsgStoreHandler = new MsgStoreHandler(this, mCvServer);
   103     updateUnreadIndications(true); 
   103     updateUnreadIndications(true); 
   104     updateOutboxIndications();
   104     updateOutboxIndications();
   105 
   105 
   106     mSettingsManager = new XQSettingsManager();
   106     QT_TRYCATCH_LEAVING(mSettingsManager = new XQSettingsManager());
   107     
   107     
   108     // define property
   108     // define property
   109     mPSUtils = new XQPublishAndSubscribeUtils(*mSettingsManager);
   109     QT_TRYCATCH_LEAVING(mPSUtils = new XQPublishAndSubscribeUtils(*mSettingsManager));
       
   110     
   110     XQPublishAndSubscribeSettingsKey convIdKey(
   111     XQPublishAndSubscribeSettingsKey convIdKey(
   111             KMsgCVIdProperty, KMsgCVIdKey);
   112             KMsgCVIdProperty, KMsgCVIdKey);
   112     bool success = mPSUtils->defineProperty(convIdKey, 
   113     bool success = mPSUtils->defineProperty(convIdKey, 
   113                             XQSettingsManager::TypeInt);
   114                             XQSettingsManager::TypeInt);
   114     
   115     
   119     success = mSettingsManager->writeItemValue(convIdKey,-1);
   120     success = mSettingsManager->writeItemValue(convIdKey,-1);
   120     
   121     
   121     QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::initL "
   122     QDEBUG_WRITE_FORMAT("MsgNotifierPrivate::initL "
   122                            "writing ret value",success)
   123                            "writing ret value",success)
   123     
   124     
   124     mSts = new XQSystemToneService();
   125     QT_TRYCATCH_LEAVING(mSts = new XQSystemToneService());
   125     
   126     
   126     QDEBUG_WRITE("MsgNotifierPrivate::initL : Exit")
   127     QDEBUG_WRITE("MsgNotifierPrivate::initL : Exit")
   127 }
   128 }
   128 
   129 
   129 // ----------------------------------------------------------------------------
   130 // ----------------------------------------------------------------------------