author | zautrix <zautrix> | 2005-07-28 17:20:12 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-28 17:20:12 (UTC) |
commit | 21e3b4936180fe45ba9545cb3fe28b574f86f1b5 (patch) (unidiff) | |
tree | 59667b0b2738776f69206209c4653dc2e4487d3f | |
parent | 1f1a6829b042c804e5b547b181dc50c4539d5551 (diff) | |
download | kdepimpi-21e3b4936180fe45ba9545cb3fe28b574f86f1b5.zip kdepimpi-21e3b4936180fe45ba9545cb3fe28b574f86f1b5.tar.gz kdepimpi-21e3b4936180fe45ba9545cb3fe28b574f86f1b5.tar.bz2 |
rec fix
-rw-r--r-- | libkcal/incidence.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 201f593..52d94fb 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp | |||
@@ -707,97 +707,98 @@ QStringList Incidence::secrecyList() | |||
707 | } | 707 | } |
708 | 708 | ||
709 | 709 | ||
710 | QPtrList<Alarm> Incidence::alarms() const | 710 | QPtrList<Alarm> Incidence::alarms() const |
711 | { | 711 | { |
712 | return mAlarms; | 712 | return mAlarms; |
713 | } | 713 | } |
714 | 714 | ||
715 | Alarm* Incidence::newAlarm() | 715 | Alarm* Incidence::newAlarm() |
716 | { | 716 | { |
717 | Alarm* alarm = new Alarm(this); | 717 | Alarm* alarm = new Alarm(this); |
718 | mAlarms.append(alarm); | 718 | mAlarms.append(alarm); |
719 | // updated(); | 719 | // updated(); |
720 | return alarm; | 720 | return alarm; |
721 | } | 721 | } |
722 | 722 | ||
723 | void Incidence::addAlarm(Alarm *alarm) | 723 | void Incidence::addAlarm(Alarm *alarm) |
724 | { | 724 | { |
725 | mAlarms.append(alarm); | 725 | mAlarms.append(alarm); |
726 | updated(); | 726 | updated(); |
727 | } | 727 | } |
728 | 728 | ||
729 | void Incidence::removeAlarm(Alarm *alarm) | 729 | void Incidence::removeAlarm(Alarm *alarm) |
730 | { | 730 | { |
731 | mAlarms.removeRef(alarm); | 731 | mAlarms.removeRef(alarm); |
732 | updated(); | 732 | updated(); |
733 | } | 733 | } |
734 | 734 | ||
735 | void Incidence::clearAlarms() | 735 | void Incidence::clearAlarms() |
736 | { | 736 | { |
737 | mAlarms.clear(); | 737 | mAlarms.clear(); |
738 | updated(); | 738 | updated(); |
739 | } | 739 | } |
740 | 740 | ||
741 | bool Incidence::isAlarmEnabled() const | 741 | bool Incidence::isAlarmEnabled() const |
742 | { | 742 | { |
743 | Alarm* alarm; | 743 | Alarm* alarm; |
744 | for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { | 744 | for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { |
745 | if (alarm->enabled()) | 745 | if (alarm->enabled()) |
746 | return true; | 746 | return true; |
747 | } | 747 | } |
748 | return false; | 748 | return false; |
749 | } | 749 | } |
750 | #include <stdlib.h> | 750 | #include <stdlib.h> |
751 | Recurrence *Incidence::recurrence() | 751 | Recurrence *Incidence::recurrence() |
752 | { | 752 | { |
753 | if ( ! mRecurrence ) { | 753 | if ( ! mRecurrence ) { |
754 | mRecurrence = new Recurrence(this); | 754 | mRecurrence = new Recurrence(this); |
755 | qDebug("creating new recurence "); | 755 | mRecurrence->setRecurStart( dtStart() ); |
756 | //qDebug("creating new recurence "); | ||
756 | //abort(); | 757 | //abort(); |
757 | } | 758 | } |
758 | return mRecurrence; | 759 | return mRecurrence; |
759 | } | 760 | } |
760 | void Incidence::setRecurrence( Recurrence * r) | 761 | void Incidence::setRecurrence( Recurrence * r) |
761 | { | 762 | { |
762 | if ( mRecurrence ) | 763 | if ( mRecurrence ) |
763 | delete mRecurrence; | 764 | delete mRecurrence; |
764 | mRecurrence = r; | 765 | mRecurrence = r; |
765 | } | 766 | } |
766 | 767 | ||
767 | void Incidence::setLocation(const QString &location) | 768 | void Incidence::setLocation(const QString &location) |
768 | { | 769 | { |
769 | if (mReadOnly) return; | 770 | if (mReadOnly) return; |
770 | mLocation = location; | 771 | mLocation = location; |
771 | updated(); | 772 | updated(); |
772 | } | 773 | } |
773 | 774 | ||
774 | QString Incidence::location() const | 775 | QString Incidence::location() const |
775 | { | 776 | { |
776 | return mLocation; | 777 | return mLocation; |
777 | } | 778 | } |
778 | QString Incidence::recurrenceText() const | 779 | QString Incidence::recurrenceText() const |
779 | { | 780 | { |
780 | if ( mRecurrence ) return mRecurrence->recurrenceText(); | 781 | if ( mRecurrence ) return mRecurrence->recurrenceText(); |
781 | return i18n("No"); | 782 | return i18n("No"); |
782 | } | 783 | } |
783 | 784 | ||
784 | ushort Incidence::doesRecur() const | 785 | ushort Incidence::doesRecur() const |
785 | { | 786 | { |
786 | if ( mRecurrence ) return mRecurrence->doesRecur(); | 787 | if ( mRecurrence ) return mRecurrence->doesRecur(); |
787 | else return Recurrence::rNone; | 788 | else return Recurrence::rNone; |
788 | } | 789 | } |
789 | 790 | ||
790 | QDateTime Incidence::getNextOccurence( const QDateTime& dt, bool* ok ) const | 791 | QDateTime Incidence::getNextOccurence( const QDateTime& dt, bool* ok ) const |
791 | { | 792 | { |
792 | QDateTime incidenceStart = dt; | 793 | QDateTime incidenceStart = dt; |
793 | *ok = false; | 794 | *ok = false; |
794 | if ( doesRecur() ) { | 795 | if ( doesRecur() ) { |
795 | bool last; | 796 | bool last; |
796 | mRecurrence->getPreviousDateTime( incidenceStart , &last ); | 797 | mRecurrence->getPreviousDateTime( incidenceStart , &last ); |
797 | int count = 0; | 798 | int count = 0; |
798 | if ( !last ) { | 799 | if ( !last ) { |
799 | while ( !last ) { | 800 | while ( !last ) { |
800 | ++count; | 801 | ++count; |
801 | incidenceStart = mRecurrence->getNextDateTime( incidenceStart, &last ); | 802 | incidenceStart = mRecurrence->getNextDateTime( incidenceStart, &last ); |
802 | if ( recursOn( incidenceStart.date() ) ) { | 803 | if ( recursOn( incidenceStart.date() ) ) { |
803 | last = true; // exit while llop | 804 | last = true; // exit while llop |