Commit a701a08c authored by Boudewijn Rempt's avatar Boudewijn Rempt

Start implementing the intial addition of tags to the cache db

parent d7a84cef
...@@ -428,14 +428,21 @@ bool KisResourceCacheDb::addResources(KisResourceStorageSP storage, QString reso ...@@ -428,14 +428,21 @@ bool KisResourceCacheDb::addResources(KisResourceStorageSP storage, QString reso
return true; return true;
} }
bool KisResourceCacheDb::addTag(KisResourceStorageSP storage, QDateTime timestamp, KoResourceSP resource, const QString &resourceType) bool KisResourceCacheDb::addTag(KisResourceStorageSP storage, const QString &resourceType, const QString url, const QString name, const QString comment)
{ {
return false; return false;
} }
bool KisResourceCacheDb::addTags(KisResourceStorageSP storage, QString resourceType) bool KisResourceCacheDb::addTags(KisResourceStorageSP storage, QString resourceType)
{ {
return false; QSharedPointer<KisResourceStorage::TagIterator> iter = storage->tags(resourceType);
while(iter->hasNext()) {
iter->next();
if (!addTag(storage, resourceType, iter->url(), iter->name(), iter->comment())) {
qWarning() << "Could not add resource" << res->filename() << "to the database";
}
}
return true;
} }
bool KisResourceCacheDb::addStorage(KisResourceStorageSP storage, bool preinstalled) bool KisResourceCacheDb::addStorage(KisResourceStorageSP storage, bool preinstalled)
......
...@@ -71,7 +71,7 @@ private: ...@@ -71,7 +71,7 @@ private:
static bool addResource(KisResourceStorageSP storage, QDateTime timestamp, KoResourceSP resource, const QString &resourceType); static bool addResource(KisResourceStorageSP storage, QDateTime timestamp, KoResourceSP resource, const QString &resourceType);
static bool addResources(KisResourceStorageSP storage, QString resourceType); static bool addResources(KisResourceStorageSP storage, QString resourceType);
static bool addTag(KisResourceStorageSP storage, QDateTime timestamp, KoResourceSP resource, const QString &resourceType); static bool addTag(KisResourceStorageSP storage, const QString &resourceType, const QString url, const QString name, const QString comment);
static bool addTags(KisResourceStorageSP storage, QString resourceType); static bool addTags(KisResourceStorageSP storage, QString resourceType);
static bool addStorage(KisResourceStorageSP storage, bool preinstalled); static bool addStorage(KisResourceStorageSP storage, bool preinstalled);
......
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