summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp18
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
@@ -3001,28 +3001,16 @@ void CalendarView::appointment_delete()
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();
}
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 );
}
void CalendarView::deleteTodo(Todo *todo)