[Kde-pim] Single file resources create new collection when re-reading backend file

David Jarvie djarvie at kde.org
Mon Aug 1 14:06:49 BST 2011


On Mon, August 1, 2011 1:22 pm, Kevin Krammer wrote:
> On Sunday, 2011-07-31, David Jarvie wrote:
>> The SingleFileResource base class does a clearCache() and synchronize()
>> when it re-reads the backend file (e.g. if it is changed by an external
>> process). This has the side effect that the resource's collection is
>> removed and a new one created. The way I've coded things in KAlarm, this
>> poses a problem, because KAlarm stores collection IDs to identify its
>> calendars. If a resource changes its collection ID, this makes KAlarm
>> think that the calendar has been deleted, and a new one created, when
>> all
>> that has really happened is that the calendar's contents have changed.
>>
>> Is there a good reason to create a new collection in these
>> circumstances,
>> or could this be changed to simply update the existing collection? If
>> recreating the collection is really a good thing, what is a better way
>> of
>> keeping track of resources/collections within applications so that the
>> link between a resource and its data isn't broken when this happens?
>
> I think this is rather a bug than done on purpose.
> If I remember correctly the resource would call synchronize() and thus
> asking Akonadi to retrieve all information again.
>
> The remote ID for the collection is the file name, IIRC, and thus should
> not change, which in turn should result in the same collection just being
> update.
>
> My guess is that whatever causes the original collection to be removed is
> the culprit here.

In that case, I'll investigate how to change this behaviour.

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