[Kde-pim] Re: Handling external updates for an Akonadi resource

David Jarvie djarvie at kde.org
Mon Feb 28 23:15:50 GMT 2011


On Monday 28 February 2011 10:04:49 Kevin Krammer wrote:
> On Monday, 2011-02-28, David Jarvie wrote:
> > On Mon, February 28, 2011 9:42 am, Kevin Krammer wrote:
> > > Do you have a collection hierachy or only one top level collection
> > > containing the items?
> > 
> > The resource contains just one collection.
> 
> In this case it should be rather simple.
> Basically create the minimum collection and the minimum item and the create 
> the item modify job with that
> 
> // just like when creating the instance for retrieveCollections, e.g.
> Collection collection;
> collection.remoteId("whatever");
> collection.setParentCollection( Collection::root() );
> 
> Item item( "your/mimetype" );
> item.setParentCollection( collection );
> 
> // payload, maybe modify remoteRevision
> 
> ItemModifyJob *job = new ItemModifyJob( item );

I haven't tried changing an item yet, but it doesn't work so far when creating a new item - 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 that the remote ID for the collection is the same as in the Akonadi database. I wonder if there is some condition required to enable collections to be found by their remote IDs?

-- 
David Jarvie.
KDE developer.
KAlarm author -- http://www.astrojar.org.uk/kalarm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20110228/3bc6f978/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