Ejemplo n.º 1
0
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);
}
Ejemplo n.º 2
0
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();
    }