searchui/Searchapplication/src/main.cpp
changeset 0 ccd0fd43f247
child 2 208a4ba3894c
equal deleted inserted replaced
-1:000000000000 0:ccd0fd43f247
       
     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 
       
    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     Search search;
       
    47 #ifdef ROM
       
    48     QDir::setCurrent("Z:/");
       
    49 #else
       
    50     QDir::setCurrent("C:/");
       
    51     SEARCHDEBUG("main() - SearchApplication's current dir set to C:/");
       
    52 #endif //ROM
       
    53     QObject::connect(&app, SIGNAL(aboutToQuit()), &search, SLOT(stop()));
       
    54     QObject::connect(&search, SIGNAL(exit()), &app, SLOT(quit()),
       
    55             Qt::QueuedConnection);
       
    56     search.start();
       
    57     int ret = app.exec();
       
    58     SEARCH_FUNC_EXIT("SEARCH::Search::main");
       
    59     return ret;
       
    60     }