diff -r aba12c885d83 -r 96907930389d calendarui/controller/src/calenmultipledbui.cpp --- a/calendarui/controller/src/calenmultipledbui.cpp Thu Jul 15 18:37:27 2010 +0300 +++ b/calendarui/controller/src/calenmultipledbui.cpp Thu Aug 19 09:53:43 2010 +0300 @@ -45,6 +45,8 @@ #include #include #include +#include +#include // User includes #include "calendarui_debug.h" @@ -285,7 +287,11 @@ delete iCalendarInfoOriginal; iCalendarInfoOriginal = NULL; } - +if(iCalEditedDefaultName) + { + delete iCalEditedDefaultName; + iCalEditedDefaultName = NULL; + } TRACE_EXIT_POINT; } @@ -687,6 +693,11 @@ TInt retError = KErrNone; iDbEditor = NULL; + if(iCalEditedDefaultName) + { + delete iCalEditedDefaultName; + iCalEditedDefaultName = NULL; + } if(aItemAdded) { @@ -764,6 +775,7 @@ iCalendarInfoEdited = calendarInfoList[currentIndex]; + iCalEditedDefaultName = calendarInfoList[currentIndex]->FileNameL().AllocL(); CleanupStack::PopAndDestroy(&calendarInfoList); //Take a copy of original before editing @@ -1414,7 +1426,22 @@ case ECalenNotifyCalendarInfoCreated: case ECalenNotifyCalendarInfoUpdated: { - if (iDbEditor) + MCalenContext& context = iController.Services().Context(); + TDesC& aConflictCalendarName = context.GetCalendarFileNameL(); + TBool isSameFileEdited = EFalse; + if(iCalEditedDefaultName) + { + if(!iCalEditedDefaultName->CompareF(aConflictCalendarName)) + { + isSameFileEdited = ETrue; + } + else + { + isSameFileEdited = EFalse; + } + } + + if (iDbEditor && isSameFileEdited) { iConflictOccured = ETrue; iDbEditor->SetConflict(CCalenMultiDBEditor::EConflictUpdate); @@ -1423,7 +1450,28 @@ break; case ECalenNotifyCalendarFileDeleted: { - if (iDbEditor) + RPointerArray calendarInfoList; + TBool isSameFileDeleted = EFalse; + iController.GetAllCalendarInfoL(calendarInfoList); + CleanupClosePushL(calendarInfoList); + if(iCalEditedDefaultName) + { + for(TInt i=0; iCompareF(calendarInfoList[i]->FileNameL())) + { + isSameFileDeleted = EFalse; + break; + } + else + { + isSameFileDeleted = ETrue; + } + } + } + CleanupStack::PopAndDestroy(&calendarInfoList); + + if (iDbEditor && isSameFileDeleted) { iConflictOccured = ETrue; iDbEditor->SetConflict(CCalenMultiDBEditor::EConflictDelete); @@ -1435,7 +1483,7 @@ } // refresh calendar list - UpdateListboxL(); + TRAP_IGNORE(UpdateListboxL()); TRACE_EXIT_POINT; }