summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Suhr Christensen <jsc@umbraculum.org>2012-03-30 14:00:16 +0200
committerJonas Suhr Christensen <jsc@umbraculum.org>2012-03-30 14:00:16 +0200
commitc3a603e14b05b90735bf87fe5fd85fde8433a9fd (patch)
tree900bf50120deb6a50ed6580afc37536e52d2a871
parent0c79025f9305b4ddf24a34c74f8e4e47f28b6a6e (diff)
Added correct id to backlog node.
Modified output function.
-rw-r--r--src/taskmanager.cc2
-rw-r--r--src/tasktree.cc8
2 files changed, 6 insertions, 4 deletions
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, "");
}