32 // user includes |
32 // user includes |
33 #include "calendbfield.h" |
33 #include "calendbfield.h" |
34 #include "CalenDefaultEditors.hrh" |
34 #include "CalenDefaultEditors.hrh" |
35 #include "calenunifiededitor.h" |
35 #include "calenunifiededitor.h" |
36 #include "CalendarPrivateCRKeys.h" |
36 #include "CalendarPrivateCRKeys.h" |
|
37 #include "CleanupResetAndDestroy.h" |
37 #include "calendarui_debug.h" |
38 #include "calendarui_debug.h" |
38 |
39 |
39 |
40 |
40 // ----------------------------------------------------------------------------- |
41 // ----------------------------------------------------------------------------- |
41 // CCalenDbField::NewL |
42 // CCalenDbField::NewL |
380 CleanupStack::PopAndDestroy( &calendarInfoList ); |
381 CleanupStack::PopAndDestroy( &calendarInfoList ); |
381 |
382 |
382 TRACE_EXIT_POINT |
383 TRACE_EXIT_POINT |
383 return *iCalendarFileName; |
384 return *iCalendarFileName; |
384 } |
385 } |
|
386 |
|
387 // ----------------------------------------------------------------------------- |
|
388 // CCalenDbField::GetCalendarNameForEntryL |
|
389 // get calendar index for the entry |
|
390 // ----------------------------------------------------------------------------- |
|
391 // |
|
392 TInt CCalenDbField::GetCalendarNameForEntryL(const TDesC& aCalendarFileName) |
|
393 { |
|
394 TRACE_ENTRY_POINT |
|
395 __impl_prints(_L("CCalenDbField::GetCalendarNameForEntryL 2-- start")); |
|
396 HBufC* calendarFilename = aCalendarFileName.AllocLC(); |
|
397 RPointerArray<CCalCalendarInfo> calendarInfoList; |
|
398 iServices->GetAllCalendarInfoL(calendarInfoList); |
|
399 CleanupClosePushL( calendarInfoList ); |
|
400 __impl_prints(_L("CCalenDbField::GetCalendarNameForEntryL -- GetAllCalendarInfoL")); |
|
401 TInt index = calendarInfoList.Find(*calendarFilename, |
|
402 CCalenDbField::CalendarInfoNameIdentifierL); |
|
403 __impl_print(_L("CCalenDbField::GetCalendarNameForEntryL 2 -- index = %d"),index); |
|
404 CleanupStack::PopAndDestroy(calendarFilename); |
|
405 CleanupStack::PopAndDestroy( &calendarInfoList ); |
|
406 |
|
407 TRACE_EXIT_POINT |
|
408 return index; |
|
409 } |
385 |
410 |
386 // ----------------------------------------------------------------------------- |
411 // ----------------------------------------------------------------------------- |
387 // CCalenDbField::IsCalendarEdited |
412 // CCalenDbField::IsCalendarEdited |
388 // (other items were commented in a header). |
413 // (other items were commented in a header). |
389 // ----------------------------------------------------------------------------- |
414 // ----------------------------------------------------------------------------- |
419 //Check the child entries for the repeated entry |
444 //Check the child entries for the repeated entry |
420 //The entry which is changing the calendar having any childs |
445 //The entry which is changing the calendar having any childs |
421 //show this information note to the user. |
446 //show this information note to the user. |
422 CCalEntry& originalEntry = iUnifiedEditor.EditorDataHandler().Entry(); |
447 CCalEntry& originalEntry = iUnifiedEditor.EditorDataHandler().Entry(); |
423 RPointerArray<CCalEntry> childEntries; |
448 RPointerArray<CCalEntry> childEntries; |
424 CleanupClosePushL(childEntries); |
449 CleanupResetAndDestroyPushL(childEntries); |
425 iServices->EntryViewL(iPreviousColId)->FetchL(originalEntry.UidL(), childEntries); |
450 iServices->EntryViewL(iPreviousColId)->FetchL(originalEntry.UidL(), childEntries); |
426 if(IsCalendarEdited() && (childEntries.Count() > 1)) |
451 if(IsCalendarEdited() && (childEntries.Count() > 1)) |
427 { |
452 { |
428 TCalCollectionId currentId = iCurrentColId; |
453 TCalCollectionId currentId = iCurrentColId; |
429 SetDataToEditorL(); |
454 SetDataToEditorL(); |