[Kde-pim] Re: How can a resource identify its Collection?

Kevin Krammer kevin.krammer at gmx.at
Wed Mar 2 17:48:08 GMT 2011


On Wednesday, 2011-03-02, David Jarvie wrote:
> In a resource which only has a single Collection, how can the resource
> identify its Collection so that it can call ItemCreateJob, ItemModifyJob
> etc on the collection? The remote id of the collection is known, but not
> the Akonadi id.
> 
> Following Kevin's suggestion, I tried the following code to create a new
> item within the resource, but the the job returns with the error
>     "Unknown error. (Unknown collection.)"
> 
> Collection c;
> c.setParentCollection(Collection::root());
> c.setRemoteId(directoryName());
> Item item;
> // ... set item mime type and payload
> item.setParentCollection(c);
> ItemCreateJob* job = new ItemCreateJob(item, c);
> 
> I checked with debug output that the remote ID for the collection is the
> same as in the Akonadi database. I wonder if something else has to be done
> to enable collections to be found by their remote IDs?

I assumed this would work, i.e. a resource being allowed to address its 
entities by remoteId :(
But it seems that at least the ItemCreateJob always uses the collection.id() 
when sending the APPEND command.

Seems you have to fetch your root collection once, but maybe Volker has 
another idea?

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/20110302/f50bd923/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