diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2012-05-04 14:40:45 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2012-05-04 14:40:45 +0200 |
commit | 71ee650643b0de6fc45a3805b4901b5106ba8581 (patch) | |
tree | 384cf7fdd20e8e6fcaf54ad69a2f1930a55d2e67 /src | |
parent | 5edf746e07502eb7fed813a1f379f936445765e0 (diff) |
Reformat tree dump to stdout.
Diffstat (limited to 'src')
-rw-r--r-- | src/tasktree.cc | 8 |
1 files changed, 2 insertions, 6 deletions
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); } } |