diff -r 579cc610882e -r ef813d54df51 calendarui/views/src/calennativeview.cpp --- a/calendarui/views/src/calennativeview.cpp Tue Jul 06 14:14:56 2010 +0300 +++ b/calendarui/views/src/calennativeview.cpp Wed Aug 18 09:47:38 2010 +0300 @@ -35,6 +35,11 @@ #include "calensettingsview.h" #include "calendateutils.h" #include "calenconstants.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "calennativeviewTraces.h" +#endif + /*! \class CalenNativeView @@ -45,8 +50,12 @@ Default constructor. */ CalenNativeView::CalenNativeView(MCalenServices &services) : - mServices(services), mIsCapturedScreenShotValid(false) + mServices(services), + mEntriesInDataBase(false), + mIsCapturedScreenShotValid(false) { + OstTraceFunctionEntry0( CALENNATIVEVIEW_CALENNATIVEVIEW_ENTRY ); + setTitle(hbTrId("txt_calendar_title_calendar")); // Create services API and register for notifications @@ -60,6 +69,8 @@ mServices.RegisterForNotificationsL(this, notificationArray); CleanupStack::PopAndDestroy(¬ificationArray); + + OstTraceFunctionExit0( CALENNATIVEVIEW_CALENNATIVEVIEW_EXIT ); } /*! @@ -67,6 +78,9 @@ */ CalenNativeView::~CalenNativeView() { + OstTraceFunctionEntry0( DUP1_CALENNATIVEVIEW_CALENNATIVEVIEW_ENTRY ); + + OstTraceFunctionExit0( DUP1_CALENNATIVEVIEW_CALENNATIVEVIEW_EXIT ); } /*! @@ -74,8 +88,12 @@ */ void CalenNativeView::populationComplete() { + OstTraceFunctionEntry0( CALENNATIVEVIEW_POPULATIONCOMPLETE_ENTRY ); + // Population is complete, issue the notification mServices.IssueNotificationL(ECalenNotifyViewPopulationComplete); + + OstTraceFunctionExit0( CALENNATIVEVIEW_POPULATIONCOMPLETE_EXIT ); } /*! @@ -83,7 +101,11 @@ */ void CalenNativeView::deleteBeforeDate() { + OstTraceFunctionEntry0( CALENNATIVEVIEW_DELETEBEFOREDATE_ENTRY ); + mServices.IssueCommandL(ECalenDeleteEntriesBeforeDate); + + OstTraceFunctionExit0( CALENNATIVEVIEW_DELETEBEFOREDATE_EXIT ); } /*! @@ -91,7 +113,12 @@ */ void CalenNativeView::deleteAllEntries() { + OstTraceFunctionEntry0( CALENNATIVEVIEW_DELETEALLENTRIES_ENTRY ); + mServices.IssueCommandL(ECalenDeleteAllEntries); + mEntriesInDataBase = false; + + OstTraceFunctionExit0( CALENNATIVEVIEW_DELETEALLENTRIES_EXIT ); } /*! @@ -99,6 +126,8 @@ */ void CalenNativeView::goToDate() { + OstTraceFunctionEntry0( CALENNATIVEVIEW_GOTODATE_ENTRY ); + // Create a popup with datepicker for the user to select date. HbDialog *popUp = new HbDialog(); popUp->setDismissPolicy(HbDialog::NoDismiss); @@ -121,6 +150,8 @@ connect(okAction, SIGNAL(triggered()), this, SLOT(goToSelectedDate())); popUp->addAction(new HbAction(hbTrId("txt_common_button_cancel"), popUp)); popUp->open(); + + OstTraceFunctionExit0( CALENNATIVEVIEW_GOTODATE_EXIT ); } /* @@ -128,6 +159,8 @@ */ void CalenNativeView::goToSelectedDate() { + OstTraceFunctionEntry0( CALENNATIVEVIEW_GOTOSELECTEDDATE_ENTRY ); + QDate selectedDate = mDatePicker->date(); // Check if the selected date is within the range. @@ -142,6 +175,8 @@ context.setFocusDateAndTime(contextDate); } refreshViewOnGoToDate(); + + OstTraceFunctionExit0( CALENNATIVEVIEW_GOTOSELECTEDDATE_EXIT ); } /*! @@ -150,7 +185,11 @@ */ void CalenNativeView::refreshViewOnGoToDate() { + OstTraceFunctionEntry0( CALENNATIVEVIEW_REFRESHVIEWONGOTODATE_ENTRY ); + mServices.IssueCommandL(ECalenStartActiveStep); + + OstTraceFunctionExit0( CALENNATIVEVIEW_REFRESHVIEWONGOTODATE_EXIT ); } /*! @@ -158,7 +197,11 @@ */ void CalenNativeView::launchSettingsView() { + OstTraceFunctionEntry0( CALENNATIVEVIEW_LAUNCHSETTINGSVIEW_ENTRY ); + mServices.IssueCommandL(ECalenShowSettings); + + OstTraceFunctionExit0( CALENNATIVEVIEW_LAUNCHSETTINGSVIEW_EXIT ); } /*! @@ -166,8 +209,11 @@ */ void CalenNativeView::changeOrientation(Qt::Orientation orientation) { + OstTraceFunctionEntry0( CALENNATIVEVIEW_CHANGEORIENTATION_ENTRY ); + Q_UNUSED(orientation); // Nothing, derived classes will implement it + OstTraceFunctionExit0( CALENNATIVEVIEW_CHANGEORIENTATION_EXIT ); } /*! @@ -175,11 +221,17 @@ */ void CalenNativeView::HandleNotification(const TCalenNotification notification) { + OstTraceFunctionEntry0( CALENNATIVEVIEW_HANDLENOTIFICATION_ENTRY ); + switch (notification) { case ECalenNotifySystemLocaleChanged: { onLocaleChanged(EChangesLocale); } - break; + break; + case ECalenNotifySystemTimeChanged: { + onLocaleChanged(EChangesSystemTime); + } + break; case ECalenNotifyContextChanged: { onContextChanged(); } @@ -187,6 +239,8 @@ default: break; } + + OstTraceFunctionExit0( CALENNATIVEVIEW_HANDLENOTIFICATION_EXIT ); } /*! @@ -194,17 +248,25 @@ */ TBool CalenNativeView::pluginEnabled() { + OstTraceFunctionEntry0( CALENNATIVEVIEW_PLUGINENABLED_ENTRY ); + QString *pluginInfo = mServices.InfobarTextL(); if (!pluginInfo) { + OstTraceFunctionExit0( CALENNATIVEVIEW_PLUGINENABLED_EXIT ); return false; } else { + OstTraceFunctionExit0( DUP1_CALENNATIVEVIEW_PLUGINENABLED_EXIT ); return true; } } QString *CalenNativeView::pluginText() { + OstTraceFunctionEntry0( CALENNATIVEVIEW_PLUGINTEXT_ENTRY ); + + OstTraceFunctionExit0( CALENNATIVEVIEW_PLUGINTEXT_EXIT ); return mServices.InfobarTextL(); + } // ---------------------------------------------------------------------------- @@ -214,6 +276,8 @@ // void CalenNativeView::captureScreenshot(bool captureScreenShot) { + OstTraceFunctionEntry0( CALENNATIVEVIEW_CAPTURESCREENSHOT_ENTRY ); + // get a screenshot for saving to the activity manager. It's done for once // to optimize the performance if (captureScreenShot) { @@ -221,6 +285,8 @@ mScreenShotMetadata.insert("screenshot", QPixmap::grabWidget(mainWindow(), mainWindow()->rect())); } mIsCapturedScreenShotValid = captureScreenShot; // set the validity of the screenshot captured + + OstTraceFunctionExit0( CALENNATIVEVIEW_CAPTURESCREENSHOT_EXIT ); } // ---------------------------------------------------------------------------- @@ -229,6 +295,8 @@ // void CalenNativeView::saveActivity() { + OstTraceFunctionEntry0( CALENNATIVEVIEW_SAVEACTIVITY_ENTRY ); + // Get a pointer to activity manager HbActivityManager* activityManager = qobject_cast(qApp)->activityManager(); @@ -251,5 +319,6 @@ if ( !ok ) { qFatal("Add failed" ); // Panic is activity is not saved successfully } + OstTraceFunctionExit0( CALENNATIVEVIEW_SAVEACTIVITY_EXIT ); } //End Of File