calendarui/controller/src/calendeleteui.cpp
branchRCL_3
changeset 28 96907930389d
parent 15 9711e452b5e9
child 29 12af337248b1
equal deleted inserted replaced
27:aba12c885d83 28:96907930389d
    39 #include <caleninstanceid.h>            // TCalenInstanceId
    39 #include <caleninstanceid.h>            // TCalenInstanceId
    40 #include <calenactionuiutils.h>
    40 #include <calenactionuiutils.h>
    41 #include <calcalendarinfo.h>
    41 #include <calcalendarinfo.h>
    42 #include <calentoolbar.h>
    42 #include <calentoolbar.h>
    43 #include <akntoolbar.h>
    43 #include <akntoolbar.h>
    44 #include <CalenAttachmentModel.h>
    44 #include <calenattachmentmodel.h>
    45 
    45 
    46 #include "calendarui_debug.h"           // Debug
    46 #include "calendarui_debug.h"           // Debug
    47 #include "calendeleteui.h"
    47 #include "calendeleteui.h"
    48 #include "calencontroller.h"
    48 #include "calencontroller.h"
    49 #include "CleanupResetAndDestroy.h"
    49 #include "CleanupResetAndDestroy.h"
   948                                                                     entryType == CCalEntry::ETodo ?
   948                                                                     entryType == CCalEntry::ETodo ?
   949                                                                     CalenActionUiUtils::EDeleteToDo :
   949                                                                     CalenActionUiUtils::EDeleteToDo :
   950                                                                     CalenActionUiUtils::EDeleteEntry );
   950                                                                     CalenActionUiUtils::EDeleteEntry );
   951     if( doDelete )
   951     if( doDelete )
   952         {
   952         {
       
   953         //Before deleteing the attachment, reset the attachment model
       
   954         if(iController.Services().GetAttachmentData()->NumberOfItems())
       
   955             {
       
   956             iController.Services().GetAttachmentData()->Reset();
       
   957             }
   953         aEntryView->DeleteL( *aEntry );
   958         aEntryView->DeleteL( *aEntry );
   954 
   959 
   955         if( aEntry )
   960         if( aEntry )
   956             {
   961             {
   957             delete aEntry;
   962             delete aEntry;