bool Delete::deleteRecursive(Collection &col) { Collection::List children = col.children(); for (Collection &child : children) { if (!deleteRecursive(child)) { return false; } } DataStore *db = connection()->storageBackend(); return db->cleanupCollection(col); }
void ResourceManager::removeResourceInstance(const QString &name) { DataStore *db = DataStore::self(); // remove items and collections Resource resource = Resource::retrieveByName(name); if (resource.isValid()) { const QVector<Collection> collections = resource.collections(); Q_FOREACH (/*sic!*/ Collection collection, collections) { db->cleanupCollection(collection); } // remove resource resource.remove(); }