From cfa6b4114cea52b167caaaeb417f98f83edd690f Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 27 Aug 2010 23:01:53 +0000 Subject: Initial (i.e. read only) support for RECURRENCE-ID modified incidence series. Write support requires further debugging and/or compliance checks with respect to Zimbra; there is no obvious reason why it should not be working but Zimbra fails with 409 when saving. User interface support is mostly complete, with event links being tracked across deletes. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1168937 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kresources/caldav/resource.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'kresources/caldav') diff --git a/kresources/caldav/resource.cpp b/kresources/caldav/resource.cpp index 4e1542029..462cd6290 100644 --- a/kresources/caldav/resource.cpp +++ b/kresources/caldav/resource.cpp @@ -506,16 +506,24 @@ TQString ResourceCalDav::getICalString(const Incidence::List& inc) { CalendarLocal loc(timeZoneId()); TQString data = ""; + TQString header = ""; + TQString footer = ""; ICalFormat ical; + // Get the iCal header and footer + header = ical.toString(&loc); + int location = header.find("END:VCALENDAR", 0, true); + footer = header.mid(location, 0xffffffff); + header.remove("END:VCALENDAR"); + + data = data + header; // NOTE: This is very susceptible to invalid entries in added/changed/deletedIncidences // Be very careful with clearChange/clearChanges, and be sure to clear after load and save... for(Incidence::List::ConstIterator it = inc.constBegin(); it != inc.constEnd(); ++it) { Incidence *i = (*it)->clone(); - loc.addIncidence(i); + data = data + ical.toString(i, &mCalendar); } - - data = ical.toString(&loc); + data = data + footer; return data; } -- cgit v1.2.1