creator/engine/src/creator_note.cpp
changeset 23 c9bf25a20c9f
parent 19 4b22a598b890
child 30 d8e625c87f33
--- a/creator/engine/src/creator_note.cpp	Thu May 27 12:52:19 2010 +0300
+++ b/creator/engine/src/creator_note.cpp	Fri Jun 11 13:39:09 2010 +0300
@@ -71,8 +71,8 @@
     LOGSTRING("Creator: CCreatorNotepad::ConstructL");
 
     iEngine = aEngine;
-
-    iNotepadApi = new NotesEditor();
+    iAgendaUtil = new AgendaUtil();
+    iNotepadApi = new NotesEditor(iAgendaUtil);
     //iNotepadApi = CNotepadApi::NewL();
     }
 
@@ -80,11 +80,23 @@
     {
     LOGSTRING("Creator: CCreatorNotepad::~CCreatorNotepad");
     
-    // TODO DELETE!!!
-    //delete iNotepadApi;
+    if(iNotepadApi)
+        {
+        delete iNotepadApi;
+        iNotepadApi = NULL;
+        }
+    
+    if(iAgendaUtil)
+        {
+        delete iAgendaUtil;
+        iAgendaUtil = NULL;
+        }
     
     if (iParameters)
+        {
         delete iParameters;
+        iParameters;
+        }
     }
 
 //----------------------------------------------------------------------------
@@ -144,13 +156,12 @@
     QList<AgendaEntry> ael;
     AgendaUtil::FilterFlags filter = AgendaUtil::FilterFlags(AgendaUtil::IncludeNotes);
 
-    iAgendaUtil = new AgendaUtil();
     ael = iAgendaUtil->fetchAllEntries(filter);
     for(int i=0 ; i<ael.count() ; i++)
     	{
         iAgendaUtil->deleteEntry(ael[i].id());
     	}
-    delete iAgendaUtil;
+    
     // Open Notes db
  /*   RDbs dbs;
     User::LeaveIfError( dbs.Connect() );