diff options
author | Jonas Suhr Christensen <jsc@umbraculum.org> | 2012-05-17 10:43:33 +0200 |
---|---|---|
committer | Jonas Suhr Christensen <jsc@umbraculum.org> | 2012-05-17 10:43:33 +0200 |
commit | 2b542db3b553e73bdd58f54f657776715fd5472d (patch) | |
tree | 87beeb8a267f7e3e8f38799826b84af5ff0b7587 /src | |
parent | ac53410cffe5bfa7027bfa5d7d56248f5f490c06 (diff) |
Move is now handled as a remove and create with same id.
Diffstat (limited to 'src')
-rw-r--r-- | src/taskmanager.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/taskmanager.cc b/src/taskmanager.cc index b50e9a6..60b01d6 100644 --- a/src/taskmanager.cc +++ b/src/taskmanager.cc @@ -77,8 +77,10 @@ taskid_t TaskManager::createId() { return idCount++; } -TaskIdList TaskManager::moveTask(taskid_t id, taskid_t to) +TaskIdListPair TaskManager::moveTask(taskid_t id, taskid_t to) throw (std::exception) { + + /* TaskIdList affectedTasks; try { @@ -87,8 +89,19 @@ TaskIdList TaskManager::moveTask(taskid_t id, taskid_t to) catch (std::exception& e) { throw e; } + */ - return affectedTasks; + task_t t = data(id); + t.parentid = to; + + TaskIdListRemove tilremove = tree.remove(id); + TaskIdListCreate tilcreate = tree.create(to, id, t); + + TaskIdListPair tilpair; + tilpair.first = tilremove; + tilpair.second = tilcreate; + + return tilpair; } TaskIdList TaskManager::removeTask(taskid_t id) |