summaryrefslogtreecommitdiff
path: root/libopie2
authorzecke <zecke>2003-05-07 18:02:46 (UTC)
committer zecke <zecke>2003-05-07 18:02:46 (UTC)
commit94371938792c70a40cdb75e37c69020438d450c9 (patch) (unidiff)
tree10b97f156e1b4eee2ec1706e315a87a16b0af3b9 /libopie2
parentc13ada0f5e418b25b177e132ff2e1dfe7821577f (diff)
downloadopie-94371938792c70a40cdb75e37c69020438d450c9.zip
opie-94371938792c70a40cdb75e37c69020438d450c9.tar.gz
opie-94371938792c70a40cdb75e37c69020438d450c9.tar.bz2
save and restore CompletedDate and StartDate
Diffstat (limited to 'libopie2') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/backend/otodoaccessxml.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/otodoaccessxml.cpp b/libopie2/opiepim/backend/otodoaccessxml.cpp
index 71b6a7e..a8e1503 100644
--- a/libopie2/opiepim/backend/otodoaccessxml.cpp
+++ b/libopie2/opiepim/backend/otodoaccessxml.cpp
@@ -12,12 +12,13 @@
12#include <qvector.h> 12#include <qvector.h>
13 13
14#include <qpe/global.h> 14#include <qpe/global.h>
15#include <qpe/stringutil.h> 15#include <qpe/stringutil.h>
16#include <qpe/timeconversion.h> 16#include <qpe/timeconversion.h>
17 17
18#include "oconversion.h"
18#include "otimezone.h" 19#include "otimezone.h"
19#include "orecur.h" 20#include "orecur.h"
20#include "otodoaccessxml.h" 21#include "otodoaccessxml.h"
21 22
22namespace { 23namespace {
23 time_t rp_end; 24 time_t rp_end;
@@ -95,12 +96,13 @@ bool OTodoAccessXML::load() {
95 dict.insert("Priority" , new int(OTodo::Priority) ); 96 dict.insert("Priority" , new int(OTodo::Priority) );
96 dict.insert("DateDay" , new int(OTodo::DateDay) ); 97 dict.insert("DateDay" , new int(OTodo::DateDay) );
97 dict.insert("DateMonth" , new int(OTodo::DateMonth) ); 98 dict.insert("DateMonth" , new int(OTodo::DateMonth) );
98 dict.insert("DateYear" , new int(OTodo::DateYear) ); 99 dict.insert("DateYear" , new int(OTodo::DateYear) );
99 dict.insert("Progress" , new int(OTodo::Progress) ); 100 dict.insert("Progress" , new int(OTodo::Progress) );
100 dict.insert("CompletedDate", new int(OTodo::CompletedDate) ); 101 dict.insert("CompletedDate", new int(OTodo::CompletedDate) );
102 dict.insert("StartDate", new int(OTodo::StartDate) );
101 dict.insert("CrossReference", new int(OTodo::CrossReference) ); 103 dict.insert("CrossReference", new int(OTodo::CrossReference) );
102 dict.insert("State", new int(OTodo::State) ); 104 dict.insert("State", new int(OTodo::State) );
103 dict.insert("Alarms", new int(OTodo::Alarms) ); 105 dict.insert("Alarms", new int(OTodo::Alarms) );
104 dict.insert("Reminders", new int(OTodo::Reminders) ); 106 dict.insert("Reminders", new int(OTodo::Reminders) );
105 dict.insert("Notifiers", new int(OTodo::Notifiers) ); 107 dict.insert("Notifiers", new int(OTodo::Notifiers) );
106 dict.insert("Maintainer", new int(OTodo::Maintainer) ); 108 dict.insert("Maintainer", new int(OTodo::Maintainer) );
@@ -411,12 +413,18 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev,
411 case OTodo::DateYear: 413 case OTodo::DateYear:
412 m_year = val.toInt(); 414 m_year = val.toInt();
413 break; 415 break;
414 case OTodo::Progress: 416 case OTodo::Progress:
415 ev.setProgress( val.toInt() ); 417 ev.setProgress( val.toInt() );
416 break; 418 break;
419 case OTodo::CompletedDate:
420 ev.setCompletedDate( OConversion::dateFromString( val ) );
421 break;
422 case OTodo::StartDate:
423 ev.setStartDate( OConversion::dateFromString( val ) );
424 break;
417 case OTodo::CrossReference: 425 case OTodo::CrossReference:
418 { 426 {
419 /* 427 /*
420 * A cross refernce looks like 428 * A cross refernce looks like
421 * appname,id;appname,id 429 * appname,id;appname,id
422 * we need to split it up 430 * we need to split it up
@@ -500,12 +508,17 @@ QString OTodoAccessXML::toString( const OTodo& ev )const {
500 str += extIt.key() + "=\"" + extIt.data() + "\" "; 508 str += extIt.key() + "=\"" + extIt.data() + "\" ";
501 */ 509 */
502 // cross refernce 510 // cross refernce
503 if ( ev.hasRecurrence() ) { 511 if ( ev.hasRecurrence() ) {
504 str += ev.recurrence().toString(); 512 str += ev.recurrence().toString();
505 } 513 }
514 if ( ev.hasStartDate() )
515 str += "StartDate=\""+ OConversion::dateToString( ev.startDate() ) +"\" ";
516 if ( ev.hasCompletedDate() )
517 str += "CompletedDate=\""+ OConversion::dateToString( ev.completedDate() ) +"\" ";
518
506 519
507 return str; 520 return str;
508} 521}
509QString OTodoAccessXML::toString( const QArray<int>& ints ) const { 522QString OTodoAccessXML::toString( const QArray<int>& ints ) const {
510 return Qtopia::Record::idsToString( ints ); 523 return Qtopia::Record::idsToString( ints );
511} 524}