summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/otodoaccessxml.cpp27
-rw-r--r--libopie2/opiepim/backend/otodoaccessxml.cpp27
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
@@ -12,12 +12,13 @@
#include <qvector.h>
#include <qpe/global.h>
#include <qpe/stringutil.h>
#include <qpe/timeconversion.h>
+#include "oconversion.h"
#include "otimezone.h"
#include "orecur.h"
#include "otodoaccessxml.h"
namespace {
time_t rp_end;
@@ -95,25 +96,26 @@ bool OTodoAccessXML::load() {
dict.insert("Priority" , new int(OTodo::Priority) );
dict.insert("DateDay" , new int(OTodo::DateDay) );
dict.insert("DateMonth" , new int(OTodo::DateMonth) );
dict.insert("DateYear" , new int(OTodo::DateYear) );
dict.insert("Progress" , new int(OTodo::Progress) );
dict.insert("CompletedDate", new int(OTodo::CompletedDate) );
+ dict.insert("StartDate", new int(OTodo::StartDate) );
dict.insert("CrossReference", new int(OTodo::CrossReference) );
dict.insert("State", new int(OTodo::State) );
dict.insert("Alarms", new int(OTodo::Alarms) );
dict.insert("Reminders", new int(OTodo::Reminders) );
dict.insert("Notifiers", new int(OTodo::Notifiers) );
dict.insert("Maintainer", new int(OTodo::Maintainer) );
- dict.insert("rtype", new int(FRType) );
- dict.insert("rweekdays", new int(FRWeekdays) );
- dict.insert("rposition", new int(FRPosition) );
- dict.insert("rfreq", new int(FRFreq) );
- dict.insert("start", new int(FRStart) );
- dict.insert("rhasenddate", new int(FRHasEndDate) );
- dict.insert("enddt", new int(FREndDate) );
+ dict.insert("rtype", new int(FRType) );
+ dict.insert("rweekdays", new int(FRWeekdays) );
+ dict.insert("rposition", new int(FRPosition) );
+ dict.insert("rfreq", new int(FRFreq) );
+ dict.insert("start", new int(FRStart) );
+ dict.insert("rhasenddate", new int(FRHasEndDate) );
+ dict.insert("enddt", new int(FREndDate) );
// here the custom XML parser from TT it's GPL
// but we want to push OpiePIM... to TT.....
// mmap part from zecke :)
int fd = ::open( QFile::encodeName(m_file).data(), O_RDONLY );
struct stat attribut;
@@ -411,12 +413,18 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev,
case OTodo::DateYear:
m_year = val.toInt();
break;
case OTodo::Progress:
ev.setProgress( val.toInt() );
break;
+ case OTodo::CompletedDate:
+ ev.setCompletedDate( OConversion::dateFromString( val ) );
+ break;
+ case OTodo::StartDate:
+ ev.setStartDate( OConversion::dateFromString( val ) );
+ break;
case OTodo::CrossReference:
{
/*
* A cross refernce looks like
* appname,id;appname,id
* we need to split it up
@@ -500,12 +508,17 @@ QString OTodoAccessXML::toString( const OTodo& ev )const {
str += extIt.key() + "=\"" + extIt.data() + "\" ";
*/
// cross refernce
if ( ev.hasRecurrence() ) {
str += ev.recurrence().toString();
}
+ if ( ev.hasStartDate() )
+ str += "StartDate=\""+ OConversion::dateToString( ev.startDate() ) +"\" ";
+ if ( ev.hasCompletedDate() )
+ str += "CompletedDate=\""+ OConversion::dateToString( ev.completedDate() ) +"\" ";
+
return str;
}
QString OTodoAccessXML::toString( const QArray<int>& ints ) const {
return Qtopia::Record::idsToString( ints );
}
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 @@
#include <qvector.h>
#include <qpe/global.h>
#include <qpe/stringutil.h>
#include <qpe/timeconversion.h>
+#include "oconversion.h"
#include "otimezone.h"
#include "orecur.h"
#include "otodoaccessxml.h"
namespace {
time_t rp_end;
@@ -95,25 +96,26 @@ bool OTodoAccessXML::load() {
dict.insert("Priority" , new int(OTodo::Priority) );
dict.insert("DateDay" , new int(OTodo::DateDay) );
dict.insert("DateMonth" , new int(OTodo::DateMonth) );
dict.insert("DateYear" , new int(OTodo::DateYear) );
dict.insert("Progress" , new int(OTodo::Progress) );
dict.insert("CompletedDate", new int(OTodo::CompletedDate) );
+ dict.insert("StartDate", new int(OTodo::StartDate) );
dict.insert("CrossReference", new int(OTodo::CrossReference) );
dict.insert("State", new int(OTodo::State) );
dict.insert("Alarms", new int(OTodo::Alarms) );
dict.insert("Reminders", new int(OTodo::Reminders) );
dict.insert("Notifiers", new int(OTodo::Notifiers) );
dict.insert("Maintainer", new int(OTodo::Maintainer) );
- dict.insert("rtype", new int(FRType) );
- dict.insert("rweekdays", new int(FRWeekdays) );
- dict.insert("rposition", new int(FRPosition) );
- dict.insert("rfreq", new int(FRFreq) );
- dict.insert("start", new int(FRStart) );
- dict.insert("rhasenddate", new int(FRHasEndDate) );
- dict.insert("enddt", new int(FREndDate) );
+ dict.insert("rtype", new int(FRType) );
+ dict.insert("rweekdays", new int(FRWeekdays) );
+ dict.insert("rposition", new int(FRPosition) );
+ dict.insert("rfreq", new int(FRFreq) );
+ dict.insert("start", new int(FRStart) );
+ dict.insert("rhasenddate", new int(FRHasEndDate) );
+ dict.insert("enddt", new int(FREndDate) );
// here the custom XML parser from TT it's GPL
// but we want to push OpiePIM... to TT.....
// mmap part from zecke :)
int fd = ::open( QFile::encodeName(m_file).data(), O_RDONLY );
struct stat attribut;
@@ -411,12 +413,18 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev,
case OTodo::DateYear:
m_year = val.toInt();
break;
case OTodo::Progress:
ev.setProgress( val.toInt() );
break;
+ case OTodo::CompletedDate:
+ ev.setCompletedDate( OConversion::dateFromString( val ) );
+ break;
+ case OTodo::StartDate:
+ ev.setStartDate( OConversion::dateFromString( val ) );
+ break;
case OTodo::CrossReference:
{
/*
* A cross refernce looks like
* appname,id;appname,id
* we need to split it up
@@ -500,12 +508,17 @@ QString OTodoAccessXML::toString( const OTodo& ev )const {
str += extIt.key() + "=\"" + extIt.data() + "\" ";
*/
// cross refernce
if ( ev.hasRecurrence() ) {
str += ev.recurrence().toString();
}
+ if ( ev.hasStartDate() )
+ str += "StartDate=\""+ OConversion::dateToString( ev.startDate() ) +"\" ";
+ if ( ev.hasCompletedDate() )
+ str += "CompletedDate=\""+ OConversion::dateToString( ev.completedDate() ) +"\" ";
+
return str;
}
QString OTodoAccessXML::toString( const QArray<int>& ints ) const {
return Qtopia::Record::idsToString( ints );
}