author | zautrix <zautrix> | 2005-02-13 11:55:52 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-13 11:55:52 (UTC) |
commit | 0a33f91e166747406ca2ccb5819881feeecfdb40 (patch) (side-by-side diff) | |
tree | e9130a16aaa6365e106d6733c3e1adeca01f72ac /korganizer/koeditorrecurrence.cpp | |
parent | 00ec9899a4727a4c9100d320935dde7da4803801 (diff) | |
download | kdepimpi-0a33f91e166747406ca2ccb5819881feeecfdb40.zip kdepimpi-0a33f91e166747406ca2ccb5819881feeecfdb40.tar.gz kdepimpi-0a33f91e166747406ca2ccb5819881feeecfdb40.tar.bz2 |
todo recurchanges
Diffstat (limited to 'korganizer/koeditorrecurrence.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeditorrecurrence.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/korganizer/koeditorrecurrence.cpp b/korganizer/koeditorrecurrence.cpp index 4209e10..bedc75a 100644 --- a/korganizer/koeditorrecurrence.cpp +++ b/korganizer/koeditorrecurrence.cpp @@ -42,6 +42,7 @@ #include <knumvalidator.h> #include <libkcal/event.h> +#include <libkcal/todo.h> #include <libkdepim/kdateedit.h> @@ -905,16 +906,23 @@ void KOEditorRecurrence::setDefaults( QDateTime from, QDateTime to, bool ) mYearly->setByMonth( from.date().month(), from.date().day() ); } -void KOEditorRecurrence::readEvent(Event *event) +void KOEditorRecurrence::readEvent(Incidence *event) { - setDefaults( event->dtStart(), event->dtEnd(), true ); + + QDateTime dtEnd; + if ( event->type() == "Event" ) + dtEnd = ((Event*)event)->dtEnd(); + else + dtEnd = ((Todo*)event)->dtDue(); + + setDefaults( event->dtStart(), dtEnd, true ); QBitArray rDays( 7 ); QPtrList<Recurrence::rMonthPos> rmp; QPtrList<int> rmd; int day = 0; int count = 0; int month = 0; - setDateTimes( event->dtStart(), event->dtEnd() ); + setDateTimes( event->dtStart(), dtEnd ); Recurrence *r = event->recurrence(); int f = r->frequency(); @@ -928,7 +936,7 @@ void KOEditorRecurrence::readEvent(Event *event) switch ( recurs ) { case Recurrence::rNone: - setDefaults( event->dtStart(), event->dtEnd(), true ); + setDefaults( event->dtStart(), dtEnd, true ); break; case Recurrence::rDaily: recurrenceType = RecurrenceChooser::Daily; @@ -1000,7 +1008,7 @@ void KOEditorRecurrence::readEvent(Event *event) mYearly->setFrequency( f ); break; default: - setDefaults( event->dtStart(), event->dtEnd(), true ); + setDefaults( event->dtStart(), dtEnd, true ); break; } @@ -1024,7 +1032,7 @@ void KOEditorRecurrence::readEvent(Event *event) mExceptions->setDates( event->exDates() ); } -void KOEditorRecurrence::writeEvent( Event *event ) +void KOEditorRecurrence::writeEvent( Incidence *event ) { Recurrence *r = event->recurrence(); |