--- a/calendarui/caleneditor/src/caleneditordatahandler.cpp Tue Jul 06 14:14:56 2010 +0300
+++ b/calendarui/caleneditor/src/caleneditordatahandler.cpp Wed Aug 18 09:47:38 2010 +0300
@@ -23,7 +23,13 @@
// User Includes
#include "caleneditordatahandler.h"
#include "calendateutils.h"
-#include "agendaentry.h"
+#include "calenagendautils.h"
+#include <agendaentry.h>
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "caleneditordatahandlerTraces.h"
+#endif
+
/*!
\class CalenEditorDataHandler
@@ -37,7 +43,9 @@
AgendaEntry* originalEntry)
: mCalenEditor(calenEditor),mEditedEntry(editedEntry), mOriginalEntry(originalEntry)
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_CALENEDITORDATAHANDLER_ENTRY );
+ OstTraceFunctionExit0( CALENEDITORDATAHANDLER_CALENEDITORDATAHANDLER_EXIT );
}
/*!
@@ -45,7 +53,9 @@
*/
CalenEditorDataHandler::~CalenEditorDataHandler()
{
+ OstTraceFunctionEntry0( DUP1_CALENEDITORDATAHANDLER_CALENEDITORDATAHANDLER_ENTRY );
// Nothing Yet
+ OstTraceFunctionExit0( DUP1_CALENEDITORDATAHANDLER_CALENEDITORDATAHANDLER_EXIT );
}
/*!
@@ -54,6 +64,8 @@
*/
AgendaEntry* CalenEditorDataHandler::editedEntry()
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_EDITEDENTRY_ENTRY );
+ OstTraceFunctionExit0( CALENEDITORDATAHANDLER_EDITEDENTRY_EXIT );
return mEditedEntry;
}
@@ -63,6 +75,8 @@
*/
AgendaEntry* CalenEditorDataHandler::originalEntry()
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ORIGINALENTRY_ENTRY );
+ OstTraceFunctionExit0( CALENEDITORDATAHANDLER_ORIGINALENTRY_EXIT );
return mOriginalEntry;
}
@@ -72,6 +86,7 @@
*/
CalenEditorPrivate::Error CalenEditorDataHandler::checkErrorsForThisAndAll()
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_CHECKERRORSFORTHISANDALL_ENTRY );
//TODO : Remove implementation once handle all repeating errors
const QDateTime startTime = mEditedEntry->startTime();
const QDateTime endTime = mEditedEntry->endTime();
@@ -109,11 +124,14 @@
}
if (durationGreaterThanRepeatIntervalError()) {
+ OstTraceFunctionExit0( CALENEDITORDATAHANDLER_CHECKERRORSFORTHISANDALL_EXIT );
return CalenEditorPrivate::
CalenEditorErrorDurationGreaterThanRepeatInterval;
}
+ OstTraceFunctionExit0( DUP1_CALENEDITORDATAHANDLER_CHECKERRORSFORTHISANDALL_EXIT );
return CalenEditorPrivate::CalenEditorErrorNone;
}
+ OstTraceFunctionExit0( DUP2_CALENEDITORDATAHANDLER_CHECKERRORSFORTHISANDALL_EXIT );
return CalenEditorPrivate::CalenEditorErrorNone;
}
@@ -123,6 +141,7 @@
*/
bool CalenEditorDataHandler::isEdited() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ISEDITED_ENTRY );
return (isSummaryEdited() ||
isAllDayEdited() ||
isLocationEdited() ||
@@ -139,6 +158,7 @@
*/
bool CalenEditorDataHandler::isSummaryEdited() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ISSUMMARYEDITED_ENTRY );
return (mOriginalEntry->summary() != mEditedEntry->summary());
}
@@ -148,24 +168,30 @@
*/
bool CalenEditorDataHandler::isAllDayEdited() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ISALLDAYEDITED_ENTRY );
HbDataFormModelItem* alldayItem = mCalenEditor->allDayCheckBoxItem();
if (alldayItem) {
- if (mOriginalEntry->type() == AgendaEntry::TypeEvent) {
+ if (CalenAgendaUtils::isAlldayEvent(*mOriginalEntry)) {
if (alldayItem->contentWidgetData("checkState")
== Qt::Checked) {
+ OstTraceFunctionExit0( CALENEDITORDATAHANDLER_ISALLDAYEDITED_EXIT );
return false;
} else {
+ OstTraceFunctionExit0( DUP1_CALENEDITORDATAHANDLER_ISALLDAYEDITED_EXIT );
return true;
}
} else if (mOriginalEntry->type() == AgendaEntry::TypeAppoinment) {
if (alldayItem->contentWidgetData("checkState")
== Qt::Checked) {
+ OstTraceFunctionExit0( DUP2_CALENEDITORDATAHANDLER_ISALLDAYEDITED_EXIT );
return true;
} else {
+ OstTraceFunctionExit0( DUP3_CALENEDITORDATAHANDLER_ISALLDAYEDITED_EXIT );
return false;
}
}
}
+ OstTraceFunctionExit0( DUP4_CALENEDITORDATAHANDLER_ISALLDAYEDITED_EXIT );
return false;
}
@@ -175,6 +201,7 @@
*/
bool CalenEditorDataHandler::isLocationEdited() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ISLOCATIONEDITED_ENTRY );
return (mOriginalEntry->location() != mEditedEntry->location());
}
@@ -184,6 +211,7 @@
*/
bool CalenEditorDataHandler::isStartDateTimeEdited() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ISSTARTDATETIMEEDITED_ENTRY );
return (mOriginalEntry->startTime() != mEditedEntry->startTime());
}
@@ -193,6 +221,7 @@
*/
bool CalenEditorDataHandler::isEndDateTimeEdited() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ISENDDATETIMEEDITED_ENTRY );
return (mOriginalEntry->endTime() != mEditedEntry->endTime());
}
@@ -202,6 +231,7 @@
*/
bool CalenEditorDataHandler::isAlarmEdited() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ISALARMEDITED_ENTRY );
return (mOriginalEntry->alarm() != mEditedEntry->alarm());
}
@@ -211,15 +241,14 @@
*/
bool CalenEditorDataHandler::isRepeatRuleEdited() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ISREPEATRULEEDITED_ENTRY );
if ((mOriginalEntry->repeatRule().type() == AgendaRepeatRule::InvalidRule)
&& (mEditedEntry->repeatRule().type()
== AgendaRepeatRule::InvalidRule)) {
+ OstTraceFunctionExit0( CALENEDITORDATAHANDLER_ISREPEATRULEEDITED_EXIT );
return false;
} else {
- return ((mOriginalEntry->repeatRule().type() !=
- mEditedEntry->repeatRule().type())
- || (mOriginalEntry->repeatRule().until().date() !=
- mEditedEntry->repeatRule().until().date()));
+ return (mOriginalEntry->repeatRule() != mEditedEntry->repeatRule());
}
}
@@ -229,6 +258,7 @@
*/
bool CalenEditorDataHandler::isDescriptionEdited() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ISDESCRIPTIONEDITED_ENTRY );
return (mOriginalEntry->description() != mEditedEntry->description());
}
@@ -239,6 +269,7 @@
*/
bool CalenEditorDataHandler::nonTextItemsEdited() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_NONTEXTITEMSEDITED_ENTRY );
return (isAllDayEdited() ||
isStartDateTimeEdited() ||
isEndDateTimeEdited() ||
@@ -253,6 +284,7 @@
*/
bool CalenEditorDataHandler::areTextItemsEmpty() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ARETEXTITEMSEMPTY_ENTRY );
return (mEditedEntry->summary().isEmpty()
&& mEditedEntry->location().isEmpty()
&& mEditedEntry->description().isEmpty());
@@ -265,15 +297,18 @@
*/
bool CalenEditorDataHandler::areTextItemsCleared() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ARETEXTITEMSCLEARED_ENTRY );
if (mEditedEntry->summary().isEmpty() &&
mEditedEntry->location().isEmpty() &&
mEditedEntry->description().isEmpty()) {
if (isSummaryEmptied()
|| isLocationEmptied()
|| isDescriptionEmptied()) {
+ OstTraceFunctionExit0( CALENEDITORDATAHANDLER_ARETEXTITEMSCLEARED_EXIT );
return true;
}
}
+ OstTraceFunctionExit0( DUP1_CALENEDITORDATAHANDLER_ARETEXTITEMSCLEARED_EXIT );
return false;
}
@@ -284,6 +319,7 @@
*/
bool CalenEditorDataHandler::isSummaryEmptied() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ISSUMMARYEMPTIED_ENTRY );
return (!mOriginalEntry->summary().isEmpty()
&& mEditedEntry->summary().isEmpty());
}
@@ -295,6 +331,7 @@
*/
bool CalenEditorDataHandler::isLocationEmptied() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ISLOCATIONEMPTIED_ENTRY );
return (!mOriginalEntry->location().isEmpty()
&& mEditedEntry->location().isEmpty());
}
@@ -306,6 +343,7 @@
*/
bool CalenEditorDataHandler::isDescriptionEmptied() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ISDESCRIPTIONEMPTIED_ENTRY );
return (!mOriginalEntry->description().isEmpty()
&& mEditedEntry->description().isEmpty());
}
@@ -318,6 +356,7 @@
CalenEditorPrivate::Action CalenEditorDataHandler::shouldSaveOrDeleteOrDoNothing(bool launchCalendar)
const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_SHOULDSAVEORDELETEORDONOTHING_ENTRY );
// Need to save the entry if third party calls editor to launch the
// calendar after that. So, that entry will be new entry adn we assume
// that client launches editor with some prefilled text items
@@ -326,6 +365,7 @@
// Only added space characters to text fields but not
// edited the non-text items
// no need to save the entry
+ OstTraceFunctionExit0( CALENEDITORDATAHANDLER_SHOULDSAVEORDELETEORDONOTHING_EXIT );
return CalenEditorPrivate::ActionNothing;
}
// new entry is edited
@@ -335,8 +375,10 @@
// If text items as a whole is empty, we can still save the note
// since we edited "non-text" fields
if (!nonTextItemsEdited() && areTextItemsEmpty()) {
+ OstTraceFunctionExit0( DUP1_CALENEDITORDATAHANDLER_SHOULDSAVEORDELETEORDONOTHING_EXIT );
return CalenEditorPrivate::ActionNothing;
} else {
+ OstTraceFunctionExit0( DUP2_CALENEDITORDATAHANDLER_SHOULDSAVEORDELETEORDONOTHING_EXIT );
return CalenEditorPrivate::ActionSave;
}
}
@@ -344,9 +386,11 @@
// ***** edited entry + text items emptied + non-text items not edited
// Even if user may have edited non-text fields,
// delete the note
+ OstTraceFunctionExit0( DUP3_CALENEDITORDATAHANDLER_SHOULDSAVEORDELETEORDONOTHING_EXIT );
return CalenEditorPrivate::ActionDelete;
}
// Save the note, since the text fields contain something
+ OstTraceFunctionExit0( DUP4_CALENEDITORDATAHANDLER_SHOULDSAVEORDELETEORDONOTHING_EXIT );
return CalenEditorPrivate::ActionSave;
}
@@ -358,6 +402,7 @@
*/
bool CalenEditorDataHandler::durationGreaterThanRepeatIntervalError() const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_DURATIONGREATERTHANREPEATINTERVALERROR_ENTRY );
bool isError = false;
switch (mEditedEntry->repeatRule().type()) {
case AgendaRepeatRule::DailyRule: {
@@ -395,6 +440,7 @@
isError = false;
break;
}
+ OstTraceFunctionExit0( CALENEDITORDATAHANDLER_DURATIONGREATERTHANREPEATINTERVALERROR_EXIT );
return isError;
}
@@ -405,6 +451,7 @@
CalenEditorPrivate::Error CalenEditorDataHandler::checkAlarmFieldsForErrors(
bool series) const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_CHECKALARMFIELDSFORERRORS_ENTRY );
CalenEditorPrivate::Error error = CalenEditorPrivate::CalenEditorErrorNone;
// If alarm not active, no check
if (!mEditedEntry->alarm().isNull()) {
@@ -424,6 +471,7 @@
}
}
}
+ OstTraceFunctionExit0( CALENEDITORDATAHANDLER_CHECKALARMFIELDSFORERRORS_EXIT );
return error;
}
@@ -439,6 +487,7 @@
const QDateTime &alarmTime,
const QDateTime &startTime) const
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_ISALARMINACCEPTABLEPERIOD_ENTRY );
QDateTime upperLimit = startTime;
QDateTime lowerLimit = startTime.addDays(-31);
@@ -452,6 +501,7 @@
error = CalenEditorPrivate::CalenEditorErrorAlarmTimeLaterThanNote;
}
}
+ OstTraceFunctionExit0( CALENEDITORDATAHANDLER_ISALARMINACCEPTABLEPERIOD_EXIT );
return acceptable;
}
@@ -461,6 +511,7 @@
*/
void CalenEditorDataHandler::displayErrorMsg(int error)
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_DISPLAYERRORMSG_ENTRY );
QString errorMsg = QString::Null();
switch (error) {
@@ -494,6 +545,7 @@
if (!errorMsg.isNull()) {
HbMessageBox::information(errorMsg);
}
+ OstTraceFunctionExit0( CALENEDITORDATAHANDLER_DISPLAYERRORMSG_EXIT );
}
/*!
@@ -501,6 +553,7 @@
*/
void CalenEditorDataHandler::dispalyErrorMsgByRepeatType()
{
+ OstTraceFunctionEntry0( CALENEDITORDATAHANDLER_DISPALYERRORMSGBYREPEATTYPE_ENTRY );
QString errorMsg = QString::Null();
int durationDays =
@@ -534,6 +587,7 @@
if (!errorMsg.isNull()) {
HbMessageBox::information(errorMsg.arg(numDaysEntrySpan));
}
+ OstTraceFunctionExit0( CALENEDITORDATAHANDLER_DISPALYERRORMSGBYREPEATTYPE_EXIT );
}
// End of file --Don't remove this.