summaryrefslogtreecommitdiff
path: root/src/tasktree.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tasktree.cc')
-rw-r--r--src/tasktree.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/tasktree.cc b/src/tasktree.cc
index 4d6099e..b91c23b 100644
--- a/src/tasktree.cc
+++ b/src/tasktree.cc
@@ -68,9 +68,10 @@ TaskIdList TaskTree::insertAsChild(taskid_t parentid, taskid_t id, task_t data)
try {
node_t* parent = id2node.at(parentid);
node_t* child = createNode(id);
+// printf("!!!!!!!id in insert: %d\n", data.id);
child->data = data;
insertChild(parent, child);
-
+
// affectedNodes.push_back(parentid);
affectedNodes.push_back(id);
TaskIdList ancestors = ancestorList(id);
@@ -167,8 +168,10 @@ task_t TaskTree::data(taskid_t id)
try {
node_t* node = id2node.at(id);
- t = node->data;
- t.id = node->id;
+ task_t tmp = node->data;
+ t.id = tmp.id;
+ t.title = tmp.title;
+// printf("!!!!t.id and tmp.id in data: %d and %d\n", t.id, tmp.id);
if(node->parent) t.parentid = node->parent->id;
else {
if(t.id != rootid) throw std::exception();
@@ -229,10 +232,10 @@ TaskIdList TaskTree::ancestorList(taskid_t id)
throw e;
}
- printf("Collected %d ancestors to %u\n", ancestors.size(), id);
+// printf("Collected %d ancestors to %u\n", ancestors.size(), id);
for(TaskIdList::iterator it = ancestors.begin();
it != ancestors.end(); it++) {
- printf("\tancestor %u\n", *it);
+// printf("\tancestor %u\n", *it);
}
return ancestors;
}
@@ -246,6 +249,7 @@ 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;
}