author | zecke <zecke> | 2002-06-16 16:34:10 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-06-16 16:34:10 (UTC) |
commit | 3b8192d0f5a41c40092af48df8abc39aa3d1c355 (patch) (unidiff) | |
tree | c1f5e0211a16bb4ceb2d78ec7a76e1bffdae088b /libopie/tododb.cpp | |
parent | 23c2d100ed9070d82f956cdcb7364f5627aa0600 (diff) | |
download | opie-3b8192d0f5a41c40092af48df8abc39aa3d1c355.zip opie-3b8192d0f5a41c40092af48df8abc39aa3d1c355.tar.gz opie-3b8192d0f5a41c40092af48df8abc39aa3d1c355.tar.bz2 |
implement progress
-rw-r--r-- | libopie/tododb.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libopie/tododb.cpp b/libopie/tododb.cpp index 6b10ec2..1e40c40 100644 --- a/libopie/tododb.cpp +++ b/libopie/tododb.cpp | |||
@@ -19,16 +19,17 @@ public: | |||
19 | XMLElement *tasks = new XMLElement( ); | 19 | XMLElement *tasks = new XMLElement( ); |
20 | tasks->setTagName("Tasks" ); | 20 | tasks->setTagName("Tasks" ); |
21 | for( QValueList<ToDoEvent>::ConstIterator it = m_todos.begin(); it != m_todos.end(); ++it ){ | 21 | for( QValueList<ToDoEvent>::ConstIterator it = m_todos.begin(); it != m_todos.end(); ++it ){ |
22 | XMLElement::AttributeMap map; | 22 | XMLElement::AttributeMap map; |
23 | XMLElement *task = new XMLElement(); | 23 | XMLElement *task = new XMLElement(); |
24 | map.insert( "Completed", QString::number((int)(*it).isCompleted() ) ); | 24 | map.insert( "Completed", QString::number((int)(*it).isCompleted() ) ); |
25 | map.insert( "HasDate", QString::number((int)(*it).hasDate() ) ); | 25 | map.insert( "HasDate", QString::number((int)(*it).hasDate() ) ); |
26 | map.insert( "Priority", QString::number( (*it).priority() ) ); | 26 | map.insert( "Priority", QString::number( (*it).priority() ) ); |
27 | map.insert( "Progress", QString::number( (*it).progress() ) ); | ||
27 | map.insert( "Summary", (*it).summary() ); | 28 | map.insert( "Summary", (*it).summary() ); |
28 | QArray<int> arrat = (*it).categories(); | 29 | QArray<int> arrat = (*it).categories(); |
29 | QString attr; | 30 | QString attr; |
30 | for(uint i=0; i < arrat.count(); i++ ){ | 31 | for(uint i=0; i < arrat.count(); i++ ){ |
31 | attr.append(QString::number(arrat[i])+";" ); | 32 | attr.append(QString::number(arrat[i])+";" ); |
32 | } | 33 | } |
33 | if(!attr.isEmpty() ) // remove the last ; | 34 | if(!attr.isEmpty() ) // remove the last ; |
34 | attr.remove(attr.length()-1, 1 ); | 35 | attr.remove(attr.length()-1, 1 ); |
@@ -77,16 +78,23 @@ public: | |||
77 | QString dummy; | 78 | QString dummy; |
78 | ToDoEvent event; | 79 | ToDoEvent event; |
79 | bool ok; | 80 | bool ok; |
80 | int dumInt; | 81 | int dumInt; |
81 | // completed | 82 | // completed |
82 | dummy = element->attribute("Completed" ); | 83 | dummy = element->attribute("Completed" ); |
83 | dumInt = dummy.toInt(&ok ); | 84 | dumInt = dummy.toInt(&ok ); |
84 | if(ok ) event.setCompleted( dumInt == 0 ? false : true ); | 85 | if(ok ) event.setCompleted( dumInt == 0 ? false : true ); |
86 | // progress | ||
87 | dummy = element->attribute("Progress" ); | ||
88 | { | ||
89 | ushort dumShort = dummy.toUShort(&ok); | ||
90 | event.setProgress( dumShort ); | ||
91 | |||
92 | } | ||
85 | // hasDate | 93 | // hasDate |
86 | dummy = element->attribute("HasDate" ); | 94 | dummy = element->attribute("HasDate" ); |
87 | dumInt = dummy.toInt(&ok ); | 95 | dumInt = dummy.toInt(&ok ); |
88 | if(ok ) event.setHasDate( dumInt == 0 ? false: true ); | 96 | if(ok ) event.setHasDate( dumInt == 0 ? false: true ); |
89 | // set the date | 97 | // set the date |
90 | bool hasDa = dumInt; | 98 | bool hasDa = dumInt; |
91 | if ( hasDa ) { //parse the date | 99 | if ( hasDa ) { //parse the date |
92 | int year, day, month = 0; | 100 | int year, day, month = 0; |