From 0a33f91e166747406ca2ccb5819881feeecfdb40 Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 13 Feb 2005 11:55:52 +0000 Subject: todo recurchanges --- (limited to 'korganizer/koeditorrecurrence.cpp') 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 #include +#include #include @@ -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 rmp; QPtrList 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(); -- cgit v0.9.0.2