[Kde-pim] Re: collection of akonadiitems

Christian Mollekopf chrigi_1 at fastmail.fm
Sun Mar 20 15:09:48 GMT 2011


On Sunday 20 March 2011 09:27:14 Gerd Fleischer wrote:
> Hi,
> 
> I have a list of items retreived by itemfetchjob, fullpayload is fetched,
> what is the easiest way to get the collection of an item?
> item.parentCollection() is empty.
> 
Hey,

You can get the collection id directly by setting the ItemFetchScope 
correcectly:

job->fetchScope().setAncestorRetrieval( Akonadi::ItemFetchScope::Parent );

item.parentCollection() will then return a collection with the correct id.
If you need more infos than only the id, you will need to run an explicit 
collectionfetch job for the parent collection, though.

Cheers,

Chris

> Thanks, Gerd
> _______________________________________________
> 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/
_______________________________________________
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