[Kde-pim] Does an Akonadi resource know what Collection it's handling?

Kevin Krammer kevin.krammer at gmx.at
Wed May 26 09:18:41 BST 2010


On Wednesday, 2010-05-26, David Jarvie wrote:
> In the implementation of a resource (specifically KAlarmResource, inherited
> from ICalResourceBase), is it possible for it to know which Collection its
> calendar data belongs to? I need to know in the resource whether the
> Collection is read-only or not. I checked the API documentation for its
> base classes, but it isn't clear whether the Collection identity can be
> determined by the resource.

A resource can at any time fetch collections and items it has originally 
provided through retrieveCollections() and retrieveItems() by using the same 
remoteId on the parameter to CollectionFetchJob or ItemFetchJob.

So, if for example one of the collections you provided at 
retrieveCollections() was given a remoteId of "MyCollection" you can get this 
collection at any time by doing this

Collection collection;
collection.setRemoteId( "MyCollection" );
CollectionFetchJob *job =
  new CollectionFetchJob( collection, CollectionFetchJob::Base );

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/20100526/93df7059/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