calendarui/caleneditor/src/caleneditorrepeatfield.cpp
changeset 51 0b38fc5b94c6
parent 45 b6db4fd4947b
child 55 2c54b51f39c4
--- a/calendarui/caleneditor/src/caleneditorrepeatfield.cpp	Fri Jul 02 19:56:46 2010 +0530
+++ b/calendarui/caleneditor/src/caleneditorrepeatfield.cpp	Mon Jul 12 02:32:28 2010 +0530
@@ -32,6 +32,11 @@
 // User Included
 #include "caleneditorrepeatfield.h"
 #include "caleneditorcustomitem.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "caleneditorrepeatfieldTraces.h"
+#endif
+
 
 // Constants
 const int userRole = Qt::UserRole + 100;
@@ -60,29 +65,32 @@
 	mIsWorkdays(false),
 	mRepeatUntilItemAdded(false)
 {
+	OstTraceFunctionEntry0( CALENEDITORREPEATFIELD_CALENEDITORREPEATFIELD_ENTRY );
 	if (!mCalenEditor->editedEntry()->repeatRule().isNull()) {
 		mRepeatRuleType = mCalenEditor->editedEntry()->repeatRule().type();
 		mRepeatUntilDate = mCalenEditor->editedEntry()->repeatRule().until().date();
-		}
-		
-		mRepeatItem = new HbDataFormModelItem();
-		mRepeatItem->setType(HbDataFormModelItem::ComboBoxItem);
-		mRepeatItem->setData(HbDataFormModelItem::LabelRole,
-		                     hbTrId("txt_calendar_setlabel_repeat"));
+	}
+
+	mRepeatItem = new HbDataFormModelItem();
+	mRepeatItem->setType(HbDataFormModelItem::ComboBoxItem);
+	mRepeatItem->setData(HbDataFormModelItem::LabelRole,
+	                     hbTrId("txt_calendar_setlabel_repeat"));
 
-		// Create the repeat choices
-		QStringList repeatChoices;
-		repeatChoices << hbTrId("txt_calendar_setlabel_repeat_val_only_once")
-		        << hbTrId("txt_calendar_setlabel_repeat_val_daily")
-		        << hbTrId("txt_calendar_setlabel_repeat_val_workdays")
-		        << hbTrId("txt_calendar_setlabel_repeat_val_weekly")
-		        << hbTrId("txt_calendar_setlabel_repeat_val_fortnightly")
-		        << hbTrId("txt_calendar_setlabel_repeat_val_monthly")
-		        << hbTrId("txt_calendar_setlabel_repeat_val_yearly");
+	// Create the repeat choices
+	QStringList repeatChoices;
+	repeatChoices << hbTrId("txt_calendar_setlabel_repeat_val_only_once")
+					<< hbTrId("txt_calendar_setlabel_repeat_val_daily")
+					<< hbTrId("txt_calendar_setlabel_repeat_val_workdays")
+					<< hbTrId("txt_calendar_setlabel_repeat_val_weekly")
+					<< hbTrId("txt_calendar_setlabel_repeat_val_fortnightly")
+					<< hbTrId("txt_calendar_setlabel_repeat_val_monthly")
+					<< hbTrId("txt_calendar_setlabel_repeat_val_yearly");
 
-		mRepeatItem->setContentWidgetData(QString("items"), repeatChoices);
+		mRepeatItem->setContentWidgetData("items", repeatChoices);
+		mRepeatItem->setContentWidgetData("objectName", "repeatItem");
 		mCalenEditorModel->appendDataFormItem( mRepeatItem,
 									mCalenEditorModel->invisibleRootItem());
+	OstTraceFunctionExit0( CALENEDITORREPEATFIELD_CALENEDITORREPEATFIELD_EXIT );
 }
 
 /*!
@@ -90,7 +98,9 @@
  */
 CalenEditorRepeatField::~CalenEditorRepeatField()
 {
+	OstTraceFunctionEntry0( DUP1_CALENEDITORREPEATFIELD_CALENEDITORREPEATFIELD_ENTRY );
 	// Nothing Yet
+	OstTraceFunctionExit0( DUP1_CALENEDITORREPEATFIELD_CALENEDITORREPEATFIELD_EXIT );
 }
 
 /*!
@@ -98,9 +108,11 @@
  */
 void CalenEditorRepeatField::addItemToModel()
 {	
+	OstTraceFunctionEntry0( CALENEDITORREPEATFIELD_ADDITEMTOMODEL_ENTRY );
 	// Add reminder to the model
 	mCalenEditorModel->appendDataFormItem( mRepeatItem,
 				   mCalenEditorModel->invisibleRootItem());
+	OstTraceFunctionExit0( CALENEDITORREPEATFIELD_ADDITEMTOMODEL_EXIT );
 }
 
 /*!
@@ -108,7 +120,9 @@
  */
 void CalenEditorRepeatField::removeItemFromModel()
 {
+	OstTraceFunctionEntry0( CALENEDITORREPEATFIELD_REMOVEITEMFROMMODEL_ENTRY );
 	mCalenEditorModel->removeItem(modelIndex());
+	OstTraceFunctionExit0( CALENEDITORREPEATFIELD_REMOVEITEMFROMMODEL_EXIT );
 }
 
 /*!
@@ -117,6 +131,7 @@
  */
 void CalenEditorRepeatField::populateRepeatItem(int index)
 {
+	OstTraceFunctionEntry0( CALENEDITORREPEATFIELD_POPULATEREPEATITEM_ENTRY );
 	HbDataFormViewItem
 			*item =
 					qobject_cast<HbDataFormViewItem *> (
@@ -186,6 +201,7 @@
 	updateRepeatChoices();
 	connect(mRepeatComboBox, SIGNAL(currentIndexChanged(int)), this,
 				SLOT(handleRepeatIndexChanged(int)));
+	OstTraceFunctionExit0( CALENEDITORREPEATFIELD_POPULATEREPEATITEM_EXIT );
 }
 
 /*!
@@ -195,6 +211,7 @@
  */
 void CalenEditorRepeatField::handleRepeatIndexChanged(int index)
 {
+	OstTraceFunctionEntry0( CALENEDITORREPEATFIELD_HANDLEREPEATINDEXCHANGED_ENTRY );
 	mIsBiWeekly = false;
 	mIsWorkdays = false;
 
@@ -302,6 +319,7 @@
 		mCalenEditor->addDiscardAction();
 	}
 	mCalenEditor->updateReminderChoices();
+	OstTraceFunctionExit0( CALENEDITORREPEATFIELD_HANDLEREPEATINDEXCHANGED_EXIT );
 }
 
 /*!
@@ -310,6 +328,7 @@
  */
 QModelIndex CalenEditorRepeatField::modelIndex()
 {
+	OstTraceFunctionEntry0( CALENEDITORREPEATFIELD_MODELINDEX_ENTRY );
 	return mCalenEditorModel->indexFromItem(mRepeatItem);
 }
 
@@ -318,6 +337,7 @@
  */
 void CalenEditorRepeatField::insertRepeatUntilItem()
 {
+	OstTraceFunctionEntry0( CALENEDITORREPEATFIELD_INSERTREPEATUNTILITEM_ENTRY );
 	HbDataFormModelItem::DataItemType itemType =
 	        static_cast<HbDataFormModelItem::DataItemType> (RepeatUntilOffset);
 	
@@ -344,6 +364,7 @@
 		mCustomRepeatUntilItem->setContentWidgetData("text", dateString);
 	}
 	//TODO: Scroll to functionality has to be implemented	
+	OstTraceFunctionExit0( CALENEDITORREPEATFIELD_INSERTREPEATUNTILITEM_EXIT );
 }
 
 /*!
@@ -352,6 +373,8 @@
  */
 bool CalenEditorRepeatField::isRepeatUntilItemAdded()
 {
+	OstTraceFunctionEntry0( CALENEDITORREPEATFIELD_ISREPEATUNTILITEMADDED_ENTRY );
+	OstTraceFunctionExit0( CALENEDITORREPEATFIELD_ISREPEATUNTILITEMADDED_EXIT );
 	return mRepeatUntilItemAdded;
 }
 
@@ -360,6 +383,7 @@
  */
 void CalenEditorRepeatField::launchRepeatUntilDatePicker()
 {
+	OstTraceFunctionEntry0( CALENEDITORREPEATFIELD_LAUNCHREPEATUNTILDATEPICKER_ENTRY );
 	HbDialog *popUp = new HbDialog();
 	popUp->setDismissPolicy(HbDialog::NoDismiss);
 	popUp->setTimeout(HbDialog::NoTimeout);
@@ -407,6 +431,7 @@
 	connect(okAction, SIGNAL(triggered()), this, SLOT(setRepeatUntilDate()));
 	popUp->addAction(new HbAction(hbTrId("txt_common_button_cancel"), popUp));
 	popUp->open();
+	OstTraceFunctionExit0( CALENEDITORREPEATFIELD_LAUNCHREPEATUNTILDATEPICKER_EXIT );
 }
 
 /*!
@@ -414,6 +439,7 @@
  */
 void CalenEditorRepeatField::setRepeatUntilDate()
 {
+	OstTraceFunctionEntry0( CALENEDITORREPEATFIELD_SETREPEATUNTILDATE_ENTRY );
 	mRepeatUntilDate = mDatePicker->date();
 	if (mRepeatUntilDate.isValid()) {
 		HbExtendedLocale locale = HbExtendedLocale::system();
@@ -422,6 +448,7 @@
 		mCustomRepeatUntilItem->setContentWidgetData("text", dateString);
 	}
 	mCalenEditor->updateReminderChoices();
+	OstTraceFunctionExit0( CALENEDITORREPEATFIELD_SETREPEATUNTILDATE_EXIT );
 }
 
 /*!
@@ -429,6 +456,8 @@
  */
 QDate CalenEditorRepeatField::repeatUntilDate()
 {
+	OstTraceFunctionEntry0( CALENEDITORREPEATFIELD_REPEATUNTILDATE_ENTRY );
+	OstTraceFunctionExit0( CALENEDITORREPEATFIELD_REPEATUNTILDATE_EXIT );
 	return mRepeatUntilDate;
 }
 
@@ -437,7 +466,9 @@
 */
 void CalenEditorRepeatField::updateRepeatChoices()
 {
+    OstTraceFunctionEntry0( CALENEDITORREPEATFIELD_UPDATEREPEATCHOICES_ENTRY );
     if (!mRepeatComboBox) {
+        OstTraceFunctionExit0( CALENEDITORREPEATFIELD_UPDATEREPEATCHOICES_EXIT );
         return;
     }
 	// Clear all the choices and add it again. If we dont do it 
@@ -547,6 +578,7 @@
 	}
 	// Set the previous user's choice
 	mRepeatComboBox->setCurrentIndex(choice);
+	OstTraceFunctionExit0( DUP1_CALENEDITORREPEATFIELD_UPDATEREPEATCHOICES_EXIT );
 }
 
 /*!
@@ -554,6 +586,7 @@
  */
 void CalenEditorRepeatField::saveRepeatRule()
 {
+	OstTraceFunctionEntry0( CALENEDITORREPEATFIELD_SAVEREPEATRULE_ENTRY );
 	// saves repeat type of entry.
 	if (mRepeatRuleType != AgendaRepeatRule::InvalidRule) {
 		AgendaRepeatRule repeatRule(mRepeatRuleType);
@@ -627,6 +660,7 @@
 											AgendaRepeatRule::InvalidRule));
 	}
 	// TODO: Need to update rDates here
+	OstTraceFunctionExit0( CALENEDITORREPEATFIELD_SAVEREPEATRULE_EXIT );
 }
 
 // End of file	--Don't remove this.