Diffstat (limited to 'libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp index 0ebda98..77c0253 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_xml.cpp | |||
@@ -48,4 +48,4 @@ | |||
48 | #include <opie2/opimnotifymanager.h> | 48 | #include <opie2/opimnotifymanager.h> |
49 | #include <opie2/orecur.h> | 49 | #include <opie2/opimrecurrence.h> |
50 | #include <opie2/otimezone.h> | 50 | #include <opie2/opimtimezone.h> |
51 | #include <opie2/odatebookaccessbackend_xml.h> | 51 | #include <opie2/odatebookaccessbackend_xml.h> |
@@ -83,6 +83,6 @@ namespace { | |||
83 | time_t start, end, created, rp_end; | 83 | time_t start, end, created, rp_end; |
84 | ORecur* rec; | 84 | OPimRecurrence* rec; |
85 | ORecur* recur() { | 85 | OPimRecurrence* recur() { |
86 | if (!rec) | 86 | if (!rec) |
87 | rec = new ORecur; | 87 | rec = new OPimRecurrence; |
88 | 88 | ||
@@ -116,4 +116,4 @@ namespace { | |||
116 | 116 | ||
117 | // FIXME: Use OEvent::toMap() here !! (eilers) | 117 | // FIXME: Use OPimEvent::toMap() here !! (eilers) |
118 | inline void save( const OEvent& ev, QString& buf ) { | 118 | inline void save( const OPimEvent& ev, QString& buf ) { |
119 | qWarning("Saving %d %s", ev.uid(), ev.description().latin1() ); | 119 | qWarning("Saving %d %s", ev.uid(), ev.description().latin1() ); |
@@ -148,5 +148,5 @@ namespace { | |||
148 | */ | 148 | */ |
149 | OTimeZone zone( ev.timeZone().isEmpty() ? OTimeZone::current() : ev.timeZone() ); | 149 | OPimTimeZone zone( ev.timeZone().isEmpty() ? OPimTimeZone::current() : ev.timeZone() ); |
150 | buf += " start=\"" + QString::number( zone.fromUTCDateTime( zone.toDateTime( ev.startDateTime(), OTimeZone::utc() ) ) ) + "\""; | 150 | buf += " start=\"" + QString::number( zone.fromUTCDateTime( zone.toDateTime( ev.startDateTime(), OPimTimeZone::utc() ) ) ) + "\""; |
151 | buf += " end=\"" + QString::number( zone.fromUTCDateTime( zone.toDateTime( ev.endDateTime() , OTimeZone::utc() ) ) ) + "\""; | 151 | buf += " end=\"" + QString::number( zone.fromUTCDateTime( zone.toDateTime( ev.endDateTime() , OPimTimeZone::utc() ) ) ) + "\""; |
152 | if (!ev.note().isEmpty() ) { | 152 | if (!ev.note().isEmpty() ) { |
@@ -179,4 +179,4 @@ namespace { | |||
179 | 179 | ||
180 | inline bool forAll( const QMap<int, OEvent>& list, QFile& file ) { | 180 | inline bool forAll( const QMap<int, OPimEvent>& list, QFile& file ) { |
181 | QMap<int, OEvent>::ConstIterator it; | 181 | QMap<int, OPimEvent>::ConstIterator it; |
182 | QString buf; | 182 | QString buf; |
@@ -266,3 +266,3 @@ QArray<int> ODateBookAccessBackend_XML::allRecords()const { | |||
266 | uint i = 0; | 266 | uint i = 0; |
267 | QMap<int, OEvent>::ConstIterator it; | 267 | QMap<int, OPimEvent>::ConstIterator it; |
268 | 268 | ||
@@ -279,3 +279,3 @@ QArray<int> ODateBookAccessBackend_XML::allRecords()const { | |||
279 | } | 279 | } |
280 | QArray<int> ODateBookAccessBackend_XML::queryByExample(const OEvent&, int, const QDateTime& ) { | 280 | QArray<int> ODateBookAccessBackend_XML::queryByExample(const OPimEvent&, int, const QDateTime& ) { |
281 | return QArray<int>(); | 281 | return QArray<int>(); |
@@ -287,3 +287,3 @@ void ODateBookAccessBackend_XML::clear() { | |||
287 | } | 287 | } |
288 | OEvent ODateBookAccessBackend_XML::find( int uid ) const{ | 288 | OPimEvent ODateBookAccessBackend_XML::find( int uid ) const{ |
289 | if ( m_raw.contains( uid ) ) | 289 | if ( m_raw.contains( uid ) ) |
@@ -293,3 +293,3 @@ OEvent ODateBookAccessBackend_XML::find( int uid ) const{ | |||
293 | } | 293 | } |
294 | bool ODateBookAccessBackend_XML::add( const OEvent& ev ) { | 294 | bool ODateBookAccessBackend_XML::add( const OPimEvent& ev ) { |
295 | m_changed = true; | 295 | m_changed = true; |
@@ -309,3 +309,3 @@ bool ODateBookAccessBackend_XML::remove( int uid ) { | |||
309 | } | 309 | } |
310 | bool ODateBookAccessBackend_XML::replace( const OEvent& ev ) { | 310 | bool ODateBookAccessBackend_XML::replace( const OPimEvent& ev ) { |
311 | replace( ev.uid() ); // ??? Shouldn't this be "remove( ev.uid() ) ??? (eilers) | 311 | replace( ev.uid() ); // ??? Shouldn't this be "remove( ev.uid() ) ??? (eilers) |
@@ -319,3 +319,3 @@ QArray<int> ODateBookAccessBackend_XML::rawRepeats()const { | |||
319 | uint i = 0; | 319 | uint i = 0; |
320 | QMap<int, OEvent>::ConstIterator it; | 320 | QMap<int, OPimEvent>::ConstIterator it; |
321 | 321 | ||
@@ -331,3 +331,3 @@ QArray<int> ODateBookAccessBackend_XML::nonRepeats()const { | |||
331 | uint i = 0; | 331 | uint i = 0; |
332 | QMap<int, OEvent>::ConstIterator it; | 332 | QMap<int, OPimEvent>::ConstIterator it; |
333 | 333 | ||
@@ -340,5 +340,5 @@ QArray<int> ODateBookAccessBackend_XML::nonRepeats()const { | |||
340 | } | 340 | } |
341 | OEvent::ValueList ODateBookAccessBackend_XML::directNonRepeats() { | 341 | OPimEvent::ValueList ODateBookAccessBackend_XML::directNonRepeats() { |
342 | OEvent::ValueList list; | 342 | OPimEvent::ValueList list; |
343 | QMap<int, OEvent>::ConstIterator it; | 343 | QMap<int, OPimEvent>::ConstIterator it; |
344 | for (it = m_raw.begin(); it != m_raw.end(); ++it ) | 344 | for (it = m_raw.begin(); it != m_raw.end(); ++it ) |
@@ -348,5 +348,5 @@ OEvent::ValueList ODateBookAccessBackend_XML::directNonRepeats() { | |||
348 | } | 348 | } |
349 | OEvent::ValueList ODateBookAccessBackend_XML::directRawRepeats() { | 349 | OPimEvent::ValueList ODateBookAccessBackend_XML::directRawRepeats() { |
350 | OEvent::ValueList list; | 350 | OPimEvent::ValueList list; |
351 | QMap<int, OEvent>::ConstIterator it; | 351 | QMap<int, OPimEvent>::ConstIterator it; |
352 | for (it = m_rep.begin(); it != m_rep.end(); ++it ) | 352 | for (it = m_rep.begin(); it != m_rep.end(); ++it ) |
@@ -357,3 +357,3 @@ OEvent::ValueList ODateBookAccessBackend_XML::directRawRepeats() { | |||
357 | 357 | ||
358 | // FIXME: Use OEvent::fromMap() (eilers) | 358 | // FIXME: Use OPimEvent::fromMap() (eilers) |
359 | bool ODateBookAccessBackend_XML::loadFile() { | 359 | bool ODateBookAccessBackend_XML::loadFile() { |
@@ -416,3 +416,3 @@ bool ODateBookAccessBackend_XML::loadFile() { | |||
416 | 416 | ||
417 | OEvent ev; | 417 | OPimEvent ev; |
418 | rec = 0; | 418 | rec = 0; |
@@ -482,7 +482,7 @@ bool ODateBookAccessBackend_XML::loadFile() { | |||
482 | 482 | ||
483 | // FIXME: Use OEvent::fromMap() which makes this obsolete.. (eilers) | 483 | // FIXME: Use OPimEvent::fromMap() which makes this obsolete.. (eilers) |
484 | void ODateBookAccessBackend_XML::finalizeRecord( OEvent& ev ) { | 484 | void ODateBookAccessBackend_XML::finalizeRecord( OPimEvent& ev ) { |
485 | /* AllDay is alway in UTC */ | 485 | /* AllDay is alway in UTC */ |
486 | if ( ev.isAllDay() ) { | 486 | if ( ev.isAllDay() ) { |
487 | OTimeZone utc = OTimeZone::utc(); | 487 | OPimTimeZone utc = OPimTimeZone::utc(); |
488 | ev.setStartDateTime( utc.fromUTCDateTime( start ) ); | 488 | ev.setStartDateTime( utc.fromUTCDateTime( start ) ); |
@@ -493,13 +493,13 @@ void ODateBookAccessBackend_XML::finalizeRecord( OEvent& ev ) { | |||
493 | // qWarning(" Start is %d", start ); | 493 | // qWarning(" Start is %d", start ); |
494 | OTimeZone zone( ev.timeZone().isEmpty() ? OTimeZone::current() : ev.timeZone() ); | 494 | OPimTimeZone zone( ev.timeZone().isEmpty() ? OPimTimeZone::current() : ev.timeZone() ); |
495 | QDateTime date = zone.toDateTime( start ); | 495 | QDateTime date = zone.toDateTime( start ); |
496 | qWarning(" Start is %s", date.toString().latin1() ); | 496 | qWarning(" Start is %s", date.toString().latin1() ); |
497 | ev.setStartDateTime( zone.toDateTime( date, OTimeZone::current() ) ); | 497 | ev.setStartDateTime( zone.toDateTime( date, OPimTimeZone::current() ) ); |
498 | 498 | ||
499 | date = zone.toDateTime( end ); | 499 | date = zone.toDateTime( end ); |
500 | ev.setEndDateTime ( zone.toDateTime( date, OTimeZone::current() ) ); | 500 | ev.setEndDateTime ( zone.toDateTime( date, OPimTimeZone::current() ) ); |
501 | } | 501 | } |
502 | if ( rec && rec->doesRecur() ) { | 502 | if ( rec && rec->doesRecur() ) { |
503 | OTimeZone utc = OTimeZone::utc(); | 503 | OPimTimeZone utc = OPimTimeZone::utc(); |
504 | ORecur recu( *rec ); // call copy c'tor; | 504 | OPimRecurrence recu( *rec ); // call copy c'tor; |
505 | recu.setEndDate ( utc.fromUTCDateTime( rp_end ).date() ); | 505 | recu.setEndDate ( utc.fromUTCDateTime( rp_end ).date() ); |
@@ -526,3 +526,3 @@ void ODateBookAccessBackend_XML::finalizeRecord( OEvent& ev ) { | |||
526 | } | 526 | } |
527 | void ODateBookAccessBackend_XML::setField( OEvent& e, int id, const QString& value) { | 527 | void ODateBookAccessBackend_XML::setField( OPimEvent& e, int id, const QString& value) { |
528 | // qWarning(" setting %s", value.latin1() ); | 528 | // qWarning(" setting %s", value.latin1() ); |
@@ -556,13 +556,13 @@ void ODateBookAccessBackend_XML::setField( OEvent& e, int id, const QString& val | |||
556 | if ( value == "Daily" ) | 556 | if ( value == "Daily" ) |
557 | recur()->setType( ORecur::Daily ); | 557 | recur()->setType( OPimRecurrence::Daily ); |
558 | else if ( value == "Weekly" ) | 558 | else if ( value == "Weekly" ) |
559 | recur()->setType( ORecur::Weekly); | 559 | recur()->setType( OPimRecurrence::Weekly); |
560 | else if ( value == "MonthlyDay" ) | 560 | else if ( value == "MonthlyDay" ) |
561 | recur()->setType( ORecur::MonthlyDay ); | 561 | recur()->setType( OPimRecurrence::MonthlyDay ); |
562 | else if ( value == "MonthlyDate" ) | 562 | else if ( value == "MonthlyDate" ) |
563 | recur()->setType( ORecur::MonthlyDate ); | 563 | recur()->setType( OPimRecurrence::MonthlyDate ); |
564 | else if ( value == "Yearly" ) | 564 | else if ( value == "Yearly" ) |
565 | recur()->setType( ORecur::Yearly ); | 565 | recur()->setType( OPimRecurrence::Yearly ); |
566 | else | 566 | else |
567 | recur()->setType( ORecur::NoRepeat ); | 567 | recur()->setType( OPimRecurrence::NoRepeat ); |
568 | break; | 568 | break; |
@@ -629,3 +629,3 @@ QArray<int> ODateBookAccessBackend_XML::matchRegexp( const QRegExp &r ) const | |||
629 | uint arraycounter = 0; | 629 | uint arraycounter = 0; |
630 | QMap<int, OEvent>::ConstIterator it; | 630 | QMap<int, OPimEvent>::ConstIterator it; |
631 | 631 | ||