creator/engine/src/creator_note.cpp
changeset 23 c9bf25a20c9f
parent 19 4b22a598b890
child 30 d8e625c87f33
equal deleted inserted replaced
19:4b22a598b890 23:c9bf25a20c9f
    69 void CCreatorNotepad::ConstructL(CCreatorEngine* aEngine)
    69 void CCreatorNotepad::ConstructL(CCreatorEngine* aEngine)
    70     {
    70     {
    71     LOGSTRING("Creator: CCreatorNotepad::ConstructL");
    71     LOGSTRING("Creator: CCreatorNotepad::ConstructL");
    72 
    72 
    73     iEngine = aEngine;
    73     iEngine = aEngine;
    74 
    74     iAgendaUtil = new AgendaUtil();
    75     iNotepadApi = new NotesEditor();
    75     iNotepadApi = new NotesEditor(iAgendaUtil);
    76     //iNotepadApi = CNotepadApi::NewL();
    76     //iNotepadApi = CNotepadApi::NewL();
    77     }
    77     }
    78 
    78 
    79 CCreatorNotepad::~CCreatorNotepad()
    79 CCreatorNotepad::~CCreatorNotepad()
    80     {
    80     {
    81     LOGSTRING("Creator: CCreatorNotepad::~CCreatorNotepad");
    81     LOGSTRING("Creator: CCreatorNotepad::~CCreatorNotepad");
    82     
    82     
    83     // TODO DELETE!!!
    83     if(iNotepadApi)
    84     //delete iNotepadApi;
    84         {
       
    85         delete iNotepadApi;
       
    86         iNotepadApi = NULL;
       
    87         }
       
    88     
       
    89     if(iAgendaUtil)
       
    90         {
       
    91         delete iAgendaUtil;
       
    92         iAgendaUtil = NULL;
       
    93         }
    85     
    94     
    86     if (iParameters)
    95     if (iParameters)
       
    96         {
    87         delete iParameters;
    97         delete iParameters;
       
    98         iParameters;
       
    99         }
    88     }
   100     }
    89 
   101 
    90 //----------------------------------------------------------------------------
   102 //----------------------------------------------------------------------------
    91 
   103 
    92 TBool CCreatorNotepad::AskDataFromUserL(TInt aCommand)
   104 TBool CCreatorNotepad::AskDataFromUserL(TInt aCommand)
   142     {
   154     {
   143     LOGSTRING("Creator: CCreatorNotepad::DeleteAllL");
   155     LOGSTRING("Creator: CCreatorNotepad::DeleteAllL");
   144     QList<AgendaEntry> ael;
   156     QList<AgendaEntry> ael;
   145     AgendaUtil::FilterFlags filter = AgendaUtil::FilterFlags(AgendaUtil::IncludeNotes);
   157     AgendaUtil::FilterFlags filter = AgendaUtil::FilterFlags(AgendaUtil::IncludeNotes);
   146 
   158 
   147     iAgendaUtil = new AgendaUtil();
       
   148     ael = iAgendaUtil->fetchAllEntries(filter);
   159     ael = iAgendaUtil->fetchAllEntries(filter);
   149     for(int i=0 ; i<ael.count() ; i++)
   160     for(int i=0 ; i<ael.count() ; i++)
   150     	{
   161     	{
   151         iAgendaUtil->deleteEntry(ael[i].id());
   162         iAgendaUtil->deleteEntry(ael[i].id());
   152     	}
   163     	}
   153     delete iAgendaUtil;
   164     
   154     // Open Notes db
   165     // Open Notes db
   155  /*   RDbs dbs;
   166  /*   RDbs dbs;
   156     User::LeaveIfError( dbs.Connect() );
   167     User::LeaveIfError( dbs.Connect() );
   157     CleanupClosePushL( dbs );
   168     CleanupClosePushL( dbs );
   158     RDbNamedDatabase db;
   169     RDbNamedDatabase db;