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/xmlparser.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/xmlparser.cc') diff --git a/src/xmlparser.cc b/src/xmlparser.cc index 112ea00..a362f95 100644 --- a/src/xmlparser.cc +++ b/src/xmlparser.cc @@ -31,8 +31,6 @@ #include "xml_encode_decode.h" -#define NOID 0xffffffff - XmlParser::XmlParser(TaskTree *t) : tree(t) { } @@ -48,6 +46,10 @@ void XmlParser::characterData(const std::string &data) void XmlParser::startTag(std::string name, attributes_t &attr) { + if(name == "tasktree") { + tree->nextid = atoi(xml_decode(attr["nextid"]).c_str()); + } + if(name == "task") { taskid_t id = atoi(xml_decode(attr["id"]).c_str()); @@ -74,7 +76,7 @@ void XmlParser::endTag(std::string name) parents.pop(); } - if (name == "title") { + if(name == "title") { node->data.title = cdata; } } -- cgit v1.2.3