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

Kevin Krammer kevin.krammer at gmx.at
Mon Aug 1 13:22:04 BST 2011


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.

Cheers,
Kevin
-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20110801/a0483b4d/attachment.sig>
-------------- next part --------------
_______________________________________________
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