[Kde-pim] Questionable approach in kcal calendar loading

David Jarvie lists at astrojar.org.uk
Sun Jul 8 20:23:35 BST 2007


On Thursday 05 July 2007 13:55:40 David Jarvie wrote:
> On Thursday 5 July 2007 13:39, David Jarvie wrote:
> > 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.
>
> Of course, a better approach might be to delete all incidences at the
> start of populate(). That way, no old data will remain. I should get out
> of the habit of getting up at 5 am to travel home - it badly corrupts the
> mental processes. ;)

Any comments on this? I don't feel confident in deleting all old incidences, 
in case there are any side effects. But I'll go ahead and try it if nobody 
thinks it is a bad idea.

-- 
David Jarvie.
KAlarm author and 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