From c3a603e14b05b90735bf87fe5fd85fde8433a9fd Mon Sep 17 00:00:00 2001 From: Jonas Suhr Christensen Date: Fri, 30 Mar 2012 14:00:16 +0200 Subject: Added correct id to backlog node. Modified output function. --- src/taskmanager.cc | 2 +- src/tasktree.cc | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/taskmanager.cc b/src/taskmanager.cc index 838fd23..02f31e1 100644 --- a/src/taskmanager.cc +++ b/src/taskmanager.cc @@ -47,7 +47,7 @@ TaskManager::TaskManager() { tree.insertAsChild(ROOT_ID, FINISHED_ID, t); t.title = "Backlog"; - tree.insertAsChild(ROOT_ID, FINISHED_ID, t); + tree.insertAsChild(ROOT_ID, BACKLOG_ID, t); t.title = "Lost+Found"; tree.insertAsChild(ROOT_ID, LOSTFOUND_ID, t); diff --git a/src/tasktree.cc b/src/tasktree.cc index 6e36974..3aa13f4 100644 --- a/src/tasktree.cc +++ b/src/tasktree.cc @@ -47,6 +47,7 @@ TaskIdList TaskTree::insertAsChild(taskid_t parentid, taskid_t id, task_t data) if(!root) { node_t* node = createNode(id); root = node; + node->data = data; affectedNodes.push_back(id); @@ -185,9 +186,10 @@ void TaskTree::insertChild(node_t* parent, node_t* child) { static void printNode(node_t* node, std::string prefix) { if(!node) return; task_t t = node->data; - printf("%s/%u - %s\n", prefix.c_str(), t.id, t.title.c_str()); + printf("%s/%u - %s\n", prefix.c_str(), node->id, t.title.c_str()); + char buf[4096]; - sprintf(buf, "%s/%u - %s", prefix.c_str(), t.id, t.title.c_str()); + sprintf(buf, "%s/%u - %s", prefix.c_str(), node->id, t.title.c_str()); NodeList::iterator it; for(it = node->children.begin(); it != node->children.end(); it++) { @@ -197,7 +199,7 @@ static void printNode(node_t* node, std::string prefix) { } void TaskTree::toStdOut() { - printNode(root, "/"); + printNode(root, ""); } -- cgit v1.2.3