Diffstat (limited to 'libopie/pim/odatebookaccessbackend_xml.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/pim/odatebookaccessbackend_xml.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libopie/pim/odatebookaccessbackend_xml.cpp b/libopie/pim/odatebookaccessbackend_xml.cpp index ab2eea4..5ea945c 100644 --- a/libopie/pim/odatebookaccessbackend_xml.cpp +++ b/libopie/pim/odatebookaccessbackend_xml.cpp | |||
@@ -421,48 +421,48 @@ bool ODateBookAccessBackend_XML::loadFile() { | |||
421 | i = j + 1; | 421 | i = j + 1; |
422 | 422 | ||
423 | QString str = (haveUtf ? QString::fromUtf8( value ) | 423 | QString str = (haveUtf ? QString::fromUtf8( value ) |
424 | : QString::fromLatin1( value ) ); | 424 | : QString::fromLatin1( value ) ); |
425 | if ( haveEnt ) | 425 | if ( haveEnt ) |
426 | str = Qtopia::plainString( str ); | 426 | str = Qtopia::plainString( str ); |
427 | 427 | ||
428 | /* | 428 | /* |
429 | * add key + value | 429 | * add key + value |
430 | */ | 430 | */ |
431 | find = dict[attr.data()]; | 431 | find = dict[attr.data()]; |
432 | if (!find) | 432 | if (!find) |
433 | ev.setCustomField( attr, value ); | 433 | ev.setCustomField( attr, str ); |
434 | else { | 434 | else { |
435 | setField( ev, *find, value ); | 435 | setField( ev, *find, str ); |
436 | } | 436 | } |
437 | } | 437 | } |
438 | /* time to finalize */ | 438 | /* time to finalize */ |
439 | finalizeRecord( ev ); | 439 | finalizeRecord( ev ); |
440 | delete rec; | 440 | delete rec; |
441 | } | 441 | } |
442 | ::munmap(map_addr, attribute.st_size ); | 442 | ::munmap(map_addr, attribute.st_size ); |
443 | m_changed = false; // changed during add | 443 | m_changed = false; // changed during add |
444 | 444 | ||
445 | return true; | 445 | return true; |
446 | } | 446 | } |
447 | void ODateBookAccessBackend_XML::finalizeRecord( OEvent& ev ) { | 447 | void ODateBookAccessBackend_XML::finalizeRecord( OEvent& ev ) { |
448 | /* AllDay is alway in UTC */ | 448 | /* AllDay is alway in UTC */ |
449 | if ( ev.isAllDay() ) { | 449 | if ( ev.isAllDay() ) { |
450 | OTimeZone utc = OTimeZone::utc(); | 450 | OTimeZone utc = OTimeZone::utc(); |
451 | ev.setStartDateTime( utc.fromUTCDateTime( start ) ); | 451 | ev.setStartDateTime( utc.fromUTCDateTime( start ) ); |
452 | ev.setEndDateTime ( utc.fromUTCDateTime( end ) ); | 452 | ev.setEndDateTime ( utc.fromUTCDateTime( end ) ); |
453 | ev.setTimeZone( "UTC"); // make sure it is really utc | 453 | ev.setTimeZone( "UTC"); // make sure it is really utc |
454 | }else { | 454 | }else { |
455 | /* to current date time */ | 455 | /* to current date time */ |
456 | qWarning(" Start is %d", start ); | 456 | // qWarning(" Start is %d", start ); |
457 | OTimeZone zone( ev.timeZone().isEmpty() ? OTimeZone::current() : ev.timeZone() ); | 457 | OTimeZone zone( ev.timeZone().isEmpty() ? OTimeZone::current() : ev.timeZone() ); |
458 | QDateTime date = zone.toDateTime( start ); | 458 | QDateTime date = zone.toDateTime( start ); |
459 | qWarning(" Start is %s", date.toString().latin1() ); | 459 | qWarning(" Start is %s", date.toString().latin1() ); |
460 | ev.setStartDateTime( zone.toDateTime( date, OTimeZone::current() ) ); | 460 | ev.setStartDateTime( zone.toDateTime( date, OTimeZone::current() ) ); |
461 | 461 | ||
462 | date = zone.toDateTime( end ); | 462 | date = zone.toDateTime( end ); |
463 | ev.setEndDateTime ( zone.toDateTime( date, OTimeZone::current() ) ); | 463 | ev.setEndDateTime ( zone.toDateTime( date, OTimeZone::current() ) ); |
464 | } | 464 | } |
465 | if ( rec && rec->doesRecur() ) { | 465 | if ( rec && rec->doesRecur() ) { |
466 | OTimeZone utc = OTimeZone::utc(); | 466 | OTimeZone utc = OTimeZone::utc(); |
467 | ORecur recu( *rec ); // call copy c'tor; | 467 | ORecur recu( *rec ); // call copy c'tor; |
468 | recu.setEndDate ( utc.fromUTCDateTime( rp_end ).date() ); | 468 | recu.setEndDate ( utc.fromUTCDateTime( rp_end ).date() ); |