[Kde-pim] Re: Akonadi resource: How to update item if backend data changed

rgruber at users.sourceforge.net rgruber at users.sourceforge.net
Wed Jun 8 18:48:14 BST 2011


Hi!

First of all thanks for the replies, although I'm a bit more confused now :(

At first David Jarvie said one must use ItemModifyJob. But I thought ItemModifyJob is ment for external programs that want to modify an Item in the Akonadi store. Like e.g. a program might use it to change the details of a contact or set a different start time for an event. Wouldn't a ItemModifyJob result in a call to itemChanged() of my resource? Because this definately must not happen. Because in itemChanged() I would need some code that tries to change the data on the backend.

Kevin Krammer suggested to call synchronize() or synchronizeCollection(). But I'm already inside of retrieveItems(), calling synchronize() will only recall retrieveItems(). And I would still have the problem that retrieveItem() will not be called for the changed items.


The API doc of itemsRetrievedIncremental() for the first parameter says "Items changed in the backend". So is this wrong? Should it say "New items in the backend" instead? 

If I really must use ItemModifyJob to update, I would need to retrieve all the data for the item inside of the retrieveItems() method. What is the retrieveItem() for then? Only to fetch data for new items? 


So many questions :) I hope someone with a greater insight on how Akonadi works internally can help me out.

Thanks, Robert


PS: I already checked out the openchange akonadi resource from playground a while ago. Unfortunately it's in a bad state. I was not even able to compile it with the latest libmapi/libmapi++ that kubuntu come with. After I brought it to compile it instantly crashed when trying to synchronize it.

_______________________________________________
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