[Kde-pim] Still having trouble creating akonadi resource

Stephen Kelly steveire at gmail.com
Fri Jan 2 18:24:48 GMT 2009


Stephen Kelly wrote:

> I've got a non BC solution as a proof of concept. More on that coming
> later too so we can figure out how to make it BC.

Attached are non-BC patches to kdesupport/akonadi and kdepimlibs/akonadi.
They do work, but I'm not sure if I've done it all correctly. We need to
figure out a BiC way of making the changes to AgentBase.h.

If you want to try it out, you can again use the kjotsrewriteapp. If you
move a collection or item, you get debug output from the resource like:

[/home/kde-devel/kde/bin/akonadi_kjots_resource] akonadi_kjots_resource(307)
KJotsResource::collectionMoved: "bat.kjbook" "foo.kjbook" "bar.kjbook" 87

(Bat Book moved from Foo to Bar)

[/home/kde-devel/kde/bin/akonadi_kjots_resource] akonadi_kjots_resource(806)
KJotsResource::itemMoved: "foo.kjpage" "foo.kjbook" "bat.kjbook" 91

(Foo Page moved from Foo to Bar).

I'm not sure if AgentBase::Observer::itemMoved is something that will be
used in the future, or something that's obcolete, so I implemented those
methods anyway.

Also, while looking through datastore.cpp, I noticed that there are some
signals being emitted even if they don't need to be.

Akonadi::DataStore::updatePimItem seems to be called only when an item is
moved, and signals that the source collection and destination collection
have changed. I don't think there's any need for that.

Akonadi::DataStore::renameLocation seems to be called only when a collection
is moved (parent changed) or it gets renamed. After my patch, it emits
collectionMoved iff it was moved, but it still emits collectionChanged even
if that is not necessary. If it's a move, it should be enough to send a
moved signal and not a changed signal. I don't know if it could possibly be
both, but that could be handled too if it is.

Best regards,

Steve.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: collectionanditemmoved.patch
Type: text/x-diff
Size: 14798 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20090102/6fa07eed/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: servercollectionmove.patch
Type: text/x-diff
Size: 7047 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20090102/6fa07eed/attachment-0001.patch>
-------------- 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