harvesterplugins/tsrc/harvesterplugintester/src/ccalanderobserver.cpp
changeset 7 51d10d255e92
parent 2 208a4ba3894c
child 15 df6898e696c6
--- a/harvesterplugins/tsrc/harvesterplugintester/src/ccalanderobserver.cpp	Thu May 27 12:52:35 2010 +0300
+++ b/harvesterplugins/tsrc/harvesterplugintester/src/ccalanderobserver.cpp	Fri Jun 11 13:39:26 2010 +0300
@@ -65,7 +65,7 @@
 
 void CCalendarObserver::AddEntryL()
     {
-    _LIT(KDescription,"Meeting is scheduled in 1st week of January");
+    _LIT(KDescription,"Meeting");
     const TDesC8& guidDes = KGuid;
     iUid = guidDes.AllocL();        
     CCalEntry* entry = CCalEntry::NewL(CCalEntry::EAppt, iUid, CCalEntry::EMethodNone, 0);    
@@ -94,6 +94,32 @@
     CleanupStack::PopAndDestroy(entry);    
     }
 
+void CCalendarObserver::UpdateCalenderEntryL()
+    {
+    _LIT(KOldEntry,"Meeting");
+    _LIT(KNewEntry,"Updated Meeting");
+    
+    RPointerArray<CCalEntry> entryarray; 
+    CleanupStack::PushL(TCleanupItem(DestroyRPointerArray, &entryarray));
+    
+    iCalEntryView->FetchL(KGuid,entryarray);    
+        for( int i = 0; i < entryarray.Count(); i++)
+            {
+            CCalEntry* entry = entryarray[i];
+            if ( entry->EntryTypeL() == CCalEntry::EAppt )
+                {
+                if ( entry->DescriptionL().Compare ( KOldEntry ) == 0)            
+                    {                    
+                    entry->SetDescriptionL(KNewEntry);
+                    break;
+                    }
+                }
+            }
+    TInt numEntriesAdded = 0;
+    iCalEntryView->StoreL(entryarray, numEntriesAdded);    
+    CleanupStack::PopAndDestroy(&entryarray);   
+    }
+
 void CCalendarObserver::AddNoteL( TPtr8 aMemo)
     {	
     const TDesC8& guidDes = KGuid;