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

David Jarvie djarvie at kde.org
Mon Feb 28 09:54:45 GMT 2011


On Mon, February 28, 2011 9:42 am, Kevin Krammer wrote:
> On Monday, 2011-02-28, David Jarvie wrote:
>> Can somebody tell me how an Akonadi resource can notify the server that
>> unsolicited updates have occurred. In writing the KAlarm directory
>> resource (1 file per alarm), I want the resource to update whenever
>> externally triggered changes occur to files in the directory
>> (creations/changes/deletions). The resource sees these via KDirWatch
>> signals, but I can't find a way of telling the server about the changes
>> (via synchronize(), itemsRetrievedIncremental() etc) which doesn't
>> result
>> in either no update occurring or a full resynchronisation. In these
>> cases,
>> only the single file/alarm affected should be updated in the server - it
>> shouldn't result in a complete reload of all files.
>
> I think you can use an ItemModifyJob for that, just like any application
> would modify an item in Akonadi.
> As a resource you don't have to get the item from Akonadi first, you can
> address it using remoteId for item the item's parent collection.

Thanks, Kevin. I never thought of a resource being able to use jobs, but
that sounds a plausible way of doing it.

> Do you have a collection hierachy or only one top level collection
> containing the items?

The resource contains just one collection.

-- 
David Jarvie.
KDE developer.
KAlarm author - http://www.astrojar.org.uk/kalarm

_______________________________________________
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