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/tasktree.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/tasktree.cc') 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