Commit 300e706e authored by Boudewijn Rempt's avatar Boudewijn Rempt

We need to know the storage to add the resource

parent 3a9bfd4b
......@@ -255,8 +255,7 @@ bool KisResourceCacheDb::initialize(const QString &location)
return s_valid;
}
bool KisResourceCacheDb::addResource(KoResourceSP resource)
bool KisResourceCacheDb::addResource(KisResourceStorageSP storage, KoResourceSP resource)
{
bool r = true;
......@@ -270,7 +269,10 @@ bool KisResourceCacheDb::addResource(KoResourceSP resource)
return false;
}
// Check whether it already exists
// Insert it
return r;
}
......@@ -281,7 +283,7 @@ bool KisResourceCacheDb::addResources(KisResourceStorageSP storage, QString fold
while(iter.hasNext()) {
iter.next();
KoResourceSP res = iter.resource();
if (!addResource(res)) {
if (!addResource(storage, res)) {
qWarning() << "Could not add resource" << res->filename() << "to the database";
}
}
......
......@@ -66,7 +66,7 @@ private:
~KisResourceCacheDb();
KisResourceCacheDb operator=(const KisResourceCacheDb&);
static bool addResource(KoResourceSP resource);
static bool addResource(KisResourceStorageSP storage, KoResourceSP resource);
static bool addResources(KisResourceStorageSP storage, QString folder);
static bool addStorage(KisResourceStorageSP storage, bool preinstalled);
static bool synchronize(KisResourceStorageSP storage);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment