summaryrefslogtreecommitdiff
path: root/src/tasktree.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tasktree.cc')
-rw-r--r--src/tasktree.cc8
1 files changed, 5 insertions, 3 deletions
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, "");
}