18 #ifndef ELEMENTS_COLLECTION_CACHE_H 19 #define ELEMENTS_COLLECTION_CACHE_H 21 #include <QSqlDatabase> 49 bool cacheName(
const QString &path,
const QUuid &uuid = QUuid::createUuid());
50 bool cachePixmap(
const QString &path,
const QUuid &uuid = QUuid::createUuid());
void setLocale(const QString &)
QString current_name_
Last name fetched.
QString pixmapStorageFormat() const
~ElementsCollectionCache() override
bool cachePixmap(const QString &path, const QUuid &uuid=QUuid::createUuid())
ElementsCollectionCache::cachePixmap Cache the current (i.e. last retrieved) pixmap.
QPixmap current_pixmap_
Last pixmap fetched.
QSqlQuery * select_pixmap_
Prepared statement to fetch pixmaps from the cache.
QString pixmap_storage_format_
Storage format for cached pixmaps.
bool cacheName(const QString &path, const QUuid &uuid=QUuid::createUuid())
ElementsCollectionCache::cacheName Cache the current (i.e. last retrieved) name The cache entry will ...
ElementsCollectionCache(const QString &database_path, QObject *=nullptr)
QSqlQuery * insert_pixmap_
Prepared statement to insert pixmaps into the cache.
bool fetchNameFromCache(const QString &path, const QUuid &uuid)
ElementsCollectionCache::fetchNameFromCache Retrieve the name for an element, given its path and uuid...
bool fetchData(const ElementsLocation &)
bool fetchPixmapFromCache(const QString &path, const QUuid &uuid)
ElementsCollectionCache::fetchPixmapFromCache Retrieve the pixmap for an element, given its path and ...
bool fetchElement(ElementsLocation &location)
ElementsCollectionCache::fetchElement Retrieve the data for a given element, using the cache if avail...
QSqlDatabase cache_db_
Object providing access to the SQLite database this cache relies on.
QSqlQuery * insert_name_
Prepared statement to insert names into the cache.
QSqlQuery * select_name_
Prepared statement to fetch names from the cache.
bool setPixmapStorageFormat(const QString &)
QString locale_
Locale to be used when dealing with names.