author | christophe <christophe> | 2004-07-30 09:50:15 (UTC) |
---|---|---|
committer | christophe <christophe> | 2004-07-30 09:50:15 (UTC) |
commit | b099a3dd18571fcbd5b1211f18ac111ec39f9ce8 (patch) (unidiff) | |
tree | 2b63e0043a5d535690fa3017f0489ba41bc797af | |
parent | 52b1ae9281920cf5a40fe543112d8b00e7699ef6 (diff) | |
download | opie-b099a3dd18571fcbd5b1211f18ac111ec39f9ce8.zip opie-b099a3dd18571fcbd5b1211f18ac111ec39f9ce8.tar.gz opie-b099a3dd18571fcbd5b1211f18ac111ec39f9ce8.tar.bz2 |
ev is not required.
-rw-r--r-- | libopie2/opiepim/core/opimevent.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libopie2/opiepim/core/opimevent.cpp b/libopie2/opiepim/core/opimevent.cpp index 739cb6f..c656c3d 100644 --- a/libopie2/opiepim/core/opimevent.cpp +++ b/libopie2/opiepim/core/opimevent.cpp | |||
@@ -598,100 +598,100 @@ QMap<int, QString> OPimEvent::toMap() const | |||
598 | retMap.insert( OPimEvent::FREndDate, recFields[ OPimRecurrence::EndDate ] ); | 598 | retMap.insert( OPimEvent::FREndDate, recFields[ OPimRecurrence::EndDate ] ); |
599 | retMap.insert( OPimEvent::FRCreated, recFields[ OPimRecurrence::Created ] ); | 599 | retMap.insert( OPimEvent::FRCreated, recFields[ OPimRecurrence::Created ] ); |
600 | retMap.insert( OPimEvent::FRExceptions, recFields[ OPimRecurrence::Exceptions ] ); | 600 | retMap.insert( OPimEvent::FRExceptions, recFields[ OPimRecurrence::Exceptions ] ); |
601 | } | 601 | } |
602 | else | 602 | else |
603 | { | 603 | { |
604 | OPimRecurrence recur = recurrence(); | 604 | OPimRecurrence recur = recurrence(); |
605 | QMap<int, QString> recFields = recur.toMap(); | 605 | QMap<int, QString> recFields = recur.toMap(); |
606 | retMap.insert( OPimEvent::FRType, recFields[ OPimRecurrence::RType ] ); | 606 | retMap.insert( OPimEvent::FRType, recFields[ OPimRecurrence::RType ] ); |
607 | } | 607 | } |
608 | 608 | ||
609 | return retMap; | 609 | return retMap; |
610 | } | 610 | } |
611 | 611 | ||
612 | 612 | ||
613 | void OPimEvent::fromMap( const QMap<int, QString>& map ) | 613 | void OPimEvent::fromMap( const QMap<int, QString>& map ) |
614 | { | 614 | { |
615 | 615 | ||
616 | // We just want to set the UID if it is really stored. | 616 | // We just want to set the UID if it is really stored. |
617 | if ( !map[ OPimEvent::FUid ].isEmpty() ) | 617 | if ( !map[ OPimEvent::FUid ].isEmpty() ) |
618 | setUid( map[ OPimEvent::FUid ].toInt() ); | 618 | setUid( map[ OPimEvent::FUid ].toInt() ); |
619 | 619 | ||
620 | setCategories( idsFromString( map[ OPimEvent::FCategories ] ) ); | 620 | setCategories( idsFromString( map[ OPimEvent::FCategories ] ) ); |
621 | setDescription( map[ OPimEvent::FDescription ] ); | 621 | setDescription( map[ OPimEvent::FDescription ] ); |
622 | setLocation( map[ OPimEvent::FLocation ] ); | 622 | setLocation( map[ OPimEvent::FLocation ] ); |
623 | 623 | ||
624 | if ( map[ OPimEvent::FType ] == "AllDay" ) | 624 | if ( map[ OPimEvent::FType ] == "AllDay" ) |
625 | setAllDay( true ); | 625 | setAllDay( true ); |
626 | else | 626 | else |
627 | setAllDay( false ); | 627 | setAllDay( false ); |
628 | 628 | ||
629 | if ( !map[ OPimEvent::FTimeZone ].isEmpty() && ( map[ OPimEvent::FTimeZone ] != "None" ) ) | 629 | if ( !map[ OPimEvent::FTimeZone ].isEmpty() && ( map[ OPimEvent::FTimeZone ] != "None" ) ) |
630 | { | 630 | { |
631 | setTimeZone( map[ OPimEvent::FTimeZone ] ); | 631 | setTimeZone( map[ OPimEvent::FTimeZone ] ); |
632 | } | 632 | } |
633 | 633 | ||
634 | time_t start = ( time_t ) map[ OPimEvent::FStart ].toLong(); | 634 | time_t start = ( time_t ) map[ OPimEvent::FStart ].toLong(); |
635 | time_t end = ( time_t ) map[ OPimEvent::FEnd ].toLong(); | 635 | time_t end = ( time_t ) map[ OPimEvent::FEnd ].toLong(); |
636 | 636 | ||
637 | /* AllDay is always in UTC */ | 637 | /* AllDay is always in UTC */ |
638 | if ( isAllDay() ) | 638 | if ( isAllDay() ) |
639 | { | 639 | { |
640 | OPimTimeZone utc = OPimTimeZone::utc(); | 640 | OPimTimeZone utc = OPimTimeZone::utc(); |
641 | setStartDateTime(utc.toDateTime( start ) ); | 641 | setStartDateTime(utc.toDateTime( start ) ); |
642 | setEndDateTime ( utc.toDateTime( end ) ); | 642 | setEndDateTime ( utc.toDateTime( end ) ); |
643 | } | 643 | } |
644 | else { | 644 | else { |
645 | /* to current date time */ | 645 | /* to current date time */ |
646 | OPimTimeZone to_zone( ev.timeZone().isEmpty() ? OPimTimeZone::utc() : OPimTimeZone::current() ); | 646 | OPimTimeZone to_zone( timeZone().isEmpty() ? OPimTimeZone::utc() : OPimTimeZone::current() ); |
647 | 647 | ||
648 | ev.setStartDateTime(to_zone.toDateTime( start)); | 648 | setStartDateTime(to_zone.toDateTime( start)); |
649 | ev.setEndDateTime (to_zone.toDateTime( end)); | 649 | setEndDateTime (to_zone.toDateTime( end)); |
650 | } | 650 | } |
651 | 651 | ||
652 | int alarmTime = -1; | 652 | int alarmTime = -1; |
653 | if ( !map[ OPimEvent::FAlarm ].isEmpty() ) | 653 | if ( !map[ OPimEvent::FAlarm ].isEmpty() ) |
654 | alarmTime = map[ OPimEvent::FAlarm ].toInt(); | 654 | alarmTime = map[ OPimEvent::FAlarm ].toInt(); |
655 | 655 | ||
656 | int sound = ( ( map[ OPimEvent::FSound ] == "loud" ) ? OPimAlarm::Loud : OPimAlarm::Silent ); | 656 | int sound = ( ( map[ OPimEvent::FSound ] == "loud" ) ? OPimAlarm::Loud : OPimAlarm::Silent ); |
657 | if ( ( alarmTime != -1 ) ) | 657 | if ( ( alarmTime != -1 ) ) |
658 | { | 658 | { |
659 | QDateTime dt = startDateTime().addSecs( -1 * alarmTime * 60 ); | 659 | QDateTime dt = startDateTime().addSecs( -1 * alarmTime * 60 ); |
660 | OPimAlarm al( sound , dt ); | 660 | OPimAlarm al( sound , dt ); |
661 | notifiers().add( al ); | 661 | notifiers().add( al ); |
662 | } | 662 | } |
663 | 663 | ||
664 | 664 | ||
665 | if ( !map[ OPimEvent::FNote ].isEmpty() ) | 665 | if ( !map[ OPimEvent::FNote ].isEmpty() ) |
666 | setNote( map[ OPimEvent::FNote ] ); | 666 | setNote( map[ OPimEvent::FNote ] ); |
667 | 667 | ||
668 | if ( !map[ OPimEvent::FRecParent ].isEmpty() ) | 668 | if ( !map[ OPimEvent::FRecParent ].isEmpty() ) |
669 | setParent( map[ OPimEvent::FRecParent ].toInt() ); | 669 | setParent( map[ OPimEvent::FRecParent ].toInt() ); |
670 | 670 | ||
671 | if ( !map[ OPimEvent::FRecChildren ].isEmpty() ) | 671 | if ( !map[ OPimEvent::FRecChildren ].isEmpty() ) |
672 | { | 672 | { |
673 | QStringList list = QStringList::split( ' ', map[ OPimEvent::FRecChildren ] ); | 673 | QStringList list = QStringList::split( ' ', map[ OPimEvent::FRecChildren ] ); |
674 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) | 674 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) |
675 | { | 675 | { |
676 | addChild( ( *it ).toInt() ); | 676 | addChild( ( *it ).toInt() ); |
677 | } | 677 | } |
678 | } | 678 | } |
679 | 679 | ||
680 | // Fill recurrence stuff and put it directly into the OPimRecurrence-Object using fromMap.. | 680 | // Fill recurrence stuff and put it directly into the OPimRecurrence-Object using fromMap.. |
681 | if ( !map[ OPimEvent::FRType ].isEmpty() ) | 681 | if ( !map[ OPimEvent::FRType ].isEmpty() ) |
682 | { | 682 | { |
683 | QMap<int, QString> recFields; | 683 | QMap<int, QString> recFields; |
684 | recFields.insert( OPimRecurrence::RType, map[ OPimEvent::FRType ] ); | 684 | recFields.insert( OPimRecurrence::RType, map[ OPimEvent::FRType ] ); |
685 | recFields.insert( OPimRecurrence::RWeekdays, map[ OPimEvent::FRWeekdays ] ); | 685 | recFields.insert( OPimRecurrence::RWeekdays, map[ OPimEvent::FRWeekdays ] ); |
686 | recFields.insert( OPimRecurrence::RPosition, map[ OPimEvent::FRPosition ] ); | 686 | recFields.insert( OPimRecurrence::RPosition, map[ OPimEvent::FRPosition ] ); |
687 | recFields.insert( OPimRecurrence::RFreq, map[ OPimEvent::FRFreq ] ); | 687 | recFields.insert( OPimRecurrence::RFreq, map[ OPimEvent::FRFreq ] ); |
688 | recFields.insert( OPimRecurrence::RHasEndDate, map[ OPimEvent::FRHasEndDate ] ); | 688 | recFields.insert( OPimRecurrence::RHasEndDate, map[ OPimEvent::FRHasEndDate ] ); |
689 | recFields.insert( OPimRecurrence::EndDate, map[ OPimEvent::FREndDate ] ); | 689 | recFields.insert( OPimRecurrence::EndDate, map[ OPimEvent::FREndDate ] ); |
690 | recFields.insert( OPimRecurrence::Created, map[ OPimEvent::FRCreated ] ); | 690 | recFields.insert( OPimRecurrence::Created, map[ OPimEvent::FRCreated ] ); |
691 | recFields.insert( OPimRecurrence::Exceptions, map[ OPimEvent::FRExceptions ] ); | 691 | recFields.insert( OPimRecurrence::Exceptions, map[ OPimEvent::FRExceptions ] ); |
692 | OPimRecurrence recur( recFields ); | 692 | OPimRecurrence recur( recFields ); |
693 | setRecurrence( recur ); | 693 | setRecurrence( recur ); |
694 | } | 694 | } |
695 | 695 | ||
696 | } | 696 | } |
697 | 697 | ||