[Kde-pim] New methods for Akonadi::EntityTreeModel

Kevin Krammer kevin.krammer at gmx.at
Sat May 8 09:48:40 BST 2010


On Saturday, 2010-05-08, David Jarvie wrote:
> I'd like to add two new methods to Akonadi::EntityTreeModel, to fetch the
>  Collection or Item corresponding to a given Id. This is something I need
>  to do quite frequently in KAlarm, and, since this is an easy lookup in
>  EntityTreeModel, it seems a good idea to provide simple methods to do
>  this, rather than having to search the model for the Id and then fetch the
>  Collection or Item via the data() method.

Hmm, this has the advantage over direct retrieval of being synchronous but it 
only works for entities that are already in the model, while explicit 
retrieval works as long as the entity exists at all.

But if this is a common use case, i.e. to have the id, knowing that it is in 
the model but not having the entity itself, then why not.

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/20100508/6c304e82/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