calendarui/multicaluidialog/src/multicaluidialogmodel.cpp
branchRCL_3
changeset 30 d68a4b5d5885
parent 27 55d60436f00b
child 59 aba12c885d83
--- a/calendarui/multicaluidialog/src/multicaluidialogmodel.cpp	Tue May 11 16:12:24 2010 +0300
+++ b/calendarui/multicaluidialog/src/multicaluidialogmodel.cpp	Tue May 25 12:41:10 2010 +0300
@@ -22,11 +22,15 @@
 #include <CalenInterimUtils2.h>
 #include <calcalendarinfo.h>
 #include <calcalendariterator.h>
+#include <calenmulticaluids.hrh>
+
 // user include.
 #include "multicaluidialogmodel.h"
 #include "calendarui_debug.h"
 #include "cleanupresetanddestroy.h"
 
+const TInt KBuffLength = 24;
+
 // ----------------------------------------------------------------------------
 // CMultiCalUiDialogModel::CMultiCalUiDialogModel
 // Constructor
@@ -304,11 +308,29 @@
     CCalCalendarIterator* calIter = CCalCalendarIterator::NewL(
             *iCalendarsSession);
     CleanupStack::PushL(calIter);
-    CCalCalendarInfo* calendarInfo = calIter->FirstL();
-    while (calendarInfo)
+
+    for( CCalCalendarInfo* calendarInfo = calIter->FirstL();
+            calendarInfo!=NULL;calendarInfo = calIter->NextL())
         {
-        aCalendarInfoList.AppendL(calendarInfo);
-        calendarInfo = calIter->NextL();
+            TBuf8<KBuffLength> keyBuff;
+            // Mark the meta property as SoftDeleted
+            keyBuff.Zero();
+            keyBuff.AppendNum(EMarkAsDelete);
+            TBool softDelete = EFalse;
+            TPckgC<TBool> pkgSoftDelete( softDelete );
+            TRAPD(err,pkgSoftDelete.Set(calendarInfo->PropertyValueL(keyBuff)));
+            if( KErrNone == err )
+                {
+                softDelete = pkgSoftDelete();
+                }
+            if(!softDelete)
+                {
+                aCalendarInfoList.Append(calendarInfo);
+                }
+            else
+                {
+                delete calendarInfo;
+                }
         }
     CleanupStack::PopAndDestroy(calIter);