searchui/Searchapplication/src/main.cpp
changeset 0 ccd0fd43f247
child 2 208a4ba3894c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/searchui/Searchapplication/src/main.cpp	Mon Apr 19 14:40:05 2010 +0300
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Search application main implementation.
+ *
+ */
+
+#include "Search.h"
+#include "Search_global.h"
+
+#include <QtGui>
+#include <hbapplication.h>
+#include <qtranslator.h>
+#include <qlocale.h>
+
+// ---------------------------------------------------------------------------
+// main
+// ---------------------------------------------------------------------------
+//
+int main(int argc, char *argv[])
+    {
+    SEARCH_FUNC_ENTRY("SEARCH::Search::main");
+
+    HbApplication app(argc, argv);
+
+    QTranslator translator;
+    QString lang = QLocale::system().name();
+    QString path = "Z:/resource/qt/translations/";
+    translator.load("searchsw_" + lang, path);
+    app.installTranslator(&translator);
+
+    QTranslator commonTranslator;
+    commonTranslator.load("common_" + lang, path);
+    app.installTranslator(&commonTranslator);
+
+    Search search;
+#ifdef ROM
+    QDir::setCurrent("Z:/");
+#else
+    QDir::setCurrent("C:/");
+    SEARCHDEBUG("main() - SearchApplication's current dir set to C:/");
+#endif //ROM
+    QObject::connect(&app, SIGNAL(aboutToQuit()), &search, SLOT(stop()));
+    QObject::connect(&search, SIGNAL(exit()), &app, SLOT(quit()),
+            Qt::QueuedConnection);
+    search.start();
+    int ret = app.exec();
+    SEARCH_FUNC_EXIT("SEARCH::Search::main");
+    return ret;
+    }