-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 | |||
@@ -152,8 +152,8 @@ bool CalendarLocal::addEvent( Event *event ) | |||
152 | 152 | ||
153 | void CalendarLocal::deleteEvent( Event *event ) | 153 | void CalendarLocal::deleteEvent( Event *event ) |
154 | { | 154 | { |
155 | 155 | if ( mUndoIncidence ) delete mUndoIncidence; | |
156 | 156 | mUndoIncidence = event->clone(); | |
157 | if ( mEventList.removeRef( event ) ) { | 157 | if ( mEventList.removeRef( event ) ) { |
158 | setModified( true ); | 158 | setModified( true ); |
159 | } | 159 | } |
@@ -201,6 +201,8 @@ bool CalendarLocal::addTodo( Todo *todo ) | |||
201 | void CalendarLocal::deleteTodo( Todo *todo ) | 201 | void CalendarLocal::deleteTodo( Todo *todo ) |
202 | { | 202 | { |
203 | // Handle orphaned children | 203 | // Handle orphaned children |
204 | if ( mUndoIncidence ) delete mUndoIncidence; | ||
205 | mUndoIncidence = todo->clone(); | ||
204 | removeRelations( todo ); | 206 | removeRelations( todo ); |
205 | 207 | ||
206 | if ( mTodoList.removeRef( todo ) ) { | 208 | if ( mTodoList.removeRef( todo ) ) { |
@@ -687,6 +689,9 @@ bool CalendarLocal::addJournal(Journal *journal) | |||
687 | 689 | ||
688 | void CalendarLocal::deleteJournal( Journal *journal ) | 690 | void CalendarLocal::deleteJournal( Journal *journal ) |
689 | { | 691 | { |
692 | if ( mUndoIncidence ) delete mUndoIncidence; | ||
693 | mUndoIncidence = journal->clone(); | ||
694 | mUndoIncidence->setSummary( mUndoIncidence->description().left(25)); | ||
690 | if ( mJournalList.removeRef(journal) ) { | 695 | if ( mJournalList.removeRef(journal) ) { |
691 | setModified( true ); | 696 | setModified( true ); |
692 | } | 697 | } |