searchui/searchapplication/src/main.cpp
changeset 9 4a2987baf8f7
child 10 d05738f02936
equal deleted inserted replaced
8:2f67eb14d003 9:4a2987baf8f7
       
     1 /*
       
     2  * Copyright (c) 2009 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:  Search application main implementation.
       
    15  *
       
    16  */
       
    17 
       
    18 #include "search.h"
       
    19 #include "search_global.h"
       
    20 
       
    21 #include <QtGui>
       
    22 #include <hbapplication.h>
       
    23 #include <qtranslator.h>
       
    24 #include <qlocale.h>
       
    25 
       
    26 // ---------------------------------------------------------------------------
       
    27 // main
       
    28 // ---------------------------------------------------------------------------
       
    29 //
       
    30 int main(int argc, char *argv[])
       
    31     {
       
    32     SEARCH_FUNC_ENTRY("SEARCH::Search::main");
       
    33     PERF_APP_LAUNCH_END("SearchApplication Main Called");
       
    34     HbApplication app(argc, argv);
       
    35 
       
    36     QTranslator translator;
       
    37     QString lang = QLocale::system().name();
       
    38     QString path = "Z:/resource/qt/translations/";
       
    39     translator.load("searchsw_" + lang, path);
       
    40     app.installTranslator(&translator);
       
    41 
       
    42     QTranslator commonTranslator;
       
    43     commonTranslator.load("common_" + lang, path);
       
    44     app.installTranslator(&commonTranslator);
       
    45 
       
    46     QTranslator musicTranslator;
       
    47     musicTranslator.load("musicplayer_" + lang, path);
       
    48     app.installTranslator(&musicTranslator);
       
    49 
       
    50     QTranslator contactsTranslator;
       
    51     contactsTranslator.load("contacts_" + lang, path);
       
    52     app.installTranslator(&contactsTranslator);
       
    53 
       
    54     QTranslator calenderTranslator;
       
    55     calenderTranslator.load("calendar_" + lang, path);
       
    56     app.installTranslator(&calenderTranslator);
       
    57 
       
    58     QTranslator notesTranslator;
       
    59     notesTranslator.load("notes_" + lang, path);
       
    60     app.installTranslator(&notesTranslator);
       
    61     PERF_APP_LAUNCH_END("Search Component Cunstructions starts");
       
    62     Search search;
       
    63     PERF_APP_LAUNCH_END("Search Component Cunstructions Ends");
       
    64 #ifdef ROM
       
    65     QDir::setCurrent("Z:/");
       
    66 #else
       
    67     QDir::setCurrent("C:/");
       
    68     SEARCHDEBUG("main() - SearchApplication's current dir set to C:/");
       
    69 #endif //ROM
       
    70     QObject::connect(&app, SIGNAL(aboutToQuit()), &search, SLOT(stop()));
       
    71     QObject::connect(&search, SIGNAL(exit()), &app, SLOT(quit()),
       
    72             Qt::QueuedConnection);
       
    73     search.start();
       
    74     PERF_APP_LAUNCH_END("SearchApplication Ends, Main Event Loop");
       
    75     int ret = app.exec();
       
    76     SEARCH_FUNC_EXIT("SEARCH::Search::main");
       
    77     return ret;
       
    78     }