[Kde-pim] Re: ItemFetchJob AncestorRetrieval

Kevin Krammer kevin.krammer at gmx.at
Mon Mar 7 19:25:02 GMT 2011


On Monday, 2011-03-07, Christian Mollekopf wrote:
> On Monday 07 March 2011 20:02:56 Kevin Krammer wrote:
> > On Monday, 2011-03-07, 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).
> > > 
> > > So, where are those retrieved ancestor collections available?
> > 
> > I am afraid the ancestor retrieval only fetches information to correctly
> > address the collections (IIRC Akonadi ID and Remote ID).
> > To get any information about the collection you'll have to fetch it based
> > on what item.parentCollection() returns.
> 
> I see....
> Thanks again =)

Just for context:

Initially the answer to an item fetch command always only contained the item's 
parent collection, which at that point seemed to be sufficient.

However, when working with only remote IDs, two entities with different parent 
collections could have the same remote ID, so it became necessary to allow 
retrieval of the "path to root" during fetch.

I think that you will even get the immediate parent even if you do not change 
the ancestor retrieval option.

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/20110307/3daf6889/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