emailuis/nmailui/src/main.cpp
changeset 49 00c7ae862740
parent 47 f83bd4ae1fe3
child 57 ae34e1715e21
equal deleted inserted replaced
48:10eaf342f539 49:00c7ae862740
     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 
    21 //parameter values
       
    22 const QString NmActivityName("EmailInboxView");
    20 const QString NmActivityName("EmailInboxView");
    23 
    21 
    24 /*!
    22 /*!
    25 	int main
    23     The main function.
    26 */
    24  */
    27 int main(int argc, char *argv[])
    25 int main(int argc, char *argv[])
    28 {
    26 {
    29     NM_FUNCTION;
    27     HbApplication app(argc,argv,Hb::NoSplash);
    30     
    28     
    31     HbApplication app(argc, argv);
       
    32  
       
    33     // Load the translation file.
    29     // Load the translation file.
    34     QTranslator translator;
    30     QTranslator translator;
    35     QString lang = QLocale::system().name();
    31     QString lang = QLocale::system().name();
    36     QString appName = "mail_";
    32     QString appName = "mail_";
    37     QString path = "Z:/resource/qt/translations/";
    33     QString path = "Z:/resource/qt/translations/";
    38     translator.load(appName + lang, path);
    34     translator.load(appName + lang, path);
    39     app.installTranslator(&translator);
    35     app.installTranslator(&translator);
    40 
    36     
    41     app.setApplicationName(hbTrId("txt_mail_title_mail"));
    37     app.setApplicationName(hbTrId("txt_mail_title_mail"));
    42 
    38     
    43     NmApplication *nmApplication = NULL;
    39     NmApplication *nmApplication = NULL;
    44     
       
    45     quint32 accountId = 0;
    40     quint32 accountId = 0;
    46     if (app.activateReason() == Hb::ActivationReasonActivity && app.activateId() == NmActivityName)
    41     if (app.activateReason() == Hb::ActivationReasonActivity &&
    47         {
    42         app.activateId() == NmActivityName) {
    48         QVariant data = app.activateParams().take("accountId");
    43         QVariant data = app.activateParams().take("accountId");
    49         QString accountIdString = data.toString();
    44         QString accountIdString = data.toString();
    50         accountId = accountIdString.toULongLong();
    45         accountId = accountIdString.toULongLong();
    51         nmApplication = new NmApplication(&app,accountId);
    46         nmApplication = new NmApplication(&app,accountId);
    52         }
    47     } else {
    53     else
       
    54         {
       
    55         nmApplication = new NmApplication(&app);
    48         nmApplication = new NmApplication(&app);
    56         }
    49     }
    57 
    50     
    58     int ret = app.exec();
    51     int ret = app.exec();
    59     delete nmApplication;
    52     delete nmApplication;
    60     return ret;
    53     return ret;
    61 }
    54 }