author | zecke <zecke> | 2003-05-07 18:10:56 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-05-07 18:10:56 (UTC) |
commit | 3cee83b6e2931768fb0d0989b2235800914888a7 (patch) (unidiff) | |
tree | d99a7565fdb5be62cf739d82ec5de50c2bbf95e9 /libopie2 | |
parent | 94371938792c70a40cdb75e37c69020438d450c9 (diff) | |
download | opie-3cee83b6e2931768fb0d0989b2235800914888a7.zip opie-3cee83b6e2931768fb0d0989b2235800914888a7.tar.gz opie-3cee83b6e2931768fb0d0989b2235800914888a7.tar.bz2 |
save the state
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessxml.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libopie2/opiepim/backend/otodoaccessxml.cpp b/libopie2/opiepim/backend/otodoaccessxml.cpp index a8e1503..285d2b8 100644 --- a/libopie2/opiepim/backend/otodoaccessxml.cpp +++ b/libopie2/opiepim/backend/otodoaccessxml.cpp | |||
@@ -7,24 +7,25 @@ | |||
7 | 7 | ||
8 | #include <unistd.h> | 8 | #include <unistd.h> |
9 | 9 | ||
10 | 10 | ||
11 | #include <qfile.h> | 11 | #include <qfile.h> |
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 "oconversion.h" |
19 | #include "opimstate.h" | ||
19 | #include "otimezone.h" | 20 | #include "otimezone.h" |
20 | #include "orecur.h" | 21 | #include "orecur.h" |
21 | #include "otodoaccessxml.h" | 22 | #include "otodoaccessxml.h" |
22 | 23 | ||
23 | namespace { | 24 | namespace { |
24 | time_t rp_end; | 25 | time_t rp_end; |
25 | ORecur* rec; | 26 | ORecur* rec; |
26 | ORecur *recur() { | 27 | ORecur *recur() { |
27 | if (!rec ) rec = new ORecur; | 28 | if (!rec ) rec = new ORecur; |
28 | return rec; | 29 | return rec; |
29 | } | 30 | } |
30 | int snd; | 31 | int snd; |
@@ -413,24 +414,27 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev, | |||
413 | case OTodo::DateYear: | 414 | case OTodo::DateYear: |
414 | m_year = val.toInt(); | 415 | m_year = val.toInt(); |
415 | break; | 416 | break; |
416 | case OTodo::Progress: | 417 | case OTodo::Progress: |
417 | ev.setProgress( val.toInt() ); | 418 | ev.setProgress( val.toInt() ); |
418 | break; | 419 | break; |
419 | case OTodo::CompletedDate: | 420 | case OTodo::CompletedDate: |
420 | ev.setCompletedDate( OConversion::dateFromString( val ) ); | 421 | ev.setCompletedDate( OConversion::dateFromString( val ) ); |
421 | break; | 422 | break; |
422 | case OTodo::StartDate: | 423 | case OTodo::StartDate: |
423 | ev.setStartDate( OConversion::dateFromString( val ) ); | 424 | ev.setStartDate( OConversion::dateFromString( val ) ); |
424 | break; | 425 | break; |
426 | case OTodo::State: | ||
427 | ev.setState( val.toInt() ); | ||
428 | break; | ||
425 | case OTodo::CrossReference: | 429 | case OTodo::CrossReference: |
426 | { | 430 | { |
427 | /* | 431 | /* |
428 | * A cross refernce looks like | 432 | * A cross refernce looks like |
429 | * appname,id;appname,id | 433 | * appname,id;appname,id |
430 | * we need to split it up | 434 | * we need to split it up |
431 | */ | 435 | */ |
432 | QStringList refs = QStringList::split(';', val ); | 436 | QStringList refs = QStringList::split(';', val ); |
433 | QStringList::Iterator strIt; | 437 | QStringList::Iterator strIt; |
434 | for (strIt = refs.begin(); strIt != refs.end(); ++strIt ) { | 438 | for (strIt = refs.begin(); strIt != refs.end(); ++strIt ) { |
435 | int pos = (*strIt).find(','); | 439 | int pos = (*strIt).find(','); |
436 | if ( pos > -1 ) | 440 | if ( pos > -1 ) |
@@ -506,24 +510,26 @@ QString OTodoAccessXML::toString( const OTodo& ev )const { | |||
506 | QMap<QString, QString>::Iterator extIt; | 510 | QMap<QString, QString>::Iterator extIt; |
507 | for (extIt = extras.begin(); extIt != extras.end(); ++extIt ) | 511 | for (extIt = extras.begin(); extIt != extras.end(); ++extIt ) |
508 | str += extIt.key() + "=\"" + extIt.data() + "\" "; | 512 | str += extIt.key() + "=\"" + extIt.data() + "\" "; |
509 | */ | 513 | */ |
510 | // cross refernce | 514 | // cross refernce |
511 | if ( ev.hasRecurrence() ) { | 515 | if ( ev.hasRecurrence() ) { |
512 | str += ev.recurrence().toString(); | 516 | str += ev.recurrence().toString(); |
513 | } | 517 | } |
514 | if ( ev.hasStartDate() ) | 518 | if ( ev.hasStartDate() ) |
515 | str += "StartDate=\""+ OConversion::dateToString( ev.startDate() ) +"\" "; | 519 | str += "StartDate=\""+ OConversion::dateToString( ev.startDate() ) +"\" "; |
516 | if ( ev.hasCompletedDate() ) | 520 | if ( ev.hasCompletedDate() ) |
517 | str += "CompletedDate=\""+ OConversion::dateToString( ev.completedDate() ) +"\" "; | 521 | str += "CompletedDate=\""+ OConversion::dateToString( ev.completedDate() ) +"\" "; |
522 | if ( ev.hasState() ) | ||
523 | str += "State=\""+QString::number( ev.state().state() )+"\" "; | ||
518 | 524 | ||
519 | 525 | ||
520 | return str; | 526 | return str; |
521 | } | 527 | } |
522 | QString OTodoAccessXML::toString( const QArray<int>& ints ) const { | 528 | QString OTodoAccessXML::toString( const QArray<int>& ints ) const { |
523 | return Qtopia::Record::idsToString( ints ); | 529 | return Qtopia::Record::idsToString( ints ); |
524 | } | 530 | } |
525 | 531 | ||
526 | /* internal class for sorting | 532 | /* internal class for sorting |
527 | * | 533 | * |
528 | * Inspired by todoxmlio.cpp from TT | 534 | * Inspired by todoxmlio.cpp from TT |
529 | */ | 535 | */ |