-rw-r--r-- | libkcal/icalformatimpl.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index 4794bc9..f349681 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp @@ -371,20 +371,17 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence) incidence->relatedToUid().utf8())); } // recurrence rule stuff - Recurrence *recur = incidence->recurrence(); - if (recur->doesRecur()) { - - icalcomponent_add_property(parent,writeRecurrenceRule(recur)); - } - - // recurrence excpetion dates - DateList dateList = incidence->exDates(); - DateList::ConstIterator exIt; - for(exIt = dateList.begin(); exIt != dateList.end(); ++exIt) { - icalcomponent_add_property(parent,icalproperty_new_exdate( - writeICalDate(*exIt))); + if (incidence->doesRecur()) { + icalcomponent_add_property(parent,writeRecurrenceRule(incidence->recurrence())); + // recurrence excpetion dates + DateList dateList = incidence->exDates(); + DateList::ConstIterator exIt; + for(exIt = dateList.begin(); exIt != dateList.end(); ++exIt) { + icalcomponent_add_property(parent,icalproperty_new_exdate( + writeICalDate(*exIt))); + } } // attachments QPtrList<Attachment> attachments = incidence->attachments(); @@ -1294,9 +1291,10 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent,Incidence *incidence) incidence->setIDStr(kp); } // Cancel backwards compatibility mode for subsequent changes by the application - incidence->recurrence()->setCompatVersion(); + if ( readrec ) + incidence->recurrence()->setCompatVersion(); // add categories incidence->setCategories(categories); |