calendarui/application/src/main.cpp
changeset 45 b6db4fd4947b
parent 23 fd30d51f876b
child 55 2c54b51f39c4
--- a/calendarui/application/src/main.cpp	Mon May 03 12:30:32 2010 +0300
+++ b/calendarui/application/src/main.cpp	Mon Jun 28 15:22:02 2010 +0530
@@ -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"
 
@@ -31,33 +31,27 @@
     
     // Main window for providing the scene context
 	HbMainWindow window;
-	window.setRenderHints(
-			QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
-	window.setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);
 	
     //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_" + lang, path);
-    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.
 	
-    // Check if calendar is launched thru XQService framework
-    bool isFromServiceFrmwrk = XQServiceUtil::isService();
-    CCalenController *controller = new CCalenController(isFromServiceFrmwrk);
+    CCalenController *controller = new CCalenController();
+
+	int retValue = 0;
+	if (controller) {
+	    controller->constructController();
+    	// Create the Calendar service provider
+	    CalenServiceProvider service(controller);
     
-    // Create the Calendar service provider
-    CalenServiceProvider service(controller);
+    	retValue = app.exec();
     
-    int retValue = app.exec();
-    
-    // delete the controller
-    controller->Release();
-    
+	    // delete the controller
+    	controller->ReleaseCustomisations();
+	    controller->Release();
+	}
     return retValue;
     }