emailuis/nmailui/src/nmmailboxserviceinterface.cpp
changeset 62 a8c646b56683
parent 47 f83bd4ae1fe3
child 68 83cc6bae1de8
--- a/emailuis/nmailui/src/nmmailboxserviceinterface.cpp	Thu Aug 05 21:09:09 2010 +0300
+++ b/emailuis/nmailui/src/nmmailboxserviceinterface.cpp	Mon Aug 23 23:32:31 2010 +0300
@@ -69,14 +69,13 @@
     // Make sure that app stays background if user presses back in message list view
     bool visible = mApplication->updateVisibilityState();
 
-    // Verify that the ID matches one of the existing mailboxes.
     if (mailboxExistsById(mailboxNmId)) {
-
-        // Get standard folder inbox id.
-        const NmId inboxId = mUiEngine.standardFolderId(mailboxNmId, NmFolderInbox);
-
+        // Fetch inbox id
+        NmId inboxId = mUiEngine.standardFolderId(mailboxNmId, NmFolderInbox);
         // Bring the application to the foreground.
-        XQServiceUtil::toBackground(false);
+        if (!XQServiceUtil::isEmbedded()) {
+            XQServiceUtil::toBackground(false);
+        }
         if (mApplication) {
             HbMainWindow *mainWindow = mApplication->mainWindow();
             mainWindow->show();
@@ -93,11 +92,11 @@
                                    true); // start as service
             mApplication->enterNmUiView(startParam);
         }
-       
+
         completeRequest(mAsyncReqId, 0);
     }
     else {
-        // No mailbox found with the given ID.
+        // No mailbox found with the given ID or Inbox ID is not known
 
         // if started as embedded, do not hide the app
 		if (!XQServiceUtil::isEmbedded() && !visible) {
@@ -138,7 +137,7 @@
         mailbox = mailboxListModel.data(modelIndex);
         mailboxMetaData = mailbox.value<NmMailboxMetaData*>();
         if (mailboxMetaData) {
-            currentId = mailboxMetaData->id();        
+            currentId = mailboxMetaData->id();
         }
 
         if (currentId.id() == mailboxId.id()) {