[Kde-pim] Re: ItemFetchJob AncestorRetrieval

Christian Mollekopf chrigi_1 at fastmail.fm
Sat Mar 12 11:42:24 GMT 2011


On Saturday 12 March 2011 09:31:43 Volker Krause wrote:
> On Monday 07 March 2011 16:52:00 Christian Mollekopf wrote:
> > Hi,
> > 
> > I tried retreiving the parent collection of an item using:
> > itemFetchJob-
> > 
> > >fetchScope().setAncestorRetrieval(Akonadi::ItemFetchScope::Parent);
> > 
> > I'm doing this to figure out in which resource the item is in. So after
> > retrieving the item I tried to access the resource identifier with:
> > item.parentCollection().resource(), but that just returns an empty string
> > (the whole collection only contains the id, thats all).
> 
> if resource() is all you want to call on the parent, then you don't need
> that at all, resource() returns the same for all collections of the same
> resource, no matter where they are in the hierarchy.

Yes, I thought I could avoid an extra CollectionFetchJob and get the resource 
directly with the ItemFetchJob by setting the ItemFetchScope.
I simply fetch the parent collection now.

Cheers,

Chris
> 
> regards
> Volker
_______________________________________________
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