-rw-r--r-- | libkcal/icalformatimpl.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index eae41aa..fe7413f 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp | |||
@@ -357,27 +357,27 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence) | |||
357 | // vcc.y has been hacked to translate the ';' to a ',' when the vcal is | 357 | // vcc.y has been hacked to translate the ';' to a ',' when the vcal is |
358 | // read in. | 358 | // read in. |
359 | tmpStr += ";"; | 359 | tmpStr += ";"; |
360 | } | 360 | } |
361 | if (!tmpStr.isEmpty()) { | 361 | if (!tmpStr.isEmpty()) { |
362 | tmpStr.truncate(tmpStr.length()-1); | 362 | tmpStr.truncate(tmpStr.length()-1); |
363 | icalcomponent_add_property(parent,icalproperty_new_categories( | 363 | icalcomponent_add_property(parent,icalproperty_new_categories( |
364 | writeText(incidence->getCategories().join(";")))); | 364 | writeText(incidence->getCategories().join(";")))); |
365 | } | 365 | } |
366 | */ | 366 | */ |
367 | 367 | ||
368 | // related event | 368 | // related event |
369 | if (incidence->relatedTo()) { | 369 | if (!incidence->relatedToUid().isEmpty()) { |
370 | icalcomponent_add_property(parent,icalproperty_new_relatedto( | 370 | icalcomponent_add_property(parent,icalproperty_new_relatedto( |
371 | incidence->relatedTo()->uid().utf8())); | 371 | incidence->relatedToUid().utf8())); |
372 | } | 372 | } |
373 | 373 | ||
374 | // recurrence rule stuff | 374 | // recurrence rule stuff |
375 | Recurrence *recur = incidence->recurrence(); | 375 | Recurrence *recur = incidence->recurrence(); |
376 | if (recur->doesRecur()) { | 376 | if (recur->doesRecur()) { |
377 | 377 | ||
378 | icalcomponent_add_property(parent,writeRecurrenceRule(recur)); | 378 | icalcomponent_add_property(parent,writeRecurrenceRule(recur)); |
379 | } | 379 | } |
380 | 380 | ||
381 | // recurrence excpetion dates | 381 | // recurrence excpetion dates |
382 | DateList dateList = incidence->exDates(); | 382 | DateList dateList = incidence->exDates(); |
383 | DateList::ConstIterator exIt; | 383 | DateList::ConstIterator exIt; |
@@ -2027,29 +2027,33 @@ bool ICalFormatImpl::populate( Calendar *cal, icalcomponent *calendar) | |||
2027 | ; | 2027 | ; |
2028 | } else { | 2028 | } else { |
2029 | ; | 2029 | ; |
2030 | } | 2030 | } |
2031 | SKIP: | 2031 | SKIP: |
2032 | ; | 2032 | ; |
2033 | } // while | 2033 | } // while |
2034 | #endif | 2034 | #endif |
2035 | 2035 | ||
2036 | // Post-Process list of events with relations, put Event objects in relation | 2036 | // Post-Process list of events with relations, put Event objects in relation |
2037 | Event *ev; | 2037 | Event *ev; |
2038 | for ( ev=mEventsRelate.first(); ev != 0; ev=mEventsRelate.next() ) { | 2038 | for ( ev=mEventsRelate.first(); ev != 0; ev=mEventsRelate.next() ) { |
2039 | ev->setRelatedTo(cal->event(ev->relatedToUid())); | 2039 | Incidence * inc = cal->event(ev->relatedToUid()); |
2040 | if ( inc ) | ||
2041 | ev->setRelatedTo( inc ); | ||
2040 | } | 2042 | } |
2041 | Todo *todo; | 2043 | Todo *todo; |
2042 | for ( todo=mTodosRelate.first(); todo != 0; todo=mTodosRelate.next() ) { | 2044 | for ( todo=mTodosRelate.first(); todo != 0; todo=mTodosRelate.next() ) { |
2043 | todo->setRelatedTo(cal->todo(todo->relatedToUid())); | 2045 | Incidence * inc = cal->todo(todo->relatedToUid()); |
2046 | if ( inc ) | ||
2047 | todo->setRelatedTo( inc ); | ||
2044 | } | 2048 | } |
2045 | 2049 | ||
2046 | return true; | 2050 | return true; |
2047 | } | 2051 | } |
2048 | 2052 | ||
2049 | QString ICalFormatImpl::extractErrorProperty(icalcomponent *c) | 2053 | QString ICalFormatImpl::extractErrorProperty(icalcomponent *c) |
2050 | { | 2054 | { |
2051 | // kdDebug(5800) << "ICalFormatImpl:extractErrorProperty: " | 2055 | // kdDebug(5800) << "ICalFormatImpl:extractErrorProperty: " |
2052 | // << icalcomponent_as_ical_string(c) << endl; | 2056 | // << icalcomponent_as_ical_string(c) << endl; |
2053 | 2057 | ||
2054 | QString errorMessage; | 2058 | QString errorMessage; |
2055 | 2059 | ||