27 static const QString resourceCacheDbFilename;
28 static const QString databaseVersion;
36 static bool isValid();
41 static QString lastError();
50 static bool initialize(
const QString &location);
53 static void deleteTemporaryResources();
56 static void performHouseKeepingOnExit();
61 static void setForeignKeysStateImpl(
bool isEnabled);
66 static bool getForeignKeysStateImpl();
72 static void synchronizeForeignKeysState();
77 friend class TestResourceLocator;
78 friend class TestResourceCacheDb;
93 static bool registerResourceType(
const QString &resourceType);
95 static QVector<int> resourcesForStorage(
const QString &resourceType,
const QString &storageLocation);
96 static int resourceIdForResource(
const QString &resourceFileName,
const QString &resourceType,
const QString &storageLocation);
97 static bool resourceNeedsUpdating(
int resourceId, QDateTime timestamp);
111 static bool removeResourceVersionImpl(
int resourceId,
int version,
KisResourceStorageSP storage);
113 static bool updateResourceTableForResourceIfNeeded(
int resourceId,
const QString &resourceType,
KisResourceStorageSP storage);
114 static bool makeResourceTheCurrentVersion(
int resourceId,
KoResourceSP resource);
115 static bool removeResourceCompletely(
int resourceId);
118 static bool getResourceIdFromFilename(QString filename, QString resourceType, QString storageLocation,
int &outResourceId);
120 static bool getResourceIdFromVersionedFilename(QString filename, QString resourceType, QString storageLocation,
int& outResourceId);
121 static bool getAllVersionsLocations(
int resourceId,
QStringList &outVersionsLocationsList);
128 static bool setResourceActive(
int resourceId,
bool active =
false);
130 static bool tagResource(
const QString &resourceFileName,
KisTagSP tag,
const QString &resourceType);
131 static bool hasTag(
const QString &url,
const QString &resourceType);
132 static bool linkTagToStorage(
const QString &url,
const QString &resourceType,
const QString &storageLocation);
133 static bool addTag(
const QString &resourceType,
const QString storageLocation,
KisTagSP tag);
149 static bool deleteStorage(QString location);
158 static QMap<QString, QVariant> metaDataForId(
int id,
const QString &tableName);
167 static bool updateMetaDataForId(
const QMap<QString, QVariant> map,
int id,
const QString &tableName);
168 static bool addMetaDataForId(
const QMap<QString, QVariant> map,
int id,
const QString &tableName);
176 static bool removeOrphanedMetaData();
179 static QString s_lastError;