diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-01-17 13:47:56 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-01-17 13:47:56 +0100 |
commit | 5bca507f4f7bf4ccb2188c98fc8a320f428cacb2 (patch) | |
tree | 654d4ff58dede00b3cf0470a6d686926d85f6ec8 /src/taskmanager.cc | |
parent | 2254587e62f050edd11af9e182b65aff3184eba6 (diff) |
First part move/remove,create problem.
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; |