[Kde-pim] Re: Does Akonadi::CollectionDeleteJob delete the backend data?

Sérgio Martins iamsergio at gmail.com
Thu Nov 11 20:31:53 GMT 2010


2010/11/11 David Jarvie <djarvie at kde.org>:
> On Thursday 11 November 2010 19:24:43 Sérgio Martins wrote:
>> 2010/11/11 David Jarvie <djarvie at kde.org>:
>> > When I call CollectionDeleteJob, the backend data is deleted. (To be precise, the backend calendar is emptied of all events, but the empty calendar file remains.) Is this the intended behaviour, or should it simply delete the collection from Akonadi storage and leave the backend untouched? The apidox is unclear on this. As far as I can tell, I'm not doing anything else to cause the data to be lost.
>>
>> No, you're not doing anything else, I remember we had the same problem
>> in korganizer.
>>
>> We ended up deleting the agent instead ( which removes collections
>> too, and doesn't touch backend data ):
>>
>>       const Akonadi::AgentInstance instance =
>> Akonadi::AgentManager::self()->instance( collection.resource() );
>>       if ( instance.isValid() ) {
>>         Akonadi::AgentManager::self()->removeInstance( instance );
>>       }
>
> Thanks Sérgio, that does the trick. I'll update the apidox to clarify this.

Note that if it's a sub-collection you probably don't want to delete
the agent ( will delete parent collection ), and just want to delete
collection+data.


Regards,
Sérgio Martins
_______________________________________________
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