author | zautrix <zautrix> | 2005-02-13 11:55:52 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-13 11:55:52 (UTC) |
commit | 0a33f91e166747406ca2ccb5819881feeecfdb40 (patch) (side-by-side diff) | |
tree | e9130a16aaa6365e106d6733c3e1adeca01f72ac /libkcal/icalformatimpl.cpp | |
parent | 00ec9899a4727a4c9100d320935dde7da4803801 (diff) | |
download | kdepimpi-0a33f91e166747406ca2ccb5819881feeecfdb40.zip kdepimpi-0a33f91e166747406ca2ccb5819881feeecfdb40.tar.gz kdepimpi-0a33f91e166747406ca2ccb5819881feeecfdb40.tar.bz2 |
todo recurchanges
-rw-r--r-- | libkcal/icalformatimpl.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index bd13132..bb9cb29 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp @@ -371,65 +371,68 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence) incidence->relatedTo()->uid().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(); Alarm* alarm; for (alarm = alarms.first(); alarm; alarm = alarms.next()) { if (alarm->enabled()) { kdDebug(5800) << "Write alarm for " << incidence->summary() << endl; icalcomponent_add_component(parent,writeAlarm(alarm)); } } - + if( incidence->hasRecurrenceID() ) { + icalcomponent_add_property(parent, + icalproperty_new_recurrenceid( writeICalDateTime( incidence->recurrenceID()))); + } // duration // turned off as it always is set to PTS0 (and must not occur together with DTEND // if (incidence->hasDuration()) { // icaldurationtype duration; // duration = writeICalDuration(incidence->duration()); // icalcomponent_add_property(parent,icalproperty_new_duration(duration)); // } } void ICalFormatImpl::writeIncidenceBase(icalcomponent *parent,IncidenceBase *incidenceBase) { icalcomponent_add_property(parent,icalproperty_new_dtstamp( writeICalDateTime(QDateTime::currentDateTime()))); // organizer stuff icalcomponent_add_property(parent,icalproperty_new_organizer( ("MAILTO:" + incidenceBase->organizer()).utf8())); // attendees if (incidenceBase->attendeeCount() != 0) { QPtrList<Attendee> al = incidenceBase->attendees(); QPtrListIterator<Attendee> ai(al); for (; ai.current(); ++ai) { icalcomponent_add_property(parent,writeAttendee(ai.current())); } } // custom properties writeCustomProperties(parent, incidenceBase); } @@ -1175,64 +1178,69 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent,Incidence *incidence) incidence->setDtStart(readICalDateTime(icaltime)); } break; case ICAL_DURATION_PROPERTY: // start date and time icalduration = icalproperty_get_duration(p); incidence->setDuration(readICalDuration(icalduration)); break; case ICAL_DESCRIPTION_PROPERTY: // description text = icalproperty_get_description(p); incidence->setDescription(QString::fromUtf8(text)); break; case ICAL_SUMMARY_PROPERTY: // summary { text = icalproperty_get_summary(p); incidence->setSummary(QString::fromUtf8(text)); } break; case ICAL_STATUS_PROPERTY: // summary { if ( ICAL_STATUS_CANCELLED == icalproperty_get_status(p) ) incidence->setCancelled( true ); } break; case ICAL_LOCATION_PROPERTY: // location text = icalproperty_get_location(p); incidence->setLocation(QString::fromUtf8(text)); break; + case ICAL_RECURRENCEID_PROPERTY: + icaltime = icalproperty_get_recurrenceid(p); + incidence->setRecurrenceID( readICalDateTime(icaltime) ); + qDebug(" RecurrenceID %s",incidence->recurrenceID().toString().latin1() ); + break; #if 0 // status if ((vo = isAPropertyOf(vincidence, VCStatusProp)) != 0) { incidence->setStatus(s = fakeCString(vObjectUStringZValue(vo))); deleteStr(s); } else incidence->setStatus("NEEDS ACTION"); #endif case ICAL_PRIORITY_PROPERTY: // priority intvalue = icalproperty_get_priority(p); incidence->setPriority(intvalue); break; case ICAL_CATEGORIES_PROPERTY: // categories text = icalproperty_get_categories(p); categories.append(QString::fromUtf8(text)); break; //******************************************* case ICAL_RRULE_PROPERTY: // we do need (maybe )start datetime of incidence for recurrence // such that we can read recurrence only after we read incidence completely readrec = true; rectype = icalproperty_get_rrule(p); break; case ICAL_EXDATE_PROPERTY: icaltime = icalproperty_get_exdate(p); incidence->addExDate(readICalDate(icaltime)); break; |