-rw-r--r-- | libopie/pim/otodoaccessxml.cpp | 27 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessxml.cpp | 27 |
2 files changed, 40 insertions, 14 deletions
diff --git a/libopie/pim/otodoaccessxml.cpp b/libopie/pim/otodoaccessxml.cpp index 71b6a7e..a8e1503 100644 --- a/libopie/pim/otodoaccessxml.cpp +++ b/libopie/pim/otodoaccessxml.cpp | |||
@@ -2,32 +2,33 @@ | |||
2 | #include <fcntl.h> | 2 | #include <fcntl.h> |
3 | 3 | ||
4 | #include <sys/mman.h> | 4 | #include <sys/mman.h> |
5 | #include <sys/stat.h> | 5 | #include <sys/stat.h> |
6 | #include <sys/types.h> | 6 | #include <sys/types.h> |
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 "otimezone.h" | 19 | #include "otimezone.h" |
19 | #include "orecur.h" | 20 | #include "orecur.h" |
20 | #include "otodoaccessxml.h" | 21 | #include "otodoaccessxml.h" |
21 | 22 | ||
22 | namespace { | 23 | namespace { |
23 | time_t rp_end; | 24 | time_t rp_end; |
24 | ORecur* rec; | 25 | ORecur* rec; |
25 | ORecur *recur() { | 26 | ORecur *recur() { |
26 | if (!rec ) rec = new ORecur; | 27 | if (!rec ) rec = new ORecur; |
27 | return rec; | 28 | return rec; |
28 | } | 29 | } |
29 | int snd; | 30 | int snd; |
30 | enum MoreAttributes { | 31 | enum MoreAttributes { |
31 | FRType = OTodo::CompletedDate + 2, | 32 | FRType = OTodo::CompletedDate + 2, |
32 | FRWeekdays, | 33 | FRWeekdays, |
33 | FRPosition, | 34 | FRPosition, |
@@ -85,45 +86,46 @@ bool OTodoAccessXML::load() { | |||
85 | * UPDATE dict if you change anything!!! | 86 | * UPDATE dict if you change anything!!! |
86 | */ | 87 | */ |
87 | QAsciiDict<int> dict(21); | 88 | QAsciiDict<int> dict(21); |
88 | dict.setAutoDelete( TRUE ); | 89 | dict.setAutoDelete( TRUE ); |
89 | dict.insert("Categories" , new int(OTodo::Category) ); | 90 | dict.insert("Categories" , new int(OTodo::Category) ); |
90 | dict.insert("Uid" , new int(OTodo::Uid) ); | 91 | dict.insert("Uid" , new int(OTodo::Uid) ); |
91 | dict.insert("HasDate" , new int(OTodo::HasDate) ); | 92 | dict.insert("HasDate" , new int(OTodo::HasDate) ); |
92 | dict.insert("Completed" , new int(OTodo::Completed) ); | 93 | dict.insert("Completed" , new int(OTodo::Completed) ); |
93 | dict.insert("Description" , new int(OTodo::Description) ); | 94 | dict.insert("Description" , new int(OTodo::Description) ); |
94 | dict.insert("Summary" , new int(OTodo::Summary) ); | 95 | dict.insert("Summary" , new int(OTodo::Summary) ); |
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) ); |
107 | dict.insert("rtype", new int(FRType) ); | 109 | dict.insert("rtype", new int(FRType) ); |
108 | dict.insert("rweekdays", new int(FRWeekdays) ); | 110 | dict.insert("rweekdays", new int(FRWeekdays) ); |
109 | dict.insert("rposition", new int(FRPosition) ); | 111 | dict.insert("rposition", new int(FRPosition) ); |
110 | dict.insert("rfreq", new int(FRFreq) ); | 112 | dict.insert("rfreq", new int(FRFreq) ); |
111 | dict.insert("start", new int(FRStart) ); | 113 | dict.insert("start", new int(FRStart) ); |
112 | dict.insert("rhasenddate", new int(FRHasEndDate) ); | 114 | dict.insert("rhasenddate", new int(FRHasEndDate) ); |
113 | dict.insert("enddt", new int(FREndDate) ); | 115 | dict.insert("enddt", new int(FREndDate) ); |
114 | 116 | ||
115 | // here the custom XML parser from TT it's GPL | 117 | // here the custom XML parser from TT it's GPL |
116 | // but we want to push OpiePIM... to TT..... | 118 | // but we want to push OpiePIM... to TT..... |
117 | // mmap part from zecke :) | 119 | // mmap part from zecke :) |
118 | int fd = ::open( QFile::encodeName(m_file).data(), O_RDONLY ); | 120 | int fd = ::open( QFile::encodeName(m_file).data(), O_RDONLY ); |
119 | struct stat attribut; | 121 | struct stat attribut; |
120 | if ( fd < 0 ) return false; | 122 | if ( fd < 0 ) return false; |
121 | 123 | ||
122 | if ( fstat(fd, &attribut ) == -1 ) { | 124 | if ( fstat(fd, &attribut ) == -1 ) { |
123 | ::close( fd ); | 125 | ::close( fd ); |
124 | return false; | 126 | return false; |
125 | } | 127 | } |
126 | void* map_addr = ::mmap(NULL, attribut.st_size, PROT_READ, MAP_SHARED, fd, 0 ); | 128 | void* map_addr = ::mmap(NULL, attribut.st_size, PROT_READ, MAP_SHARED, fd, 0 ); |
127 | if ( map_addr == ( (caddr_t)-1) ) { | 129 | if ( map_addr == ( (caddr_t)-1) ) { |
128 | ::close(fd ); | 130 | ::close(fd ); |
129 | return false; | 131 | return false; |
@@ -401,32 +403,38 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev, | |||
401 | break; | 403 | break; |
402 | case OTodo::Priority: | 404 | case OTodo::Priority: |
403 | ev.setPriority( val.toInt() ); | 405 | ev.setPriority( val.toInt() ); |
404 | break; | 406 | break; |
405 | case OTodo::DateDay: | 407 | case OTodo::DateDay: |
406 | m_day = val.toInt(); | 408 | m_day = val.toInt(); |
407 | break; | 409 | break; |
408 | case OTodo::DateMonth: | 410 | case OTodo::DateMonth: |
409 | m_month = val.toInt(); | 411 | m_month = val.toInt(); |
410 | break; | 412 | break; |
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 |
423 | */ | 431 | */ |
424 | QStringList refs = QStringList::split(';', val ); | 432 | QStringList refs = QStringList::split(';', val ); |
425 | QStringList::Iterator strIt; | 433 | QStringList::Iterator strIt; |
426 | for (strIt = refs.begin(); strIt != refs.end(); ++strIt ) { | 434 | for (strIt = refs.begin(); strIt != refs.end(); ++strIt ) { |
427 | int pos = (*strIt).find(','); | 435 | int pos = (*strIt).find(','); |
428 | if ( pos > -1 ) | 436 | if ( pos > -1 ) |
429 | ; // ev.addRelation( (*strIt).left(pos), (*strIt).mid(pos+1).toInt() ); | 437 | ; // ev.addRelation( (*strIt).left(pos), (*strIt).mid(pos+1).toInt() ); |
430 | 438 | ||
431 | } | 439 | } |
432 | break; | 440 | break; |
@@ -490,32 +498,37 @@ QString OTodoAccessXML::toString( const OTodo& ev )const { | |||
490 | /* FIXME Qtopia::Record this is currently not | 498 | /* FIXME Qtopia::Record this is currently not |
491 | * possible you can set custom fields | 499 | * possible you can set custom fields |
492 | * but don' iterate over the list | 500 | * but don' iterate over the list |
493 | * I may do #define private protected | 501 | * I may do #define private protected |
494 | * for this case - cough --zecke | 502 | * for this case - cough --zecke |
495 | */ | 503 | */ |
496 | /* | 504 | /* |
497 | QMap<QString, QString> extras = ev.extras(); | 505 | QMap<QString, QString> extras = ev.extras(); |
498 | QMap<QString, QString>::Iterator extIt; | 506 | QMap<QString, QString>::Iterator extIt; |
499 | for (extIt = extras.begin(); extIt != extras.end(); ++extIt ) | 507 | for (extIt = extras.begin(); extIt != extras.end(); ++extIt ) |
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 | } |
509 | QString OTodoAccessXML::toString( const QArray<int>& ints ) const { | 522 | QString OTodoAccessXML::toString( const QArray<int>& ints ) const { |
510 | return Qtopia::Record::idsToString( ints ); | 523 | return Qtopia::Record::idsToString( ints ); |
511 | } | 524 | } |
512 | 525 | ||
513 | /* internal class for sorting | 526 | /* internal class for sorting |
514 | * | 527 | * |
515 | * Inspired by todoxmlio.cpp from TT | 528 | * Inspired by todoxmlio.cpp from TT |
516 | */ | 529 | */ |
517 | 530 | ||
518 | struct OTodoXMLContainer { | 531 | struct OTodoXMLContainer { |
519 | OTodo todo; | 532 | OTodo todo; |
520 | }; | 533 | }; |
521 | 534 | ||
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 | |||
@@ -2,32 +2,33 @@ | |||
2 | #include <fcntl.h> | 2 | #include <fcntl.h> |
3 | 3 | ||
4 | #include <sys/mman.h> | 4 | #include <sys/mman.h> |
5 | #include <sys/stat.h> | 5 | #include <sys/stat.h> |
6 | #include <sys/types.h> | 6 | #include <sys/types.h> |
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 "otimezone.h" | 19 | #include "otimezone.h" |
19 | #include "orecur.h" | 20 | #include "orecur.h" |
20 | #include "otodoaccessxml.h" | 21 | #include "otodoaccessxml.h" |
21 | 22 | ||
22 | namespace { | 23 | namespace { |
23 | time_t rp_end; | 24 | time_t rp_end; |
24 | ORecur* rec; | 25 | ORecur* rec; |
25 | ORecur *recur() { | 26 | ORecur *recur() { |
26 | if (!rec ) rec = new ORecur; | 27 | if (!rec ) rec = new ORecur; |
27 | return rec; | 28 | return rec; |
28 | } | 29 | } |
29 | int snd; | 30 | int snd; |
30 | enum MoreAttributes { | 31 | enum MoreAttributes { |
31 | FRType = OTodo::CompletedDate + 2, | 32 | FRType = OTodo::CompletedDate + 2, |
32 | FRWeekdays, | 33 | FRWeekdays, |
33 | FRPosition, | 34 | FRPosition, |
@@ -85,45 +86,46 @@ bool OTodoAccessXML::load() { | |||
85 | * UPDATE dict if you change anything!!! | 86 | * UPDATE dict if you change anything!!! |
86 | */ | 87 | */ |
87 | QAsciiDict<int> dict(21); | 88 | QAsciiDict<int> dict(21); |
88 | dict.setAutoDelete( TRUE ); | 89 | dict.setAutoDelete( TRUE ); |
89 | dict.insert("Categories" , new int(OTodo::Category) ); | 90 | dict.insert("Categories" , new int(OTodo::Category) ); |
90 | dict.insert("Uid" , new int(OTodo::Uid) ); | 91 | dict.insert("Uid" , new int(OTodo::Uid) ); |
91 | dict.insert("HasDate" , new int(OTodo::HasDate) ); | 92 | dict.insert("HasDate" , new int(OTodo::HasDate) ); |
92 | dict.insert("Completed" , new int(OTodo::Completed) ); | 93 | dict.insert("Completed" , new int(OTodo::Completed) ); |
93 | dict.insert("Description" , new int(OTodo::Description) ); | 94 | dict.insert("Description" , new int(OTodo::Description) ); |
94 | dict.insert("Summary" , new int(OTodo::Summary) ); | 95 | dict.insert("Summary" , new int(OTodo::Summary) ); |
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) ); |
107 | dict.insert("rtype", new int(FRType) ); | 109 | dict.insert("rtype", new int(FRType) ); |
108 | dict.insert("rweekdays", new int(FRWeekdays) ); | 110 | dict.insert("rweekdays", new int(FRWeekdays) ); |
109 | dict.insert("rposition", new int(FRPosition) ); | 111 | dict.insert("rposition", new int(FRPosition) ); |
110 | dict.insert("rfreq", new int(FRFreq) ); | 112 | dict.insert("rfreq", new int(FRFreq) ); |
111 | dict.insert("start", new int(FRStart) ); | 113 | dict.insert("start", new int(FRStart) ); |
112 | dict.insert("rhasenddate", new int(FRHasEndDate) ); | 114 | dict.insert("rhasenddate", new int(FRHasEndDate) ); |
113 | dict.insert("enddt", new int(FREndDate) ); | 115 | dict.insert("enddt", new int(FREndDate) ); |
114 | 116 | ||
115 | // here the custom XML parser from TT it's GPL | 117 | // here the custom XML parser from TT it's GPL |
116 | // but we want to push OpiePIM... to TT..... | 118 | // but we want to push OpiePIM... to TT..... |
117 | // mmap part from zecke :) | 119 | // mmap part from zecke :) |
118 | int fd = ::open( QFile::encodeName(m_file).data(), O_RDONLY ); | 120 | int fd = ::open( QFile::encodeName(m_file).data(), O_RDONLY ); |
119 | struct stat attribut; | 121 | struct stat attribut; |
120 | if ( fd < 0 ) return false; | 122 | if ( fd < 0 ) return false; |
121 | 123 | ||
122 | if ( fstat(fd, &attribut ) == -1 ) { | 124 | if ( fstat(fd, &attribut ) == -1 ) { |
123 | ::close( fd ); | 125 | ::close( fd ); |
124 | return false; | 126 | return false; |
125 | } | 127 | } |
126 | void* map_addr = ::mmap(NULL, attribut.st_size, PROT_READ, MAP_SHARED, fd, 0 ); | 128 | void* map_addr = ::mmap(NULL, attribut.st_size, PROT_READ, MAP_SHARED, fd, 0 ); |
127 | if ( map_addr == ( (caddr_t)-1) ) { | 129 | if ( map_addr == ( (caddr_t)-1) ) { |
128 | ::close(fd ); | 130 | ::close(fd ); |
129 | return false; | 131 | return false; |
@@ -401,32 +403,38 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev, | |||
401 | break; | 403 | break; |
402 | case OTodo::Priority: | 404 | case OTodo::Priority: |
403 | ev.setPriority( val.toInt() ); | 405 | ev.setPriority( val.toInt() ); |
404 | break; | 406 | break; |
405 | case OTodo::DateDay: | 407 | case OTodo::DateDay: |
406 | m_day = val.toInt(); | 408 | m_day = val.toInt(); |
407 | break; | 409 | break; |
408 | case OTodo::DateMonth: | 410 | case OTodo::DateMonth: |
409 | m_month = val.toInt(); | 411 | m_month = val.toInt(); |
410 | break; | 412 | break; |
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 |
423 | */ | 431 | */ |
424 | QStringList refs = QStringList::split(';', val ); | 432 | QStringList refs = QStringList::split(';', val ); |
425 | QStringList::Iterator strIt; | 433 | QStringList::Iterator strIt; |
426 | for (strIt = refs.begin(); strIt != refs.end(); ++strIt ) { | 434 | for (strIt = refs.begin(); strIt != refs.end(); ++strIt ) { |
427 | int pos = (*strIt).find(','); | 435 | int pos = (*strIt).find(','); |
428 | if ( pos > -1 ) | 436 | if ( pos > -1 ) |
429 | ; // ev.addRelation( (*strIt).left(pos), (*strIt).mid(pos+1).toInt() ); | 437 | ; // ev.addRelation( (*strIt).left(pos), (*strIt).mid(pos+1).toInt() ); |
430 | 438 | ||
431 | } | 439 | } |
432 | break; | 440 | break; |
@@ -490,32 +498,37 @@ QString OTodoAccessXML::toString( const OTodo& ev )const { | |||
490 | /* FIXME Qtopia::Record this is currently not | 498 | /* FIXME Qtopia::Record this is currently not |
491 | * possible you can set custom fields | 499 | * possible you can set custom fields |
492 | * but don' iterate over the list | 500 | * but don' iterate over the list |
493 | * I may do #define private protected | 501 | * I may do #define private protected |
494 | * for this case - cough --zecke | 502 | * for this case - cough --zecke |
495 | */ | 503 | */ |
496 | /* | 504 | /* |
497 | QMap<QString, QString> extras = ev.extras(); | 505 | QMap<QString, QString> extras = ev.extras(); |
498 | QMap<QString, QString>::Iterator extIt; | 506 | QMap<QString, QString>::Iterator extIt; |
499 | for (extIt = extras.begin(); extIt != extras.end(); ++extIt ) | 507 | for (extIt = extras.begin(); extIt != extras.end(); ++extIt ) |
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 | } |
509 | QString OTodoAccessXML::toString( const QArray<int>& ints ) const { | 522 | QString OTodoAccessXML::toString( const QArray<int>& ints ) const { |
510 | return Qtopia::Record::idsToString( ints ); | 523 | return Qtopia::Record::idsToString( ints ); |
511 | } | 524 | } |
512 | 525 | ||
513 | /* internal class for sorting | 526 | /* internal class for sorting |
514 | * | 527 | * |
515 | * Inspired by todoxmlio.cpp from TT | 528 | * Inspired by todoxmlio.cpp from TT |
516 | */ | 529 | */ |
517 | 530 | ||
518 | struct OTodoXMLContainer { | 531 | struct OTodoXMLContainer { |
519 | OTodo todo; | 532 | OTodo todo; |
520 | }; | 533 | }; |
521 | 534 | ||