summaryrefslogtreecommitdiffabout
path: root/libkcal/icalformatimpl.cpp
Side-by-side diff
Diffstat (limited to 'libkcal/icalformatimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/icalformatimpl.cpp12
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
@@ -361,19 +361,19 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence)
if (!tmpStr.isEmpty()) {
tmpStr.truncate(tmpStr.length()-1);
icalcomponent_add_property(parent,icalproperty_new_categories(
writeText(incidence->getCategories().join(";"))));
}
*/
// related event
- if (incidence->relatedTo()) {
+ if (!incidence->relatedToUid().isEmpty()) {
icalcomponent_add_property(parent,icalproperty_new_relatedto(
- incidence->relatedTo()->uid().utf8()));
+ incidence->relatedToUid().utf8()));
}
// recurrence rule stuff
Recurrence *recur = incidence->recurrence();
if (recur->doesRecur()) {
icalcomponent_add_property(parent,writeRecurrenceRule(recur));
}
@@ -2031,21 +2031,25 @@ bool ICalFormatImpl::populate( Calendar *cal, icalcomponent *calendar)
SKIP:
;
} // while
#endif
// Post-Process list of events with relations, put Event objects in relation
Event *ev;
for ( ev=mEventsRelate.first(); ev != 0; ev=mEventsRelate.next() ) {
- ev->setRelatedTo(cal->event(ev->relatedToUid()));
+ Incidence * inc = cal->event(ev->relatedToUid());
+ if ( inc )
+ ev->setRelatedTo( inc );
}
Todo *todo;
for ( todo=mTodosRelate.first(); todo != 0; todo=mTodosRelate.next() ) {
- todo->setRelatedTo(cal->todo(todo->relatedToUid()));
+ Incidence * inc = cal->todo(todo->relatedToUid());
+ if ( inc )
+ todo->setRelatedTo( inc );
}
return true;
}
QString ICalFormatImpl::extractErrorProperty(icalcomponent *c)
{
// kdDebug(5800) << "ICalFormatImpl:extractErrorProperty: "