-rw-r--r-- | libopie/tododb.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie/tododb.cpp b/libopie/tododb.cpp index 33fa177..fe8b8bf 100644 --- a/libopie/tododb.cpp +++ b/libopie/tododb.cpp | |||
@@ -1,32 +1,34 @@ | |||
1 | 1 | ||
2 | #include <qdir.h> | 2 | #include <qdir.h> |
3 | #include <opie/tododb.h> | 3 | #include <opie/tododb.h> |
4 | #include <opie/xmltree.h> | 4 | #include <opie/xmltree.h> |
5 | #include <opie/todoresource.h> | 5 | #include <opie/todoresource.h> |
6 | #include <qpe/palmtoprecord.h> | 6 | #include <qpe/palmtoprecord.h> |
7 | #include <qpe/global.h> | 7 | #include <qpe/global.h> |
8 | 8 | ||
9 | using namespace Opie; | ||
10 | |||
9 | namespace { | 11 | namespace { |
10 | 12 | ||
11 | class FileToDoResource : public ToDoResource { | 13 | class FileToDoResource : public ToDoResource { |
12 | public: | 14 | public: |
13 | FileToDoResource() {}; | 15 | FileToDoResource() {}; |
14 | bool save(const QString &name, const QValueList<ToDoEvent> &m_todos ){ | 16 | bool save(const QString &name, const QValueList<ToDoEvent> &m_todos ){ |
15 | // prepare the XML | 17 | // prepare the XML |
16 | XMLElement *tasks = new XMLElement( ); | 18 | XMLElement *tasks = new XMLElement( ); |
17 | tasks->setTagName("Tasks" ); | 19 | tasks->setTagName("Tasks" ); |
18 | for( QValueList<ToDoEvent>::ConstIterator it = m_todos.begin(); it != m_todos.end(); ++it ){ | 20 | for( QValueList<ToDoEvent>::ConstIterator it = m_todos.begin(); it != m_todos.end(); ++it ){ |
19 | XMLElement::AttributeMap map; | 21 | XMLElement::AttributeMap map; |
20 | XMLElement *task = new XMLElement(); | 22 | XMLElement *task = new XMLElement(); |
21 | map.insert( "Completed", QString::number((int)(*it).isCompleted() ) ); | 23 | map.insert( "Completed", QString::number((int)(*it).isCompleted() ) ); |
22 | map.insert( "HasDate", QString::number((int)(*it).hasDate() ) ); | 24 | map.insert( "HasDate", QString::number((int)(*it).hasDate() ) ); |
23 | map.insert( "Priority", QString::number( (*it).priority() ) ); | 25 | map.insert( "Priority", QString::number( (*it).priority() ) ); |
24 | QArray<int> arrat = (*it).categories(); | 26 | QArray<int> arrat = (*it).categories(); |
25 | QString attr; | 27 | QString attr; |
26 | for(uint i=0; i < arrat.count(); i++ ){ | 28 | for(uint i=0; i < arrat.count(); i++ ){ |
27 | attr.append(QString::number(arrat[i])+";" ); | 29 | attr.append(QString::number(arrat[i])+";" ); |
28 | } | 30 | } |
29 | if(!attr.isEmpty() ) // remove the last ; | 31 | if(!attr.isEmpty() ) // remove the last ; |
30 | attr.remove(attr.length()-1, 1 ); | 32 | attr.remove(attr.length()-1, 1 ); |
31 | map.insert( "Categories", attr ); | 33 | map.insert( "Categories", attr ); |
32 | //else | 34 | //else |