[Kde-pim] KJots on Akonadi. Help needed.

Stephen Kelly steveire at gmail.com
Thu Oct 9 23:45:48 BST 2008


Hi,

I've made some more progress in the form of a CollectionAndItemModel class,
but I think I still need akonadi/model-view help. The plasmoid now shows
the CollectionModel and the items in the Bookshelf. In order to do this I
had to promote CollectionModel::indexForId(Id) from private to protected.
Patch attached. Can I apply it?

I think I need to make use of the signals/slots available to make it work.
Can anyone give me a pointer on what in particular I need to do? Currently
I have fetchItems getting the books and the pages within them, but that
doesn't seem to work with nested books. I tried to use onRowsInserted
instead, but it made modeltest.cpp assert, and I'm not sure why. Possibly
something to do with the beginInsertRows stuff? I think I'll also hit
issues with beginInsertRows being called in the superclass too.

If the model worked, it would list child collections followed by child items
in the tree. My intention is to sort that with a proxy model and a
EntityItemAboveAttribute.

The root item of the model should be the Bookshelf, but currently it is
Akonadi::Collection::root(). I tried various things with index, parent etc,
but only succeeded in breaking the model. What is the correct way to do
that? My first thought would be QTreeView::setRootIndex, but I can't easily
acquire the index of the Bookshelf in the model, which I would need to use
that method.

I started the plasmoid without having the kjots resource loaded in akonadi
and it asserted on the collectionfetchjob. I have Akonadi::Control to start
the server, but is there some way to determine if my resource is loaded?

Any other pointers on how I should proceed next? Can this be better designed
for code-sharing between the other two models? I think a lot of the item
handling in the ItemModel will need to be duplicated here. Can something
like this get into akonadi? 

Also,
Does the Monitor::itemMoved signal get emitted when an item is moved to and
from the same model? Can that be made happen if not?

All the best,

Steve.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: promoteIndexForId.patch
Type: text/x-diff
Size: 5517 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20081009/3bdfbceb/attachment.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