calendarui/application/src/main.cpp
changeset 50 579cc610882e
parent 49 5de72ea7a065
child 58 ef813d54df51
equal deleted inserted replaced
49:5de72ea7a065 50:579cc610882e
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #include <QtGui>
    19 #include <QtGui>
    20 #include <QTranslator>
       
    21 #include <xqserviceutil.h>
    20 #include <xqserviceutil.h>
    22 #include <hbapplication.h> 
    21 #include <hbapplication.h>
    23 #include <hbmainwindow.h>  
    22 #include <hbmainwindow.h>
       
    23 #include <hbtranslator.h>
    24 #include "calencontroller.h"
    24 #include "calencontroller.h"
    25 #include "calenserviceprovider.h"
    25 #include "calenserviceprovider.h"
    26 
    26 
    27 
    27 
    28  int main(int argc, char *argv[])
    28  int main(int argc, char *argv[])
    31     
    31     
    32     // Main window for providing the scene context
    32     // Main window for providing the scene context
    33 	HbMainWindow window;
    33 	HbMainWindow window;
    34 	
    34 	
    35     //For translation, loading and installing translator
    35     //For translation, loading and installing translator
    36 	QTranslator translator;
    36 	HbTranslator translator("calendar");
    37     QString lang = QLocale::system().name();
    37 	translator.loadCommon();
    38     QString path = "Z:/resource/qt/translations/";
    38 	
    39     // TODO: Load the appropriate .qm file based on locale
    39     // Backup and restore code need to write here.
    40     bool loaded = translator.load("calendar_en_GB",":/translations");
       
    41     app.installTranslator(&translator);
       
    42 
       
    43     //Backup and restore code  need to write here.
       
    44 	
    40 	
    45     CCalenController *controller = new CCalenController();
    41     CCalenController *controller = new CCalenController();
       
    42 
       
    43 	int retValue = 0;
       
    44 	if (controller) {
       
    45 	    controller->constructController();
       
    46     	// Create the Calendar service provider
       
    47 	    CalenServiceProvider service(controller);
    46     
    48     
    47     // Create the Calendar service provider
    49     	retValue = app.exec();
    48     CalenServiceProvider service(controller);
       
    49     
    50     
    50     int retValue = app.exec();
    51 	    // delete the controller
    51     
    52     	controller->ReleaseCustomisations();
    52     // delete the controller
    53 	    controller->Release();
    53     controller->ReleaseCustomisations();
    54 	}
    54     controller->Release();
       
    55     
       
    56     return retValue;
    55     return retValue;
    57     }
    56     }
    58 
    57 
    59 
    58 
    60  //End of file
    59  //End of file