From 2b542db3b553e73bdd58f54f657776715fd5472d Mon Sep 17 00:00:00 2001 From: Jonas Suhr Christensen Date: Thu, 17 May 2012 10:43:33 +0200 Subject: Move is now handled as a remove and create with same id. --- src/taskmanager.cc | 17 +++++++++++++++-- 1 file 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) -- cgit v1.2.3