searchui/Searchapplication/src/main.cpp
changeset 9 4a2987baf8f7
parent 8 2f67eb14d003
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 
       
    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 
       
    62     Search search;
       
    63 #ifdef ROM
       
    64     QDir::setCurrent("Z:/");
       
    65 #else
       
    66     QDir::setCurrent("C:/");
       
    67     SEARCHDEBUG("main() - SearchApplication's current dir set to C:/");
       
    68 #endif //ROM
       
    69     QObject::connect(&app, SIGNAL(aboutToQuit()), &search, SLOT(stop()));
       
    70     QObject::connect(&search, SIGNAL(exit()), &app, SLOT(quit()),
       
    71             Qt::QueuedConnection);
       
    72     search.start();
       
    73     int ret = app.exec();
       
    74     SEARCH_FUNC_EXIT("SEARCH::Search::main");
       
    75     return ret;
       
    76     }