summaryrefslogtreecommitdiffabout
path: root/libkcal/icalformatimpl.cpp
Unidiff
Diffstat (limited to 'libkcal/icalformatimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/icalformatimpl.cpp24
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
@@ -369,24 +369,21 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence)
369 if (!incidence->relatedToUid().isEmpty()) { 369 if (!incidence->relatedToUid().isEmpty()) {
370 icalcomponent_add_property(parent,icalproperty_new_relatedto( 370 icalcomponent_add_property(parent,icalproperty_new_relatedto(
371 incidence->relatedToUid().utf8())); 371 incidence->relatedToUid().utf8()));
372 } 372 }
373 373
374 // recurrence rule stuff 374 // recurrence rule stuff
375 Recurrence *recur = incidence->recurrence(); 375 if (incidence->doesRecur()) {
376 if (recur->doesRecur()) { 376 icalcomponent_add_property(parent,writeRecurrenceRule(incidence->recurrence()));
377 377 // recurrence excpetion dates
378 icalcomponent_add_property(parent,writeRecurrenceRule(recur)); 378 DateList dateList = incidence->exDates();
379 } 379 DateList::ConstIterator exIt;
380 380 for(exIt = dateList.begin(); exIt != dateList.end(); ++exIt) {
381 // recurrence excpetion dates 381 icalcomponent_add_property(parent,icalproperty_new_exdate(
382 DateList dateList = incidence->exDates(); 382 writeICalDate(*exIt)));
383 DateList::ConstIterator exIt; 383 }
384 for(exIt = dateList.begin(); exIt != dateList.end(); ++exIt) {
385 icalcomponent_add_property(parent,icalproperty_new_exdate(
386 writeICalDate(*exIt)));
387 } 384 }
388 385
389 // attachments 386 // attachments
390 QPtrList<Attachment> attachments = incidence->attachments(); 387 QPtrList<Attachment> attachments = incidence->attachments();
391 for (Attachment *at = attachments.first(); at; at = attachments.next()) 388 for (Attachment *at = attachments.first(); at; at = attachments.next())
392 icalcomponent_add_property(parent,writeAttachment(at)); 389 icalcomponent_add_property(parent,writeAttachment(at));
@@ -1292,13 +1289,14 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent,Incidence *incidence)
1292 kp = incidence->nonKDECustomProperty("X-KOPIEXTID"); 1289 kp = incidence->nonKDECustomProperty("X-KOPIEXTID");
1293 if (!kp.isNull()) { 1290 if (!kp.isNull()) {
1294 incidence->setIDStr(kp); 1291 incidence->setIDStr(kp);
1295 } 1292 }
1296 1293
1297 // Cancel backwards compatibility mode for subsequent changes by the application 1294 // Cancel backwards compatibility mode for subsequent changes by the application
1298 incidence->recurrence()->setCompatVersion(); 1295 if ( readrec )
1296 incidence->recurrence()->setCompatVersion();
1299 1297
1300 // add categories 1298 // add categories
1301 incidence->setCategories(categories); 1299 incidence->setCategories(categories);
1302 1300
1303 // iterate through all alarms 1301 // iterate through all alarms
1304 for (icalcomponent *alarm = icalcomponent_get_first_component(parent,ICAL_VALARM_COMPONENT); 1302 for (icalcomponent *alarm = icalcomponent_get_first_component(parent,ICAL_VALARM_COMPONENT);