diff -r e8a69c93c830 -r ecf6a73a9186 messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp --- a/messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp Fri Sep 17 20:16:33 2010 +0530 +++ b/messagingapp/msgnotifications/msgnotifier/src/msgnotifier_p.cpp Tue Oct 05 13:58:47 2010 +0530 @@ -371,38 +371,42 @@ // ---------------------------------------------------------------------------- bool MsgNotifierPrivate::showNotification(int receivedMsgConvId) { - bool showNotification = true; + bool showNotification = false; RWsSession wsSession ; - wsSession.Connect(); + int err = wsSession.Connect(); - TApaTaskList taskList( wsSession ); - TApaTask task = taskList.FindApp(KMsgAppUid); // find msgapp is running - - if(task.Exists()) + if ( KErrNone == err ) { - TApaTask foregndtask = taskList.FindByPos(0) ; // foreground app - // compare window group id - // if application is in foregorund, then check the currently - // opened conversation is same as received one. - if(task.WgId() == foregndtask.WgId() ) + showNotification = true; + TApaTaskList taskList(wsSession); + TApaTask task = taskList.FindApp(KMsgAppUid); // find msgapp is running + + if (task.Exists()) { - // get the current conversation ID - XQPublishAndSubscribeSettingsKey convIdKey( KMsgCVIdProperty, - KMsgCVIdKey); - QVariant value = mSettingsManager->readItemValue(convIdKey, - XQSettingsManager::TypeInt); + TApaTask foregndtask = taskList.FindByPos(0); // foreground app + // compare window group id + // if application is in foregorund, then check the currently + // opened conversation is same as received one. + if (task.WgId() == foregndtask.WgId()) + { + // get the current conversation ID + XQPublishAndSubscribeSettingsKey convIdKey(KMsgCVIdProperty, + KMsgCVIdKey); + QVariant value = mSettingsManager->readItemValue(convIdKey, + XQSettingsManager::TypeInt); - int openedConvId = value.toInt(); - if( openedConvId == receivedMsgConvId) - { - showNotification = false; - QDEBUG_WRITE("processListEntry : Notification not shown") + int openedConvId = value.toInt(); + if (openedConvId == receivedMsgConvId) + { + showNotification = false; + QDEBUG_WRITE("processListEntry : Notification not shown") + } } } + + wsSession.Close(); } - - wsSession.Close(); return showNotification; } // ----------------------------------------------------------------------------