-rw-r--r-- | korganizer/calendarview.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 8512a07..c530037 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -3002,12 +3002,8 @@ void CalendarView::todo_resub( Todo * parent, Todo * sub ) { if (!sub) return; - if (!parent) return; - if ( sub->relatedTo() ) - sub->relatedTo()->removeRelation(sub); + if ( sub->relatedTo() == parent ) + return; sub->setRelatedTo(parent); - sub->setRelatedToUid(parent->uid()); - parent->addRelation(sub); sub->updated(); - parent->updated(); setModified(true); updateView(); @@ -3015,13 +3011,5 @@ void CalendarView::todo_resub( Todo * parent, Todo * sub ) void CalendarView::todo_unsub(Todo *anTodo ) { - // Todo *anTodo = selectedTodo(); - if (!anTodo) return; - if (!anTodo->relatedTo()) return; - anTodo->relatedTo()->removeRelation(anTodo); - anTodo->setRelatedTo(0); - anTodo->updated(); - anTodo->setRelatedToUid(""); - setModified(true); - updateView(); + todo_resub( 0, anTodo ); } |