--- a/calendarui/controller/src/calencontroller.cpp Tue Jul 06 14:14:56 2010 +0300
+++ b/calendarui/controller/src/calencontroller.cpp Wed Aug 18 09:47:38 2010 +0300
@@ -37,6 +37,11 @@
#include "calenservicesimpl.h" // Calendar service implementation
#include "CalenUid.h"
#include "calencontextimpl.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "calencontrollerTraces.h"
+#endif
+
// Constants
const TInt KCustomCommandRangeStart = ECalenLastCommand;
@@ -50,7 +55,8 @@
//
CCalenController::CCalenController()
{
- TRACE_ENTRY_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_CCALENCONTROLLER_ENTRY );
+
// Check the Application Startup reason, set iIsFromServiceFrmWrk if application
// is started by service framework, false otherwise
/*Hb::ActivationReasonService == qobject_cast<HbApplication*>(qApp)->activateReason() ?
@@ -67,7 +73,7 @@
iRefCount = 0;
mAgendaUtil = 0;
- TRACE_EXIT_POINT;
+ OstTraceFunctionExit0( CCALENCONTROLLER_CCALENCONTROLLER_EXIT );
}
// ----------------------------------------------------------------------------
@@ -78,6 +84,7 @@
//
void CCalenController::constructController()
{
+ OstTraceFunctionEntry0( CCALENCONTROLLER_CONSTRUCTCONTROLLER_ENTRY );
// Store the pointer in tls, also avoid multiple creations
checkMultipleCreation();
@@ -142,10 +149,13 @@
RegisterForNotificationsL( iViewManager, notificationArray );
notificationArray.Reset();
notificationArray.Close();
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_CONSTRUCTCONTROLLER_EXIT );
}
void CCalenController::checkMultipleCreation()
{
+ OstTraceFunctionEntry0( CCALENCONTROLLER_CHECKMULTIPLECREATION_ENTRY );
TAny* tlsPtr = Dll::Tls();
// Check Thread local storage
@@ -164,6 +174,7 @@
// This function should only have been called once, by CCalenAppUi
User::Leave( KErrAlreadyExists );
}
+ OstTraceFunctionExit0( CCALENCONTROLLER_CHECKMULTIPLECREATION_EXIT );
}
// ----------------------------------------------------------------------------
@@ -177,8 +188,8 @@
//
CCalenController* CCalenController::InstanceL()
{
- TRACE_ENTRY_POINT;
-
+ OstTraceFunctionEntry0( CCALENCONTROLLER_INSTANCEL_ENTRY );
+
CCalenController* self = NULL;
TAny* tlsPtr = Dll::Tls();
@@ -197,7 +208,8 @@
++self->iRefCount;
- TRACE_EXIT_POINT;
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_INSTANCEL_EXIT );
return self;
}
@@ -210,12 +222,12 @@
//
void CCalenController::ReleaseCustomisations()
{
- TRACE_ENTRY_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_RELEASECUSTOMISATIONS_ENTRY );
delete iCustomisationManager;
iCustomisationManager = NULL;
- TRACE_EXIT_POINT;
+ OstTraceFunctionExit0( CCALENCONTROLLER_RELEASECUSTOMISATIONS_EXIT );
}
// ----------------------------------------------------------------------------
@@ -228,7 +240,8 @@
//
void CCalenController::Release()
{
- TRACE_ENTRY_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_RELEASE_ENTRY );
+
--iRefCount;
// The controller owns its own instance of the services, therefore the
@@ -237,7 +250,8 @@
{
delete this;
}
- TRACE_EXIT_POINT;
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_RELEASE_EXIT );
}
// ----------------------------------------------------------------------------
@@ -249,7 +263,7 @@
//
CCalenController::~CCalenController()
{
- TRACE_ENTRY_POINT;
+ OstTraceFunctionEntry0( DUP1_CCALENCONTROLLER_CCALENCONTROLLER_ENTRY );
if(iStateMachine) {
delete iStateMachine;
@@ -299,7 +313,7 @@
Dll::SetTls( NULL );
- TRACE_EXIT_POINT;
+ OstTraceFunctionExit0( DUP1_CCALENCONTROLLER_CCALENCONTROLLER_EXIT );
}
@@ -313,12 +327,14 @@
//
TBool CCalenController::IssueCommandL( TInt aCommand )
{
- TRACE_ENTRY_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_ISSUECOMMANDL_ENTRY );
+
TCalenCommand cmd;
cmd.SetCommandAndContextL( aCommand ,context());
TBool ret = iStateMachine->HandleCommandL( cmd );
- TRACE_EXIT_POINT;
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_ISSUECOMMANDL_EXIT );
return ret;
}
@@ -330,8 +346,9 @@
//
MCalenServices& CCalenController::Services()
{
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_SERVICES_ENTRY );
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_SERVICES_EXIT );
return *iServices;
}
@@ -342,8 +359,9 @@
// ----------------------------------------------------------------------------
CalenViewManager& CCalenController::ViewManager()
{
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_VIEWMANAGER_ENTRY );
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_VIEWMANAGER_EXIT );
return *iViewManager;
}
@@ -354,11 +372,14 @@
// ----------------------------------------------------------------------------
HbMainWindow& CCalenController::MainWindow()
{
- TRACE_ENTRY_POINT;
+
+ OstTraceFunctionEntry0( DUP1_CCALENCONTROLLER_MAINWINDOW_ENTRY );
+
+ OstTraceFunctionExit0( DUP1_CCALENCONTROLLER_MAINWINDOW_EXIT );
return *(hbInstance->allMainWindows().first());
- TRACE_EXIT_POINT;
+
}
// ----------------------------------------------------------------------------
@@ -370,11 +391,11 @@
//
void CCalenController::BroadcastNotification( TCalenNotification aNotification )
{
- TRACE_ENTRY_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_BROADCASTNOTIFICATION_ENTRY );
iNotifier->BroadcastNotification( aNotification );
- TRACE_EXIT_POINT;
+ OstTraceFunctionExit0( CCALENCONTROLLER_BROADCASTNOTIFICATION_EXIT );
}
// ----------------------------------------------------------------------------
@@ -386,11 +407,11 @@
void CCalenController::RegisterForNotificationsL( MCalenNotificationHandler* aHandler,
TCalenNotification aNotification )
{
- TRACE_ENTRY_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_REGISTERFORNOTIFICATIONSL_ENTRY );
iNotifier->RegisterForNotificationsL( aHandler, aNotification );
- TRACE_EXIT_POINT;
+ OstTraceFunctionExit0( CCALENCONTROLLER_REGISTERFORNOTIFICATIONSL_EXIT );
}
// ----------------------------------------------------------------------------
@@ -402,11 +423,11 @@
void CCalenController::RegisterForNotificationsL( MCalenNotificationHandler* aHandler,
RArray<TCalenNotification>& aNotifications )
{
- TRACE_ENTRY_POINT;
+ OstTraceFunctionEntry0( DUP1_CCALENCONTROLLER_REGISTERFORNOTIFICATIONSL_ENTRY );
iNotifier->RegisterForNotificationsL( aHandler, aNotifications );
-
- TRACE_EXIT_POINT;
+
+ OstTraceFunctionExit0( DUP1_CCALENCONTROLLER_REGISTERFORNOTIFICATIONSL_EXIT );
}
// ----------------------------------------------------------------------------
@@ -417,11 +438,11 @@
//
void CCalenController::CancelNotifications( MCalenNotificationHandler* aHandler )
{
- TRACE_ENTRY_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_CANCELNOTIFICATIONS_ENTRY );
iNotifier->CancelNotifications( aHandler );
-
- TRACE_EXIT_POINT;
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_CANCELNOTIFICATIONS_EXIT );
}
// ----------------------------------------------------------------------------
@@ -432,7 +453,7 @@
// ----------------------------------------------------------------------------
MCalenCommandHandler* CCalenController::GetCommandHandlerL( TInt aCommand )
{
- TRACE_ENTRY_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_GETCOMMANDHANDLERL_ENTRY );
MCalenCommandHandler* handler( NULL );
@@ -465,8 +486,9 @@
// No command handler is an error
+ OstTraceFunctionExit0( CCALENCONTROLLER_GETCOMMANDHANDLERL_EXIT );
+
// return the handler
- TRACE_EXIT_POINT;
return handler;
}
@@ -478,14 +500,15 @@
//
MCalenServices* CCalenController::NewServicesL()
{
- TRACE_ENTRY_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_NEWSERVICESL_ENTRY );
TInt commandRangeStart = iNextServicesCommandBase;
TInt commandRangeEnd = commandRangeStart + KNumberOfCommandsPerServices;
iNextServicesCommandBase = commandRangeEnd + 1;
CalenServicesImpl* svc = CalenServicesImpl::NewL( commandRangeStart,commandRangeEnd );
- TRACE_EXIT_POINT;
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_NEWSERVICESL_EXIT );
return svc;
}
@@ -497,8 +520,9 @@
//
CalenNotifier& CCalenController::Notifier()
{
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_NOTIFIER_ENTRY );
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_NOTIFIER_EXIT );
return *iNotifier;
}
@@ -511,8 +535,9 @@
//
HbWidget* CCalenController::Infobar()
{
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
+ OstTraceFunctionEntry0( DUP1_CCALENCONTROLLER_INFOBAR_ENTRY );
+
+ OstTraceFunctionExit0( DUP1_CCALENCONTROLLER_INFOBAR_EXIT );
return iCustomisationManager->Infobar();
}
// ----------------------------------------------------------------------------
@@ -523,8 +548,9 @@
//
QString* CCalenController::InfobarTextL()
{
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_INFOBARTEXTL_ENTRY );
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_INFOBARTEXTL_EXIT );
return iCustomisationManager->InfobarTextL();
}
// ----------------------------------------------------------------------------
@@ -535,8 +561,9 @@
//
CCalenCustomisationManager& CCalenController::CustomisationManager()
{
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_CUSTOMISATIONMANAGER_ENTRY );
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_CUSTOMISATIONMANAGER_EXIT );
return *iCustomisationManager;
}
@@ -548,10 +575,12 @@
//
void CCalenController::SetDefaultContext()
{
- TRACE_ENTRY_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_SETDEFAULTCONTEXT_ENTRY );
+
QDateTime focusTime = mContext->defaultCalTimeForViewsL();
mContext->setFocusDateAndTime(focusTime);
- TRACE_EXIT_POINT;
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_SETDEFAULTCONTEXT_EXIT );
}
// ----------------------------------------------------------------------------
@@ -563,9 +592,11 @@
void CCalenController::OfferMenu(HbMenu* aHbMenu)
{
- TRACE_ENTRY_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_OFFERMENU_ENTRY );
+
iCustomisationManager->OfferMenu(aHbMenu);
- TRACE_EXIT_POINT;
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_OFFERMENU_EXIT );
}
// ----------------------------------------------------------------------------
@@ -576,8 +607,10 @@
//
AgendaUtil* CCalenController::agendaInterface()
{
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_AGENDAINTERFACE_ENTRY );
+
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_AGENDAINTERFACE_EXIT );
return mAgendaUtil;
}
@@ -589,8 +622,9 @@
//
MCalenContext& CCalenController::context()
{
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_CONTEXT_ENTRY );
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_CONTEXT_EXIT );
return *mContext;
}
@@ -602,6 +636,7 @@
//
void CCalenController::handleServiceManagerSlot(int view, const QDateTime& dateTime)
{
+ OstTraceFunctionEntry0( CCALENCONTROLLER_HANDLESERVICEMANAGERSLOT_ENTRY );
if (iIsFromServiceFrmWrk) {
// Set the context properly
@@ -614,19 +649,32 @@
// or deleting state or sending state, then dont do anything as
// user might loose the data
CCalenStateMachine::TCalenStateIndex currentState = iStateMachine->CurrentState();
- if ((currentState == CCalenStateMachine::ECalenEditingState) ||
- (currentState == CCalenStateMachine::ECalenDeletingState) ||
+ if ((currentState == CCalenStateMachine::ECalenDeletingState) ||
(currentState == CCalenStateMachine::ECalenPrintingState) ||
(currentState == CCalenStateMachine::ECalenSendingState)) {
// simply return - we dont have anything to do
- } else {
- // Set the context properly
- mContext->setFocusDateAndTime(dateTime);
- IssueCommandL(view);
- }
+ }
+ else if (currentState == CCalenStateMachine::ECalenEditingState) {
+ // close the editor and save the entry
+ //and launch the desired view
+ iActionUi->saveAndCloseEditor();
+ }
+ // Set the context properly
+ mContext->setFocusDateAndTime(dateTime);
+ IssueCommandL(view);
+
+ // connect to raise the window to foreground once the view is ready
+ connect(&MainWindow(), SIGNAL(viewReady()),
+ this, SLOT(raiseWindow()));
}
+
}
-
+void CCalenController::raiseWindow()
+ {
+ MainWindow().raise();
+ disconnect(&MainWindow(), SIGNAL(viewReady()),
+ this, SLOT(raiseWindow()));
+ }
// ----------------------------------------------------------------------------
// CCalenController::getFirstView
// returns the first view with which calendar has been launched
@@ -635,8 +683,9 @@
//
int CCalenController::getFirstView()
{
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
+ OstTraceFunctionEntry0( CCALENCONTROLLER_GETFIRSTVIEW_ENTRY );
+
+ OstTraceFunctionExit0( CCALENCONTROLLER_GETFIRSTVIEW_EXIT );
return iViewManager->getFirstView();
@@ -650,6 +699,8 @@
//
bool CCalenController::eventFilter(QObject *object, QEvent *event)
{
+ OstTraceFunctionEntry0( CCALENCONTROLLER_EVENTFILTER_ENTRY );
+
switch (event->type())
{
case QEvent::LanguageChange:
@@ -662,6 +713,17 @@
default:
break;
}
+ OstTraceFunctionExit0( CCALENCONTROLLER_EVENTFILTER_EXIT );
+
return QObject::eventFilter(object, event);
}
-// End of file
+
+/*
+ * Emits the appReady signal.
+ */
+void CCalenController::emitAppReady()
+{
+ emit appReady();
+}
+
+// End of file --Don't remove this.