main/main.cpp
changeset 23 74c9f037fd5d
child 24 99ad1390cd33
equal deleted inserted replaced
5:f7f0874bfe7d 23:74c9f037fd5d
       
     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:   ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include <hbapplication.h>
       
    21 #include <glxstatemanager.h>
       
    22 #include <hbmainwindow.h>
       
    23 #include <glxloggerenabler.h>
       
    24 
       
    25 #include <hbstyle.h>
       
    26 #include <hbstyleloader.h>
       
    27 #include <QDebug>
       
    28 #include <QTranslator>
       
    29 #include <xqserviceutil.h>
       
    30 #include <glxfetcher.h>
       
    31 
       
    32 #include "OstTraceDefinitions.h"
       
    33 #ifdef OST_TRACE_COMPILER_IN_USE
       
    34 #include "mainTraces.h"
       
    35 #endif
       
    36 
       
    37 int main(int argc, char *argv[])
       
    38     {
       
    39     OstTrace0( TRACE_IMPORTANT, _MAIN, "::main" );
       
    40     QApplication::setGraphicsSystem("openvg");
       
    41     
       
    42     QTime localTime = QTime::currentTime();
       
    43     OstTraceExt3( TRACE_NORMAL, DUP1__MAIN, "::main Time at Launch HHMMSS =%d::%d::%d",
       
    44             localTime.hour(), localTime.minute(), localTime.second() );
       
    45 
       
    46     HbApplication app(argc, argv);	
       
    47 
       
    48     // TODO: this needs to be checked where translator _really_ should be installed
       
    49     QTranslator translator;
       
    50     translator.load("photos_" + QLocale::system().name());
       
    51     qApp->installTranslator(&translator);
       
    52     
       
    53     GlxStateManager* stateMgr = NULL;
       
    54     GlxFetcher* mainWindow = NULL;
       
    55 
       
    56     HbStyleLoader::load(":/data/photos.css");
       
    57     OstTraceEventStart0( EVENT_DUP1__MAIN_START, "launch" );
       
    58 
       
    59     if(!XQServiceUtil::isService()){
       
    60 	stateMgr = new GlxStateManager();
       
    61     app.setApplicationName("Photos");          
       
    62     stateMgr->launchApplication();  
       
    63     }
       
    64     else
       
    65     {
       
    66 	mainWindow = new GlxFetcher();
       
    67     mainWindow->show();
       
    68     }
       
    69     OstTraceEventStop( EVENT_DUP1__MAIN_STOP, "launch", EVENT_DUP1__MAIN_START );
       
    70 
       
    71 	int ret = app.exec();
       
    72 	delete stateMgr;
       
    73 	delete mainWindow;
       
    74     return ret;
       
    75     }