emailuis/nmailui/src/main.cpp
changeset 47 f83bd4ae1fe3
parent 43 99bcbff212ad
child 49 00c7ae862740
--- a/emailuis/nmailui/src/main.cpp	Fri Jun 11 16:42:02 2010 +0300
+++ b/emailuis/nmailui/src/main.cpp	Thu Jun 24 14:32:18 2010 +0300
@@ -18,6 +18,9 @@
 
 #include "nmuiheaders.h"
 
+//parameter values
+const QString NmActivityName("EmailInboxView");
+
 /*!
 	int main
 */
@@ -29,22 +32,28 @@
  
     // Load the translation file.
     QTranslator translator;
-
-#ifdef Q_OS_SYMBIAN
     QString lang = QLocale::system().name();
     QString appName = "mail_";
     QString path = "Z:/resource/qt/translations/";
-#else
-    QString lang;
-    QString appName = "mail";
-    QString path = ":/translations";
-#endif
     translator.load(appName + lang, path);
     app.installTranslator(&translator);
 
     app.setApplicationName(hbTrId("txt_mail_title_mail"));
 
-    NmApplication *nmApplication = new NmApplication(&app);
+    NmApplication *nmApplication = NULL;
+    
+    quint32 accountId = 0;
+    if (app.activateReason() == Hb::ActivationReasonActivity && app.activateId() == NmActivityName)
+        {
+        QVariant data = app.activateParams().take("accountId");
+        QString accountIdString = data.toString();
+        accountId = accountIdString.toULongLong();
+        nmApplication = new NmApplication(&app,accountId);
+        }
+    else
+        {
+        nmApplication = new NmApplication(&app);
+        }
 
     int ret = app.exec();
     delete nmApplication;