notes/notesui/notesappcontroller/src/notesappcontroller.cpp
changeset 58 ef813d54df51
parent 50 579cc610882e
equal deleted inserted replaced
50:579cc610882e 58:ef813d54df51
    18 // User includes
    18 // User includes
    19 #include "notesappcontroller.h"
    19 #include "notesappcontroller.h"
    20 #include "notesappcontrollerifimpl.h"
    20 #include "notesappcontrollerifimpl.h"
    21 #include "notesviewmanager.h"
    21 #include "notesviewmanager.h"
    22 #include "notesmodelhandler.h"
    22 #include "notesmodelhandler.h"
       
    23 #include "OstTraceDefinitions.h"
       
    24 #ifdef OST_TRACE_COMPILER_IN_USE
       
    25 #include "notesappcontrollerTraces.h"
       
    26 #endif
       
    27 
    23 
    28 
    24 /*!
    29 /*!
    25 	\class NotesAppController
    30 	\class NotesAppController
    26 
    31 
    27 	This is the heart of notes application. It constructs and owns the
    32 	This is the heart of notes application. It constructs and owns the
    35 :QObject(parent),
    40 :QObject(parent),
    36  mViewManager(0),
    41  mViewManager(0),
    37  mNotesModelHandler(0),
    42  mNotesModelHandler(0),
    38  mIfImpl(0)
    43  mIfImpl(0)
    39 {
    44 {
       
    45 	OstTraceFunctionEntry0( NOTESAPPCONTROLLER_NOTESAPPCONTROLLER_ENTRY );
    40 	// Construct the interface implementation.
    46 	// Construct the interface implementation.
    41 	mIfImpl = new NotesAppControllerIfImpl(this);
    47 	mIfImpl = new NotesAppControllerIfImpl(this);
    42 
    48 
    43 	// Construct the model handler.
    49 	// Construct the model handler.
    44 	mNotesModelHandler = new NotesModelHandler(this);
    50 	mNotesModelHandler = new NotesModelHandler(this);
    49 	// Construct the view manager.
    55 	// Construct the view manager.
    50 	mViewManager = new NotesViewManager(*mIfImpl, this);
    56 	mViewManager = new NotesViewManager(*mIfImpl, this);
    51 	Q_ASSERT_X(
    57 	Q_ASSERT_X(
    52 			mViewManager, "notesappcontroller.cpp",
    58 			mViewManager, "notesappcontroller.cpp",
    53 			"NotesViewManager is 0");
    59 			"NotesViewManager is 0");
       
    60 	connect(mViewManager, SIGNAL(appReady()), this, SLOT(handleAppReady()));
       
    61 	OstTraceFunctionExit0( NOTESAPPCONTROLLER_NOTESAPPCONTROLLER_EXIT );
    54 }
    62 }
    55 
    63 
    56 /*!
    64 /*!
    57 	Destructor.
    65 	Destructor.
    58  */
    66  */
    59 NotesAppController::~NotesAppController()
    67 NotesAppController::~NotesAppController()
    60 {
    68 {
       
    69 	OstTraceFunctionEntry0( DUP1_NOTESAPPCONTROLLER_NOTESAPPCONTROLLER_ENTRY );
    61 	if (mViewManager) {
    70 	if (mViewManager) {
    62 		delete mViewManager;
    71 		delete mViewManager;
    63 		mViewManager = 0;
    72 		mViewManager = 0;
    64 	}
    73 	}
    65 	if (mNotesModelHandler) {
    74 	if (mNotesModelHandler) {
    68 	}
    77 	}
    69 	if (mIfImpl) {
    78 	if (mIfImpl) {
    70 		delete mIfImpl;
    79 		delete mIfImpl;
    71 		mIfImpl = 0;
    80 		mIfImpl = 0;
    72 	}
    81 	}
       
    82 	OstTraceFunctionExit0( DUP1_NOTESAPPCONTROLLER_NOTESAPPCONTROLLER_EXIT );
       
    83 }
       
    84 
       
    85 /*!
       
    86 	Emits the appReday signal.
       
    87  */
       
    88 void NotesAppController::handleAppReady()
       
    89 {
       
    90 	OstTraceFunctionEntry0( NOTESAPPCONTROLLER_HANDLEAPPREADY_ENTRY );
       
    91 	emit appReady();
       
    92 	disconnect(mViewManager, SIGNAL(appReady()), this, SLOT(handleAppReady()));
       
    93 	OstTraceFunctionExit0( NOTESAPPCONTROLLER_HANDLEAPPREADY_EXIT );
    73 }
    94 }
    74 
    95 
    75 // End of file	--Don't remove this.
    96 // End of file	--Don't remove this.