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.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index e4a11f5..1f8ad5b 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -419,6 +419,8 @@ void CalendarView::init()
connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ),
this, SLOT ( todo_unsub( Todo * ) ) );
+ connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
+ this, SLOT ( todo_resub( Todo *,Todo * ) ) );
connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList,
SLOT( updateTodo( Todo *, int ) ) );
connect( this, SIGNAL( todoModified( Todo *, int )), this,
@@ -2746,6 +2748,20 @@ void CalendarView::appointment_delete()
deleteEvent(anEvent);
}
+void CalendarView::todo_resub( Todo * parent, Todo * sub )
+{
+ if (!sub) return;
+ if (!parent) return;
+ if ( sub->relatedTo() )
+ sub->relatedTo()->removeRelation(sub);
+ 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();