author | zautrix <zautrix> | 2005-04-10 08:53:14 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-10 08:53:14 (UTC) |
commit | 79b12b680f6a0653bcff84c8ef83b23803246b7d (patch) (side-by-side diff) | |
tree | 05e4c6d7ac0446eacb7dff6ca466f656b3152793 /libkcal/icalformatimpl.cpp | |
parent | 54f5fe5e6f4909109edf915513c02f7af3e7bb2d (diff) | |
download | kdepimpi-79b12b680f6a0653bcff84c8ef83b23803246b7d.zip kdepimpi-79b12b680f6a0653bcff84c8ef83b23803246b7d.tar.gz kdepimpi-79b12b680f6a0653bcff84c8ef83b23803246b7d.tar.bz2 |
fixes
-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 @@ -345,51 +345,51 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence) tmpStrList = incidence->getCategories(); tmpStr = ""; QString catStr; for ( QStringList::Iterator it = tmpStrList.begin(); it != tmpStrList.end(); ++it ) { catStr = *it; if (catStr[0] == ' ') tmpStr += catStr.mid(1); else tmpStr += catStr; // this must be a ';' character as the vCalendar specification requires! // vcc.y has been hacked to translate the ';' to a ',' when the vcal is // read in. tmpStr += ";"; } 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)); } // 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(); for (Attachment *at = attachments.first(); at; at = attachments.next()) icalcomponent_add_property(parent,writeAttachment(at)); // alarms QPtrList<Alarm> alarms = incidence->alarms(); @@ -2015,53 +2015,57 @@ bool ICalFormatImpl::populate( Calendar *cal, icalcomponent *calendar) else { // some sort of error must have occurred while in translation. goto SKIP; } } else if (strcmp(vObjectName(curVO), VCTodoProp) == 0) { anEvent = VTodoToEvent(curVO); cal->addTodo(anEvent); } else if ((strcmp(vObjectName(curVO), VCVersionProp) == 0) || (strcmp(vObjectName(curVO), VCProdIdProp) == 0) || (strcmp(vObjectName(curVO), VCTimeZoneProp) == 0)) { // do nothing, we know these properties and we want to skip them. // we have either already processed them or are ignoring them. ; } else { ; } 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: " // << icalcomponent_as_ical_string(c) << endl; QString errorMessage; icalproperty *error; error = icalcomponent_get_first_property(c,ICAL_XLICERROR_PROPERTY); while(error) { errorMessage += icalproperty_get_xlicerror(error); errorMessage += "\n"; error = icalcomponent_get_next_property(c,ICAL_XLICERROR_PROPERTY); } // kdDebug(5800) << "ICalFormatImpl:extractErrorProperty: " << errorMessage << endl; return errorMessage; } |