calendarui/application/src/main.cpp
changeset 50 579cc610882e
parent 49 5de72ea7a065
child 58 ef813d54df51
--- a/calendarui/application/src/main.cpp	Wed Jun 23 18:11:28 2010 +0300
+++ b/calendarui/application/src/main.cpp	Tue Jul 06 14:14:56 2010 +0300
@@ -17,10 +17,10 @@
 
 
 #include <QtGui>
-#include <QTranslator>
 #include <xqserviceutil.h>
-#include <hbapplication.h> 
-#include <hbmainwindow.h>  
+#include <hbapplication.h>
+#include <hbmainwindow.h>
+#include <hbtranslator.h>
 #include "calencontroller.h"
 #include "calenserviceprovider.h"
 
@@ -33,26 +33,25 @@
 	HbMainWindow window;
 	
     //For translation, loading and installing translator
-	QTranslator translator;
-    QString lang = QLocale::system().name();
-    QString path = "Z:/resource/qt/translations/";
-    // TODO: Load the appropriate .qm file based on locale
-    bool loaded = translator.load("calendar_en_GB",":/translations");
-    app.installTranslator(&translator);
-
-    //Backup and restore code  need to write here.
+	HbTranslator translator("calendar");
+	translator.loadCommon();
+	
+    // Backup and restore code need to write here.
 	
     CCalenController *controller = new CCalenController();
-    
-    // Create the Calendar service provider
-    CalenServiceProvider service(controller);
+
+	int retValue = 0;
+	if (controller) {
+	    controller->constructController();
+    	// Create the Calendar service provider
+	    CalenServiceProvider service(controller);
     
-    int retValue = app.exec();
+    	retValue = app.exec();
     
-    // delete the controller
-    controller->ReleaseCustomisations();
-    controller->Release();
-    
+	    // delete the controller
+    	controller->ReleaseCustomisations();
+	    controller->Release();
+	}
     return retValue;
     }