diff options
Diffstat (limited to 'src/taskmanager.cc')
-rw-r--r-- | src/taskmanager.cc | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/taskmanager.cc b/src/taskmanager.cc index 5f8e2d7..38d7893 100644 --- a/src/taskmanager.cc +++ b/src/taskmanager.cc @@ -112,15 +112,26 @@ TaskIdListPair TaskManager::moveTask(taskid_t id, taskid_t to) if(id == to) throw std::exception(); // Node and new parent are the same node. - task_t t = tree.data(id); + //task_t t = tree.data(id); // Make sure the new parent exists. This will throw an exception if it doesn't - task_t t_ = tree.data(to); + //task_t t_ = tree.data(to); - t.parentid = to; + // t.parentid = to; - TaskIdList tilremove = tree.remove(id); - TaskIdList tilcreate = tree.insertAsChild(to, id, t); + // TaskIdList tilremove = tree.remove(id); + TaskIdList tilremove; + tilremove.push_back(id); + TaskIdList ancestors = tree.ancestorList(id); + tilremove.insert(tilremove.end(), ancestors.begin(), ancestors.end()); + + // TaskIdList tilcreate = tree.insertAsChild(to, id, t); + TaskIdList tilcreate; + tilcreate.push_back(to); + ancestors = tree.ancestorList(to); + tilcreate.insert(tilcreate.end(), ancestors.begin(), ancestors.end()); + + tree.move(id, to); TaskIdListPair tilpair; tilpair.first = tilremove; |