emailuis/nmailui/src/main.cpp
branchGCC_SURGE
changeset 55 cdd802add233
parent 54 997a02608b3a
child 59 16ed8d08d0b1
equal deleted inserted replaced
28:011f79704660 55:cdd802add233
     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     HbApplication app(argc, argv);
    27     HbApplication app(argc,argv,Hb::NoSplash);
    27  
    28     
    28     // Load the translation file.
    29     // Load the translation file.
    29     QTranslator translator;
    30     QTranslator translator;
    30 
       
    31 #ifdef Q_OS_SYMBIAN
       
    32     QString lang = QLocale::system().name();
    31     QString lang = QLocale::system().name();
    33     QString appName = "mail_";
    32     QString appName = "mail_";
    34     QString path = "Z:/resource/qt/translations/";
    33     QString path = "Z:/resource/qt/translations/";
    35 #else
       
    36     QString lang;
       
    37     QString appName = "mail";
       
    38     QString path = ":/translations";
       
    39 #endif
       
    40     translator.load(appName + lang, path);
    34     translator.load(appName + lang, path);
    41     app.installTranslator(&translator);
    35     app.installTranslator(&translator);
    42 
    36     
    43     app.setApplicationName(hbTrId("txt_mail_title_mail"));
    37     app.setApplicationName(hbTrId("txt_mail_title_mail"));
    44 
    38     
    45     NmApplication *nmApplication = new NmApplication(&app);
    39     NmApplication *nmApplication = NULL;
    46 
    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     
    47     int ret = app.exec();
    51     int ret = app.exec();
    48     delete nmApplication;
    52     delete nmApplication;
    49     return ret;
    53     return ret;
    50 }
    54 }