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