digiKam
|
Public Member Functions | |
QString | albumRelativePath (int albumId) |
void | cacheByName (const QExplicitlySharedDataPointer< ItemInfoData > &infoPtr) |
void | dropInfo (const QExplicitlySharedDataPointer< ItemInfoData > &infoPtr) |
int | getImageGroupedCount (qlonglong id) |
QExplicitlySharedDataPointer< ItemInfoData > | infoForId (qlonglong id) |
QExplicitlySharedDataPointer< ItemInfoData > | infoForPath (int albumRootId, const QString &relativePath, const QString &name) |
void | invalidate () |
ItemInfoCache () | |
~ItemInfoCache () override | |
Digikam::ItemInfoCache::ItemInfoCache | ( | ) |
References Digikam::CoreDbAccess::databaseWatch().
|
override |
QString Digikam::ItemInfoCache::albumRelativePath | ( | int | albumId | ) |
Returns the cached relativePath for the given album id.
Referenced by Digikam::ItemInfo::filePath().
void Digikam::ItemInfoCache::cacheByName | ( | const QExplicitlySharedDataPointer< ItemInfoData > & | infoPtr | ) |
Call this to put data in the hash by file name if you have newly created data and the name is filled. Call under write lock.
References Digikam::ItemInfoData::id, and Digikam::ItemInfoData::name.
Referenced by Digikam::ItemInfo::fromLocationAlbumAndName(), Digikam::ItemInfo::ItemInfo(), and Digikam::ItemInfo::setName().
void Digikam::ItemInfoCache::dropInfo | ( | const QExplicitlySharedDataPointer< ItemInfoData > & | infoPtr | ) |
Call this when the data has been dereferenced, before deletion.
References Digikam::ItemInfoData::id, and Digikam::ItemInfoData::name.
Referenced by Digikam::ItemInfo::operator=(), and Digikam::ItemInfo::~ItemInfo().
int Digikam::ItemInfoCache::getImageGroupedCount | ( | qlonglong | id | ) |
Returns the cached grouped count for the given image id.
References Digikam::CoreDbAccess::db(), Digikam::CoreDB::getRelatedImagesToByType(), and Digikam::DatabaseRelation::Grouped.
Referenced by Digikam::ItemInfo::numberOfGroupedImages().
QExplicitlySharedDataPointer< ItemInfoData > Digikam::ItemInfoCache::infoForId | ( | qlonglong | id | ) |
Return an ItemInfoData object for the given image id. A new object is created, or an existing object is returned. If a new object is created, the id field will be initialized.
References Digikam::ItemInfoData::id.
Referenced by Digikam::ItemInfo::fromLocationAlbumAndName(), and Digikam::ItemInfo::ItemInfo().
QExplicitlySharedDataPointer< ItemInfoData > Digikam::ItemInfoCache::infoForPath | ( | int | albumRootId, |
const QString & | relativePath, | ||
const QString & | name | ||
) |
Return an ItemInfoData object for the given album root, relativePath and file name triple. Works if previously cached with cacheByName. Returns 0 if not found.
Referenced by Digikam::ItemInfo::fromLocationAlbumAndName().
void Digikam::ItemInfoCache::invalidate | ( | ) |
Invalidate the cache and all its cached data
Referenced by Digikam::CoreDbAccess::setParameters().