static Akonadi::Collection detatchCollection(const Akonadi::Collection &collection) { //HACK: Attributes are accessed via a const function, and the implicitly shared private pointer thus doesn't detach. //We force a detach to avoid surprises. (RetrieveItemsTask used to write back the collection changes, even though the task was canceled) //Once this is fixed this function can go away. Akonadi::Collection col = collection; col.setId(col.id()); return col; }
void VirtualResource::reset() { Q_ASSERT(mRootCollection.isValid()); Akonadi::Collection col = mRootCollection; CollectionDeleteJob *d = new CollectionDeleteJob(mRootCollection, mSession); EXEC(d); col.setId(-1); createRootCollection(col); }