-rw-r--r-- | libkcal/calendarlocal.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 3f46d53..12294c0 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp | |||
@@ -149,17 +149,17 @@ bool CalendarLocal::addEvent( Event *event ) | |||
149 | 149 | ||
150 | return true; | 150 | return true; |
151 | } | 151 | } |
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 | } |
160 | } | 160 | } |
161 | 161 | ||
162 | 162 | ||
163 | Event *CalendarLocal::event( const QString &uid ) | 163 | Event *CalendarLocal::event( const QString &uid ) |
164 | { | 164 | { |
165 | 165 | ||
@@ -198,13 +198,15 @@ bool CalendarLocal::addTodo( Todo *todo ) | |||
198 | return true; | 198 | return true; |
199 | } | 199 | } |
200 | 200 | ||
201 | void CalendarLocal::deleteTodo( Todo *todo ) | 201 | void CalendarLocal::deleteTodo( Todo *todo ) |
202 | { | 202 | { |
203 | // Handle orphaned children | 203 | // Handle orphaned children |
204 | removeRelations( todo ); | 204 | if ( mUndoIncidence ) delete mUndoIncidence; |
205 | mUndoIncidence = todo->clone(); | ||
206 | removeRelations( todo ); | ||
205 | 207 | ||
206 | if ( mTodoList.removeRef( todo ) ) { | 208 | if ( mTodoList.removeRef( todo ) ) { |
207 | setModified( true ); | 209 | setModified( true ); |
208 | } | 210 | } |
209 | } | 211 | } |
210 | 212 | ||
@@ -684,12 +686,15 @@ bool CalendarLocal::addJournal(Journal *journal) | |||
684 | 686 | ||
685 | return true; | 687 | return true; |
686 | } | 688 | } |
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 | } |
693 | } | 698 | } |
694 | 699 | ||
695 | Journal *CalendarLocal::journal( const QDate &date ) | 700 | Journal *CalendarLocal::journal( const QDate &date ) |