[Kde-pim] Questionable approach in kcal calendar loading

David Jarvie lists at astrojar.org.uk
Thu Jul 5 13:39:01 BST 2007


While investigating a bug where KOrganizer (trunk) crashes if a calendar
containing time zones is reloaded (by deselecting and subsequently
reselecting a resource), I noticed that reloading a calendar doesn't work
quite as I would expect.

In ICalFormatImpl::populate(), incidences parsed from the source calendar
are only added to the KCal::Calendar if the uid doesn't already exist.
When KOrganizer reloads the calendar resource, the KCal::Calendar still
contains the previous incidences when populate() is called. As a result,
this method of eliminating duplicate uids discards the newly parsed
information in favour of the previous version of all incidences which
previously existed. So, if any incidences have changed, the changes will
be lost.

I don't know whether there are any KDE 3 bug reports which might be due to
this behaviour, but there may well be some. And as it happens, when a
duplicate uid was found, the new incidence wasn't deleted, resulting in a
memory leak - this is now fixed in trunk.

I propose to change the behaviour so that if a duplicate uid is found, the
old incidence will be deleted and replaced with the new one. This should
apply to both KDE 3 and 4. Please comment if you think my analysis is
wrong, or if the change might have any undesirable side effects.

-- 
David Jarvie.
KAlarm author & maintainer.
http://www.astrojar.org.uk/kalarm

_______________________________________________
kde-pim mailing list
kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/



More information about the kde-pim mailing list