From dc52e1c5bac15f8c946e6ffac75d12a9e2e2780d Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 17 May 2012 13:26:51 +0200 Subject: Move createId() method to TaskTree. Store nextid in xml. Clean up XmlParser a bit. --- src/tasktree.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/tasktree.cc') diff --git a/src/tasktree.cc b/src/tasktree.cc index ee181eb..e2e2bf6 100644 --- a/src/tasktree.cc +++ b/src/tasktree.cc @@ -70,12 +70,17 @@ static void concatTaskIdLists(TaskIdList& pre, TaskIdList& post) { TaskTree::TaskTree() { root = NULL; + nextid = 10; } TaskTree::~TaskTree() { // cleanup tree } +taskid_t TaskTree::createId() { + return nextid++; +} + static taskid_t rootid = -1; TaskIdList TaskTree::insertAsChild(taskid_t parentid, taskid_t id, task_t data) @@ -329,7 +334,7 @@ std::string TaskTree::toXML() std::string xml; xml += "\n"; - xml += "\n"; + xml += "\n"; xml += root->toXML(" "); xml += ""; -- cgit v1.2.3