emailuis/nmailui/src/main.cpp
changeset 54 997a02608b3a
parent 30 759dc5235cdb
child 59 16ed8d08d0b1
equal deleted inserted replaced
53:bf7eb7911fc5 54:997a02608b3a
     1 /*
     1 /*
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     8  *
     9 * Initial Contributors:
     9  * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10  * Nokia Corporation - initial contribution.
    11 *
    11  *
    12 * Contributors:
    12  * Contributors:
    13 *
    13  *
    14 * Description:
    14  * Description:
    15 *
    15  *
    16 */
    16  */
    17 
       
    18 
    17 
    19 #include "nmuiheaders.h"
    18 #include "nmuiheaders.h"
    20 
    19 
       
    20 const QString NmActivityName("EmailInboxView");
       
    21 
    21 /*!
    22 /*!
    22 	int main
    23     The main function.
    23 */
    24  */
    24 int main(int argc, char *argv[])
    25 int main(int argc, char *argv[])
    25 {
    26 {
    26     NM_FUNCTION;
    27     HbApplication app(argc,argv,Hb::NoSplash);
    27     
    28     
    28     HbApplication app(argc, argv);
       
    29  
       
    30     // Load the translation file.
    29     // Load the translation file.
    31     QTranslator translator;
    30     QTranslator translator;
    32 
       
    33 #ifdef Q_OS_SYMBIAN
       
    34     QString lang = QLocale::system().name();
    31     QString lang = QLocale::system().name();
    35     QString appName = "mail_";
    32     QString appName = "mail_";
    36     QString path = "Z:/resource/qt/translations/";
    33     QString path = "Z:/resource/qt/translations/";
    37 #else
       
    38     QString lang;
       
    39     QString appName = "mail";
       
    40     QString path = ":/translations";
       
    41 #endif
       
    42     translator.load(appName + lang, path);
    34     translator.load(appName + lang, path);
    43     app.installTranslator(&translator);
    35     app.installTranslator(&translator);
    44 
    36     
    45     app.setApplicationName(hbTrId("txt_mail_title_mail"));
    37     app.setApplicationName(hbTrId("txt_mail_title_mail"));
    46 
    38     
    47     NmApplication *nmApplication = new NmApplication(&app);
    39     NmApplication *nmApplication = NULL;
    48 
    40     quint32 accountId = 0;
       
    41     if (app.activateReason() == Hb::ActivationReasonActivity &&
       
    42         app.activateId() == NmActivityName) {
       
    43         QVariant data = app.activateParams().take("accountId");
       
    44         QString accountIdString = data.toString();
       
    45         accountId = accountIdString.toULongLong();
       
    46         nmApplication = new NmApplication(&app,accountId);
       
    47     } else {
       
    48         nmApplication = new NmApplication(&app);
       
    49     }
       
    50     
    49     int ret = app.exec();
    51     int ret = app.exec();
    50     delete nmApplication;
    52     delete nmApplication;
    51     return ret;
    53     return ret;
    52 }
    54 }