[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    Re: [Kde-pim] How to resolve Item/Collection from ID?
From:       Christian Mollekopf <chrigi_1 () fastmail ! fm>
Date:       2013-04-24 13:43:25
Message-ID: 1545845.1UYvjUPCPp () localhost ! localdomain
[Download RAW message or body]

On Wednesday 24 April 2013 14.37:43 Jonathan Marten wrote:
> I'm working on the command line Akonadi copier/syncer which I mentioned
> a while ago, which is coming along well.  The means of specifying
> items or collections will be by numeric ID - a path may be more
> friendly, but for that to be possible Akonadi::CollectionPathResolver
> will have to become a public interface.
> 
> So my quick question: given a numeric Akonadi::Entity ID, what is the
> simplest/cheapest way to determine whether this is an Item, a
> Collection, or neither?  Preferably by a means that does not involve
> too many round trips to the Akonadi server.

Try a CollectionFetchJob, if that returns an invalid collection it's an Item.
If you don't know if the Item Id is valid, you have to use an ItemFetchJob as 
well. You can fetching actual data using the fetchscope.

One roundtrip per fetchjob AFAIK.

Cheers,
Christian
_______________________________________________
KDE PIM mailing list kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic