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

David Jarvie djarvie at kde.org
Fri Nov 12 20:04:38 GMT 2010


On Friday 12 November 2010 01:03:43 Sérgio Martins wrote:
> 2010/11/11 David Jarvie <djarvie at kde.org>:
> > On Thursday 11 November 2010 20:31:53 Sérgio Martins wrote:
> >> 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.
> >
> > Can you please clarify how to delete a sub-collection. Do you mean that it isn't possible to delete a sub-collection without deleting its backend data, or what?
> 
> I haven't looked at the API for some time now, but I think it's not
> possible to delete a sub-collection without deleting its backend data.
> 
> I also can't think of any use case where you might want to do that.
> What does it even mean?
> IMHO, the collection hierarchy that an akonadi resource provides
> always reflects the data structures that exist in the backend.

Just to be sure, is a sub-collection simply any collection with a non-root parent collection?

-- 
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/20101112/2127b2a2/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