searchui/searchapplication/src/main.cpp
author hgs
Mon, 06 Sep 2010 09:21:19 +0530
changeset 21 708468d5143e
parent 13 0a2ec6860a93
child 26 367228f82b66
permissions -rw-r--r--
201035
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
    {
21
hgs
parents: 13
diff changeset
    32
    SEARCH_FUNC_ENTRY("SEARCH::Search::main"); PERF_APP_LAUNCH_END("SearchApplication Main Called");
9
hgs
parents:
diff changeset
    33
21
hgs
parents: 13
diff changeset
    34
    SearchApplication search(argc, argv);
9
hgs
parents:
diff changeset
    35
    QTranslator translator;
hgs
parents:
diff changeset
    36
    QString lang = QLocale::system().name();
hgs
parents:
diff changeset
    37
    QString path = "Z:/resource/qt/translations/";
13
hgs
parents: 10
diff changeset
    38
    translator.load("search_" + lang, path);
21
hgs
parents: 13
diff changeset
    39
    search.installTranslator(&translator);
9
hgs
parents:
diff changeset
    40
hgs
parents:
diff changeset
    41
    QTranslator commonTranslator;
hgs
parents:
diff changeset
    42
    commonTranslator.load("common_" + lang, path);
21
hgs
parents: 13
diff changeset
    43
    search.installTranslator(&commonTranslator);
9
hgs
parents:
diff changeset
    44
hgs
parents:
diff changeset
    45
    QTranslator musicTranslator;
hgs
parents:
diff changeset
    46
    musicTranslator.load("musicplayer_" + lang, path);
21
hgs
parents: 13
diff changeset
    47
    search.installTranslator(&musicTranslator);
9
hgs
parents:
diff changeset
    48
hgs
parents:
diff changeset
    49
    QTranslator contactsTranslator;
hgs
parents:
diff changeset
    50
    contactsTranslator.load("contacts_" + lang, path);
21
hgs
parents: 13
diff changeset
    51
    search.installTranslator(&contactsTranslator);
9
hgs
parents:
diff changeset
    52
hgs
parents:
diff changeset
    53
    QTranslator calenderTranslator;
hgs
parents:
diff changeset
    54
    calenderTranslator.load("calendar_" + lang, path);
21
hgs
parents: 13
diff changeset
    55
    search.installTranslator(&calenderTranslator);
9
hgs
parents:
diff changeset
    56
hgs
parents:
diff changeset
    57
    QTranslator notesTranslator;
hgs
parents:
diff changeset
    58
    notesTranslator.load("notes_" + lang, path);
21
hgs
parents: 13
diff changeset
    59
    search.installTranslator(&notesTranslator);
9
hgs
parents:
diff changeset
    60
    PERF_APP_LAUNCH_END("Search Component Cunstructions starts");
21
hgs
parents: 13
diff changeset
    61
9
hgs
parents:
diff changeset
    62
    PERF_APP_LAUNCH_END("Search Component Cunstructions Ends");
hgs
parents:
diff changeset
    63
#ifdef ROM
hgs
parents:
diff changeset
    64
    QDir::setCurrent("Z:/");
hgs
parents:
diff changeset
    65
#else
hgs
parents:
diff changeset
    66
    QDir::setCurrent("C:/");
hgs
parents:
diff changeset
    67
    SEARCHDEBUG("main() - SearchApplication's current dir set to C:/");
hgs
parents:
diff changeset
    68
#endif //ROM
hgs
parents:
diff changeset
    69
    search.start();
hgs
parents:
diff changeset
    70
    PERF_APP_LAUNCH_END("SearchApplication Ends, Main Event Loop");
21
hgs
parents: 13
diff changeset
    71
    int ret = search.exec();
9
hgs
parents:
diff changeset
    72
    SEARCH_FUNC_EXIT("SEARCH::Search::main");
hgs
parents:
diff changeset
    73
    return ret;
hgs
parents:
diff changeset
    74
    }