diff -r bf7eb7911fc5 -r 997a02608b3a emailuis/nmailui/src/main.cpp --- a/emailuis/nmailui/src/main.cpp Wed Jun 23 18:00:21 2010 +0300 +++ b/emailuis/nmailui/src/main.cpp Tue Jul 06 14:04:34 2010 +0300 @@ -1,51 +1,53 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - + * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ #include "nmuiheaders.h" +const QString NmActivityName("EmailInboxView"); + /*! - int main -*/ + The main function. + */ int main(int argc, char *argv[]) { - NM_FUNCTION; + HbApplication app(argc,argv,Hb::NoSplash); - HbApplication app(argc, argv); - // 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; return ret;