-rw-r--r-- | libkcal/calendarlocal.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 3f46d53..12294c0 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp @@ -151,10 +151,10 @@ bool CalendarLocal::addEvent( Event *event ) } void CalendarLocal::deleteEvent( Event *event ) { - - + if ( mUndoIncidence ) delete mUndoIncidence; + mUndoIncidence = event->clone(); if ( mEventList.removeRef( event ) ) { setModified( true ); } } @@ -200,8 +200,10 @@ bool CalendarLocal::addTodo( Todo *todo ) void CalendarLocal::deleteTodo( Todo *todo ) { // Handle orphaned children + if ( mUndoIncidence ) delete mUndoIncidence; + mUndoIncidence = todo->clone(); removeRelations( todo ); if ( mTodoList.removeRef( todo ) ) { setModified( true ); @@ -686,8 +688,11 @@ bool CalendarLocal::addJournal(Journal *journal) } void CalendarLocal::deleteJournal( Journal *journal ) { + if ( mUndoIncidence ) delete mUndoIncidence; + mUndoIncidence = journal->clone(); + mUndoIncidence->setSummary( mUndoIncidence->description().left(25)); if ( mJournalList.removeRef(journal) ) { setModified( true ); } } |