summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
index 39c43c5..929d004 100644
--- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
+++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp
@@ -76,14 +76,16 @@ namespace {
76 FREndDate, 76 FREndDate,
77 FRStart, 77 FRStart,
78 FREnd, 78 FREnd,
79 FNote, 79 FNote,
80 FCreated, 80 FCreated, // Should't this be called FRCreated ?
81 FTimeZone, 81 FTimeZone,
82 FRecParent, 82 FRecParent,
83 FRecChildren, 83 FRecChildren,
84 FExceptions 84 FExceptions
85 }; 85 };
86
87 // FIXME: Use OEvent::toMap() here !! (eilers)
86 inline void save( const OEvent& ev, QString& buf ) { 88 inline void save( const OEvent& ev, QString& buf ) {
87 qWarning("Saving %d %s", ev.uid(), ev.description().latin1() ); 89 qWarning("Saving %d %s", ev.uid(), ev.description().latin1() );
88 buf += " description=\"" + Qtopia::escapeString(ev.description() ) + "\""; 90 buf += " description=\"" + Qtopia::escapeString(ev.description() ) + "\"";
89 if (!ev.location().isEmpty() ) 91 if (!ev.location().isEmpty() )
@@ -274,9 +276,9 @@ bool ODateBookAccessBackend_XML::remove( int uid ) {
274 276
275 return true; 277 return true;
276} 278}
277bool ODateBookAccessBackend_XML::replace( const OEvent& ev ) { 279bool ODateBookAccessBackend_XML::replace( const OEvent& ev ) {
278 replace( ev.uid() ); 280 replace( ev.uid() ); // ??? Shouldn't this be "remove( ev.uid() ) ??? (eilers)
279 return add( ev ); 281 return add( ev );
280} 282}
281QArray<int> ODateBookAccessBackend_XML::rawEvents()const { 283QArray<int> ODateBookAccessBackend_XML::rawEvents()const {
282 return allRecords(); 284 return allRecords();
@@ -320,8 +322,10 @@ OEvent::ValueList ODateBookAccessBackend_XML::directRawRepeats() {
320 list.append( it.data() ); 322 list.append( it.data() );
321 323
322 return list; 324 return list;
323} 325}
326
327// FIXME: Use OEvent::fromMap() (eilers)
324bool ODateBookAccessBackend_XML::loadFile() { 328bool ODateBookAccessBackend_XML::loadFile() {
325 m_changed = false; 329 m_changed = false;
326 330
327 int fd = ::open( QFile::encodeName(m_name).data(), O_RDONLY ); 331 int fd = ::open( QFile::encodeName(m_name).data(), O_RDONLY );
@@ -358,9 +362,9 @@ bool ODateBookAccessBackend_XML::loadFile() {
358 dict.insert( "enddt", new int(FREndDate) ); 362 dict.insert( "enddt", new int(FREndDate) );
359 dict.insert( "start", new int(FRStart) ); 363 dict.insert( "start", new int(FRStart) );
360 dict.insert( "end", new int(FREnd) ); 364 dict.insert( "end", new int(FREnd) );
361 dict.insert( "note", new int(FNote) ); 365 dict.insert( "note", new int(FNote) );
362 dict.insert( "created", new int(FCreated) ); 366 dict.insert( "created", new int(FCreated) ); // Shouldn't this be FRCreated ??
363 dict.insert( "recparent", new int(FRecParent) ); 367 dict.insert( "recparent", new int(FRecParent) );
364 dict.insert( "recchildren", new int(FRecChildren) ); 368 dict.insert( "recchildren", new int(FRecChildren) );
365 dict.insert( "exceptions", new int(FExceptions) ); 369 dict.insert( "exceptions", new int(FExceptions) );
366 dict.insert( "timezone", new int(FTimeZone) ); 370 dict.insert( "timezone", new int(FTimeZone) );
@@ -443,8 +447,10 @@ bool ODateBookAccessBackend_XML::loadFile() {
443 m_changed = false; // changed during add 447 m_changed = false; // changed during add
444 448
445 return true; 449 return true;
446} 450}
451
452// FIXME: Use OEvent::fromMap() which makes this obsolete.. (eilers)
447void ODateBookAccessBackend_XML::finalizeRecord( OEvent& ev ) { 453void ODateBookAccessBackend_XML::finalizeRecord( OEvent& ev ) {
448 /* AllDay is alway in UTC */ 454 /* AllDay is alway in UTC */
449 if ( ev.isAllDay() ) { 455 if ( ev.isAllDay() ) {
450 OTimeZone utc = OTimeZone::utc(); 456 OTimeZone utc = OTimeZone::utc();