notes/notesui/notesapplication/src/main.cpp
changeset 55 2c54b51f39c4
parent 45 b6db4fd4947b
equal deleted inserted replaced
51:0b38fc5b94c6 55:2c54b51f39c4
    14 * Description: Contains main, the entry point for notes application.
    14 * Description: Contains main, the entry point for notes application.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // System includes
    18 // System includes
    19 #include <QScopedPointer>
       
    20 #include <hbapplication.h>
       
    21 #include <hbmainwindow.h>
    19 #include <hbmainwindow.h>
    22 #include <hbtranslator.h>
    20 #include <hbtranslator.h>
       
    21 
    23 // User includes
    22 // User includes
    24 #include "notesappcontroller.h"
    23 #include "notesapplication.h"
       
    24 #include "OstTraceDefinitions.h"
       
    25 #ifdef OST_TRACE_COMPILER_IN_USE
       
    26 #include "mainTraces.h"
       
    27 #endif
       
    28 
    25 
    29 
    26 /*!
    30 /*!
    27 	The main() function.
    31 	The main() function.
    28 
    32 
    29 	Responsible for constructing the NotesAppController object and showing the
    33 	Responsible for constructing the NotesApplication object and showing the
    30 	main window.
    34 	main window.
    31  */
    35  */
    32 int main(int argc, char *argv[])
    36 int main(int argc, char *argv[])
    33 {
    37 {
    34 	// Create and initialize an HbApplication instance
    38 	OstTraceFunctionEntry0( _MAIN_ENTRY );
    35 	HbApplication app(argc, argv);
    39 	// Create and initialize an NotesApplication instance
       
    40 	QScopedPointer<NotesApplication> application(
       
    41 			new NotesApplication(argc, argv));
       
    42 	//NotesApplication *application = new NotesApplication(argc, argv);
    36 
    43 
    37 	// Main window for providing the scene context
    44 	// Main window for providing the scene context
    38 	HbMainWindow window;
    45 	HbMainWindow window;
    39 	window.setRenderHints(
    46 	window.setRenderHints(
    40 			QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
    47 			QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
    43 	// Load the translation file.
    50 	// Load the translation file.
    44 	HbTranslator notesViewsTranslator("notes");
    51 	HbTranslator notesViewsTranslator("notes");
    45 	notesViewsTranslator.loadCommon();
    52 	notesViewsTranslator.loadCommon();
    46 
    53 
    47 	// Construct the application controller.
    54 	// Construct the application controller.
    48 	QScopedPointer<NotesAppController> controller(new NotesAppController);
    55 	application->createController();
    49 	Q_UNUSED(controller)
    56 	
    50 
       
    51 	// Show the main window.
    57 	// Show the main window.
    52 	window.show();
    58 	window.show();
       
    59 	
    53 	// Start the event loop for the application
    60 	// Start the event loop for the application
    54 	return app.exec();
    61 	return application->execution();
    55 }
    62 }
    56 
    63 
    57 // End of file	--Don't remove this.
    64 // End of file	--Don't remove this.