--- a/calendarui/application/src/main.cpp Tue Jul 06 14:14:56 2010 +0300
+++ b/calendarui/application/src/main.cpp Wed Aug 18 09:47:38 2010 +0300
@@ -15,45 +15,51 @@
*
*/
-
+// system includes
#include <QtGui>
-#include <xqserviceutil.h>
-#include <hbapplication.h>
#include <hbmainwindow.h>
#include <hbtranslator.h>
-#include "calencontroller.h"
-#include "calenserviceprovider.h"
+// user includes
+#include "calenapplication.h"
+
+/*!
+ The main() function.
- int main(int argc, char *argv[])
- {
- HbApplication app(argc, argv);
-
- // Main window for providing the scene context
+ Responsible for constructing the CalenApplication object and showing the
+ main window.
+ */
+int main(int argc, char *argv[])
+{
+ // Create and initialize an CalenApplication instance
+ QScopedPointer<CalenApplication> application(
+ new CalenApplication(argc, argv));
+ //CalenApplication *application = new CalenApplication(argc, argv);
+
+ // Main window for providing the scene context
HbMainWindow window;
+ // Flags to gain some optimizations from the framework
+ // TODO: Check if orbit itself is setting these flags in mainwindow
+ // If yes, then we need not set here
+ window.setOptimizationFlags(QGraphicsView::DontAdjustForAntialiasing);
+ window.setRenderHint(QPainter::TextAntialiasing, false);
+
- //For translation, loading and installing translator
+ //For translation, loading and installing translator
HbTranslator translator("calendar");
translator.loadCommon();
- // Backup and restore code need to write here.
+ // Backup and restore code need to write here.
- CCalenController *controller = new CCalenController();
+ application->createController();
int retValue = 0;
- if (controller) {
- controller->constructController();
- // Create the Calendar service provider
- CalenServiceProvider service(controller);
-
- retValue = app.exec();
-
- // delete the controller
- controller->ReleaseCustomisations();
- controller->Release();
- }
- return retValue;
- }
+
+ retValue = application->execution();
+ application->releaseController();
+
+ return retValue;
+}
+//End of file
- //End of file