searchui/searchapplication/src/main.cpp
author hgs
Tue, 29 Jun 2010 22:28:37 +0530
changeset 10 d05738f02936
parent 9 4a2987baf8f7
child 13 0a2ec6860a93
permissions -rw-r--r--
201025_03
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
 * All rights reserved.
hgs
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
 * which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
 *
hgs
parents:
diff changeset
     9
 * Initial Contributors:
hgs
parents:
diff changeset
    10
 * Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
 *
hgs
parents:
diff changeset
    12
 * Contributors:
hgs
parents:
diff changeset
    13
 *
hgs
parents:
diff changeset
    14
 * Description:  Search application main implementation.
hgs
parents:
diff changeset
    15
 *
hgs
parents:
diff changeset
    16
 */
hgs
parents:
diff changeset
    17
10
d05738f02936 201025_03
hgs
parents: 9
diff changeset
    18
#include "searchapplication.h"
9
hgs
parents:
diff changeset
    19
#include "search_global.h"
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
#include <QtGui>
hgs
parents:
diff changeset
    22
#include <hbapplication.h>
hgs
parents:
diff changeset
    23
#include <qtranslator.h>
hgs
parents:
diff changeset
    24
#include <qlocale.h>
hgs
parents:
diff changeset
    25
hgs
parents:
diff changeset
    26
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    27
// main
hgs
parents:
diff changeset
    28
// ---------------------------------------------------------------------------
hgs
parents:
diff changeset
    29
//
hgs
parents:
diff changeset
    30
int main(int argc, char *argv[])
hgs
parents:
diff changeset
    31
    {
hgs
parents:
diff changeset
    32
    SEARCH_FUNC_ENTRY("SEARCH::Search::main");
hgs
parents:
diff changeset
    33
    PERF_APP_LAUNCH_END("SearchApplication Main Called");
hgs
parents:
diff changeset
    34
    HbApplication app(argc, argv);
hgs
parents:
diff changeset
    35
hgs
parents:
diff changeset
    36
    QTranslator translator;
hgs
parents:
diff changeset
    37
    QString lang = QLocale::system().name();
hgs
parents:
diff changeset
    38
    QString path = "Z:/resource/qt/translations/";
hgs
parents:
diff changeset
    39
    translator.load("searchsw_" + lang, path);
hgs
parents:
diff changeset
    40
    app.installTranslator(&translator);
hgs
parents:
diff changeset
    41
hgs
parents:
diff changeset
    42
    QTranslator commonTranslator;
hgs
parents:
diff changeset
    43
    commonTranslator.load("common_" + lang, path);
hgs
parents:
diff changeset
    44
    app.installTranslator(&commonTranslator);
hgs
parents:
diff changeset
    45
hgs
parents:
diff changeset
    46
    QTranslator musicTranslator;
hgs
parents:
diff changeset
    47
    musicTranslator.load("musicplayer_" + lang, path);
hgs
parents:
diff changeset
    48
    app.installTranslator(&musicTranslator);
hgs
parents:
diff changeset
    49
hgs
parents:
diff changeset
    50
    QTranslator contactsTranslator;
hgs
parents:
diff changeset
    51
    contactsTranslator.load("contacts_" + lang, path);
hgs
parents:
diff changeset
    52
    app.installTranslator(&contactsTranslator);
hgs
parents:
diff changeset
    53
hgs
parents:
diff changeset
    54
    QTranslator calenderTranslator;
hgs
parents:
diff changeset
    55
    calenderTranslator.load("calendar_" + lang, path);
hgs
parents:
diff changeset
    56
    app.installTranslator(&calenderTranslator);
hgs
parents:
diff changeset
    57
hgs
parents:
diff changeset
    58
    QTranslator notesTranslator;
hgs
parents:
diff changeset
    59
    notesTranslator.load("notes_" + lang, path);
hgs
parents:
diff changeset
    60
    app.installTranslator(&notesTranslator);
hgs
parents:
diff changeset
    61
    PERF_APP_LAUNCH_END("Search Component Cunstructions starts");
10
d05738f02936 201025_03
hgs
parents: 9
diff changeset
    62
    SearchApplication search;
9
hgs
parents:
diff changeset
    63
    PERF_APP_LAUNCH_END("Search Component Cunstructions Ends");
hgs
parents:
diff changeset
    64
#ifdef ROM
hgs
parents:
diff changeset
    65
    QDir::setCurrent("Z:/");
hgs
parents:
diff changeset
    66
#else
hgs
parents:
diff changeset
    67
    QDir::setCurrent("C:/");
hgs
parents:
diff changeset
    68
    SEARCHDEBUG("main() - SearchApplication's current dir set to C:/");
hgs
parents:
diff changeset
    69
#endif //ROM
hgs
parents:
diff changeset
    70
    QObject::connect(&app, SIGNAL(aboutToQuit()), &search, SLOT(stop()));
hgs
parents:
diff changeset
    71
    QObject::connect(&search, SIGNAL(exit()), &app, SLOT(quit()),
hgs
parents:
diff changeset
    72
            Qt::QueuedConnection);
hgs
parents:
diff changeset
    73
    search.start();
hgs
parents:
diff changeset
    74
    PERF_APP_LAUNCH_END("SearchApplication Ends, Main Event Loop");
hgs
parents:
diff changeset
    75
    int ret = app.exec();
hgs
parents:
diff changeset
    76
    SEARCH_FUNC_EXIT("SEARCH::Search::main");
hgs
parents:
diff changeset
    77
    return ret;
hgs
parents:
diff changeset
    78
    }