From 71ee650643b0de6fc45a3805b4901b5106ba8581 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 4 May 2012 14:40:45 +0200 Subject: Reformat tree dump to stdout. --- src/tasktree.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/tasktree.cc') diff --git a/src/tasktree.cc b/src/tasktree.cc index b91c23b..77c8fc8 100644 --- a/src/tasktree.cc +++ b/src/tasktree.cc @@ -249,7 +249,6 @@ node_t* TaskTree::createNode(taskid_t id) { } void TaskTree::insertChild(node_t* parent, node_t* child) { -// printf("!!!!! id when node is inserted %d\n", child->data.id); parent->children.push_back(child); child->parent = parent; } @@ -257,15 +256,12 @@ 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(), t.id, t.title.c_str()); - char buf[4096]; - sprintf(buf, "%s/%u - %s", prefix.c_str(), t.id, t.title.c_str()); - NodeList::iterator it; for(it = node->children.begin(); it != node->children.end(); it++) { node_t* child = *it; - printNode(child, buf); + printNode(child, " " + prefix); } } -- cgit v1.2.3