43 #include <calenmulticalutil.h> |
43 #include <calenmulticalutil.h> |
44 #include <calenmulticaluids.hrh> |
44 #include <calenmulticaluids.hrh> |
45 #include <featmgr.h> |
45 #include <featmgr.h> |
46 #include <hlplch.h> |
46 #include <hlplch.h> |
47 #include <csxhelp/cale.hlp.hrh> |
47 #include <csxhelp/cale.hlp.hrh> |
48 #include <calencontext.h> |
|
49 #include <calenservices.h> |
|
50 |
48 |
51 // User includes |
49 // User includes |
52 #include "calendarui_debug.h" |
50 #include "calendarui_debug.h" |
53 #include "calenmultipledbui.h" |
51 #include "calenmultipledbui.h" |
54 #include "calendar.hrh" |
52 #include "calendar.hrh" |
285 if(iCalendarInfoOriginal) |
283 if(iCalendarInfoOriginal) |
286 { |
284 { |
287 delete iCalendarInfoOriginal; |
285 delete iCalendarInfoOriginal; |
288 iCalendarInfoOriginal = NULL; |
286 iCalendarInfoOriginal = NULL; |
289 } |
287 } |
290 if(iCalEditedDefaultName) |
288 |
291 { |
|
292 delete iCalEditedDefaultName; |
|
293 iCalEditedDefaultName = NULL; |
|
294 } |
|
295 TRACE_EXIT_POINT; |
289 TRACE_EXIT_POINT; |
296 } |
290 } |
297 |
291 |
298 // ---------------------------------------------------------------------------- |
292 // ---------------------------------------------------------------------------- |
299 // CCalenMultipleDbUi::FocusChanged |
293 // CCalenMultipleDbUi::FocusChanged |
773 iController.GetAllCalendarInfoL(calendarInfoList); |
762 iController.GetAllCalendarInfoL(calendarInfoList); |
774 CleanupClosePushL(calendarInfoList); |
763 CleanupClosePushL(calendarInfoList); |
775 |
764 |
776 iCalendarInfoEdited = calendarInfoList[currentIndex]; |
765 iCalendarInfoEdited = calendarInfoList[currentIndex]; |
777 |
766 |
778 iCalEditedDefaultName = calendarInfoList[currentIndex]->FileNameL().AllocL(); |
|
779 CleanupStack::PopAndDestroy(&calendarInfoList); |
767 CleanupStack::PopAndDestroy(&calendarInfoList); |
780 |
768 |
781 //Take a copy of original before editing |
769 //Take a copy of original before editing |
782 if(iCalendarInfoOriginal) |
770 if(iCalendarInfoOriginal) |
783 { |
771 { |
1424 switch (aNotification) |
1412 switch (aNotification) |
1425 { |
1413 { |
1426 case ECalenNotifyCalendarInfoCreated: |
1414 case ECalenNotifyCalendarInfoCreated: |
1427 case ECalenNotifyCalendarInfoUpdated: |
1415 case ECalenNotifyCalendarInfoUpdated: |
1428 { |
1416 { |
1429 MCalenContext& context = iController.Services().Context(); |
1417 if (iDbEditor) |
1430 TDesC& aConflictCalendarName = context.GetCalendarFileNameL(); |
|
1431 TBool isSameFileEdited = EFalse; |
|
1432 if(iCalEditedDefaultName) |
|
1433 { |
|
1434 if(!iCalEditedDefaultName->CompareF(aConflictCalendarName)) |
|
1435 { |
|
1436 isSameFileEdited = ETrue; |
|
1437 } |
|
1438 else |
|
1439 { |
|
1440 isSameFileEdited = EFalse; |
|
1441 } |
|
1442 } |
|
1443 |
|
1444 if (iDbEditor && isSameFileEdited) |
|
1445 { |
1418 { |
1446 iConflictOccured = ETrue; |
1419 iConflictOccured = ETrue; |
1447 iDbEditor->SetConflict(CCalenMultiDBEditor::EConflictUpdate); |
1420 iDbEditor->SetConflict(CCalenMultiDBEditor::EConflictUpdate); |
1448 } |
1421 } |
1449 } |
1422 } |
1450 break; |
1423 break; |
1451 case ECalenNotifyCalendarFileDeleted: |
1424 case ECalenNotifyCalendarFileDeleted: |
1452 { |
1425 { |
1453 RPointerArray<CCalCalendarInfo> calendarInfoList; |
1426 if (iDbEditor) |
1454 TBool isSameFileDeleted = EFalse; |
|
1455 iController.GetAllCalendarInfoL(calendarInfoList); |
|
1456 CleanupClosePushL(calendarInfoList); |
|
1457 if(iCalEditedDefaultName) |
|
1458 { |
|
1459 for(TInt i=0; i<calendarInfoList.Count(); i++) |
|
1460 { |
|
1461 if(!iCalEditedDefaultName->CompareF(calendarInfoList[i]->FileNameL())) |
|
1462 { |
|
1463 isSameFileDeleted = EFalse; |
|
1464 break; |
|
1465 } |
|
1466 else |
|
1467 { |
|
1468 isSameFileDeleted = ETrue; |
|
1469 } |
|
1470 } |
|
1471 } |
|
1472 CleanupStack::PopAndDestroy(&calendarInfoList); |
|
1473 |
|
1474 if (iDbEditor && isSameFileDeleted) |
|
1475 { |
1427 { |
1476 iConflictOccured = ETrue; |
1428 iConflictOccured = ETrue; |
1477 iDbEditor->SetConflict(CCalenMultiDBEditor::EConflictDelete); |
1429 iDbEditor->SetConflict(CCalenMultiDBEditor::EConflictDelete); |
1478 } |
1430 } |
1479 } |
1431 } |