[Kde-pim] Question: KCal ResourceCalendar behavior

David Jarvie djarvie at kde.org
Wed Jan 30 17:06:27 GMT 2008


On Wednesday 30 January 2008 12:09, Kevin Krammer wrote:
> Hi Tobias,
>
> On Wednesday 30 January 2008, Tobias Koenig wrote:
>> On Wed, Jan 30, 2008 at 01:12:01AM +0100, Kevin Krammer wrote:
>> > Hello KCal devs,
>>
>> Hej Kevin,
>>
>> > I need your help regarding correct behavior of a resource
>> implementation.
>> >
>> > Should method which add/remove incidences directly modify the "stored"
>> > data or should the resource wait until save() is called?
>>
>> AFAIK the API of Akonadi::Resource is about righting back the items
>> immediately. There is no 'save()' call which can be executed by the user
>> explicitely, so if he wants that his changes appear on the groupware
>> server he would have to restart Akonadi so that all changes are written
>> out.
>
> Right, but we have a misunderstanding here.
> I am talking about KCal::ResourceCalendar, i.e. the calendar equivalent to
> KABC::Resource.
>
> In the KABC one I only read/write from/to Akonadi when load() or save()
> (or
> their async variants) are called, i.e. strict load/save behavior.
> I think this is what applications using KABC::AddressBook expect the
> resource
> to do, at least kabcclient does :)
>
> Since this is the first time I am actually working with the KCal API, I
> tried
> to implement it the same way, i.e. read/write from/to Akonadi in doLoad()
> and
> doSave().
> When testing with KOrganizer it seems that adding or changing an incidence
> results in doSave() (the variant with the incidence parameter) being
> called,
> however when I delete one, the normal doSave() does not seem to be called.

Updating an incidence in KCal::ResourceCalendar doesn't in itself save the
incidence. But if you're using KCal::ResourceCached, the save policy can
be set to automatically save whenever the calendar is updated, or to save
at regular intervals. KOrganizer may be using this facility.

I'm not certain whether deletions are handled any differently.

-- 
David Jarvie.
KAlarm author & maintainer.
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