-rw-r--r-- | libopie/tododb.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libopie/tododb.cpp b/libopie/tododb.cpp index fe8b8bf..6b10ec2 100644 --- a/libopie/tododb.cpp +++ b/libopie/tododb.cpp | |||
@@ -13,6 +13,7 @@ namespace { | |||
13 | class FileToDoResource : public ToDoResource { | 13 | class FileToDoResource : public ToDoResource { |
14 | public: | 14 | public: |
15 | FileToDoResource() {}; | 15 | FileToDoResource() {}; |
16 | // FIXME better parsing | ||
16 | bool save(const QString &name, const QValueList<ToDoEvent> &m_todos ){ | 17 | bool save(const QString &name, const QValueList<ToDoEvent> &m_todos ){ |
17 | // prepare the XML | 18 | // prepare the XML |
18 | XMLElement *tasks = new XMLElement( ); | 19 | XMLElement *tasks = new XMLElement( ); |
@@ -23,6 +24,7 @@ public: | |||
23 | map.insert( "Completed", QString::number((int)(*it).isCompleted() ) ); | 24 | map.insert( "Completed", QString::number((int)(*it).isCompleted() ) ); |
24 | map.insert( "HasDate", QString::number((int)(*it).hasDate() ) ); | 25 | map.insert( "HasDate", QString::number((int)(*it).hasDate() ) ); |
25 | map.insert( "Priority", QString::number( (*it).priority() ) ); | 26 | map.insert( "Priority", QString::number( (*it).priority() ) ); |
27 | map.insert( "Summary", (*it).summary() ); | ||
26 | QArray<int> arrat = (*it).categories(); | 28 | QArray<int> arrat = (*it).categories(); |
27 | QString attr; | 29 | QString attr; |
28 | for(uint i=0; i < arrat.count(); i++ ){ | 30 | for(uint i=0; i < arrat.count(); i++ ){ |
@@ -111,11 +113,13 @@ public: | |||
111 | //description | 113 | //description |
112 | dummy = element->attribute("Description" ); | 114 | dummy = element->attribute("Description" ); |
113 | event.setDescription( dummy ); | 115 | event.setDescription( dummy ); |
116 | dummy = element->attribute("Summary" ); | ||
117 | event.setSummary( dummy ); | ||
114 | // category | 118 | // category |
115 | dummy = element->attribute("Categories" ); | 119 | dummy = element->attribute("Categories" ); |
116 | QStringList ids = QStringList::split(";", dummy ); | 120 | QStringList ids = QStringList::split(";", dummy ); |
117 | event.setCategories( ids ); | 121 | event.setCategories( ids ); |
118 | 122 | ||
119 | //uid | 123 | //uid |
120 | dummy = element->attribute("Uid" ); | 124 | dummy = element->attribute("Uid" ); |
121 | dumInt = dummy.toInt(&ok ); | 125 | dumInt = dummy.toInt(&ok ); |
@@ -181,7 +185,7 @@ QValueList<ToDoEvent> ToDoDB::effectiveToDos(const QDate &from, | |||
181 | QValueList<ToDoEvent> ToDoDB::overDue() | 185 | QValueList<ToDoEvent> ToDoDB::overDue() |
182 | { | 186 | { |
183 | QValueList<ToDoEvent> events; | 187 | QValueList<ToDoEvent> events; |
184 | for( QValueList<ToDoEvent>::Iterator it = m_todos.begin(); it!= m_todos.end(); ++it ){ | 188 | for( QValueList<ToDoEvent>::Iterator it = m_todos.begin(); it!= m_todos.end(); ++it ){ |
185 | if( (*it).isOverdue() ) | 189 | if( (*it).isOverdue() ) |
186 | events.append((*it) ); | 190 | events.append((*it) ); |
187 | } | 191 | } |
@@ -238,7 +242,7 @@ QString ToDoDB::fileName()const | |||
238 | } | 242 | } |
239 | void ToDoDB::load() | 243 | void ToDoDB::load() |
240 | { | 244 | { |
241 | m_todos = m_res->load( m_fileName ); | 245 | m_todos = m_res->load( m_fileName ); |
242 | } | 246 | } |
243 | bool ToDoDB::save() | 247 | bool ToDoDB::save() |
244 | { | 248 | { |