clock/clockui/clockappcontroller/src/clockappcontroller.cpp
changeset 58 ef813d54df51
parent 26 a949c2543c15
equal deleted inserted replaced
50:579cc610882e 58:ef813d54df51
    17 
    17 
    18 // User includes
    18 // User includes
    19 #include "clockappcontroller.h"
    19 #include "clockappcontroller.h"
    20 #include "clockappcontrollerifimpl.h"
    20 #include "clockappcontrollerifimpl.h"
    21 #include "clockviewmanager.h"
    21 #include "clockviewmanager.h"
       
    22 #include "OstTraceDefinitions.h"
       
    23 #ifdef OST_TRACE_COMPILER_IN_USE
       
    24 #include "clockappcontrollerTraces.h"
       
    25 #endif
       
    26 
    22 
    27 
    23 /*!
    28 /*!
    24 	\class ClockAppController
    29 	\class ClockAppController
    25 
    30 
    26 	This is the heart of clock application. It constructs and owns the
    31 	This is the heart of clock application. It constructs and owns the
    33 ClockAppController::ClockAppController(QObject *parent)
    38 ClockAppController::ClockAppController(QObject *parent)
    34 :QObject(parent),
    39 :QObject(parent),
    35  mViewManager(0),
    40  mViewManager(0),
    36  mIfImpl(0)
    41  mIfImpl(0)
    37 {
    42 {
       
    43 	OstTraceFunctionEntry0( CLOCKAPPCONTROLLER_CLOCKAPPCONTROLLER_ENTRY );
    38 	// Construct the interface implementation.
    44 	// Construct the interface implementation.
    39 	mIfImpl = new ClockAppControllerIfImpl(this, this);
    45 	mIfImpl = new ClockAppControllerIfImpl(this, this);
    40 
    46 
    41 	// Construct the view manager.
    47 	// Construct the view manager.
    42 	mViewManager = new ClockViewManager(*mIfImpl, this);
    48 	mViewManager = new ClockViewManager(*mIfImpl, this);
    43 	Q_ASSERT_X(
    49 	Q_ASSERT_X(
    44 			mViewManager, "clockappcontroller.cpp",
    50 			mViewManager, "clockappcontroller.cpp",
    45 			"ClockViewManager is 0");
    51 			"ClockViewManager is 0");
       
    52 	connect(mViewManager, SIGNAL(appReady()), this, SLOT(handleAppReady()));
       
    53 	OstTraceFunctionExit0( CLOCKAPPCONTROLLER_CLOCKAPPCONTROLLER_EXIT );
    46 }
    54 }
    47 
    55 
    48 /*!
    56 /*!
    49 	Destructor.
    57 	Destructor.
    50  */
    58  */
    51 ClockAppController::~ClockAppController()
    59 ClockAppController::~ClockAppController()
    52 {
    60 {
       
    61 	OstTraceFunctionEntry0( DUP1_CLOCKAPPCONTROLLER_CLOCKAPPCONTROLLER_ENTRY );
    53 	if (mViewManager) {
    62 	if (mViewManager) {
    54 		delete mViewManager;
    63 		delete mViewManager;
    55 		mViewManager = 0;
    64 		mViewManager = 0;
    56 	}
    65 	}
    57 	if (mIfImpl) {
    66 	if (mIfImpl) {
    58 		delete mIfImpl;
    67 		delete mIfImpl;
    59 		mIfImpl = 0;
    68 		mIfImpl = 0;
    60 	}
    69 	}
       
    70 	OstTraceFunctionExit0( DUP1_CLOCKAPPCONTROLLER_CLOCKAPPCONTROLLER_EXIT );
       
    71 }
       
    72 
       
    73 /*!
       
    74 	Emits the appReday signal.
       
    75  */
       
    76 void ClockAppController::handleAppReady()
       
    77 {
       
    78 	OstTraceFunctionEntry0( CLOCKAPPCONTROLLER_HANDLEAPPREADY_ENTRY );
       
    79 	emit appReady();
       
    80 	disconnect(mViewManager, SIGNAL(appReady()), this, SLOT(handleAppReady()));
       
    81 	OstTraceFunctionExit0( CLOCKAPPCONTROLLER_HANDLEAPPREADY_EXIT );
    61 }
    82 }
    62 
    83 
    63 // End of file	--Don't remove this.
    84 // End of file	--Don't remove this.