Gravatar::GravatarCache Class

Cache for both positive and negative avatar lookups Author: Laurent Montel <montel@kde.org>. More...

Header: #include <Gravatar/GravatarCache>
CMake: find_package(KPim6Gravatar REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::Gravatar)

Public Functions

GravatarCache()
~GravatarCache()
void clear()
void clearAllCache()
QPixmap loadGravatarPixmap(const Gravatar::Hash &hash, bool &gravatarStored, int size)
int maximumSize() const
void saveGravatarPixmap(const Gravatar::Hash &hash, const QPixmap &pixmap, int size)
void saveMissingGravatar(const Gravatar::Hash &hash)
void setMaximumSize(int maximumSize)

Static Public Members

Gravatar::GravatarCache *self()

Detailed Description

Member Function Documentation

GravatarCache::GravatarCache()

Constructs a Gravatar cache.

[noexcept] GravatarCache::~GravatarCache()

Destroys the Gravatar cache.

void GravatarCache::clear()

Clears the current cache.

void GravatarCache::clearAllCache()

Clears all cached Gravatar data.

QPixmap GravatarCache::loadGravatarPixmap(const Gravatar::Hash &hash, bool &gravatarStored, int size)

Loads a Gravatar pixmap from the cache. hash the hash to look up gravatarStored whether the Gravatar was found in cache size the requested pixmap size, part of the cache key Returns the cached Gravatar pixmap if found, otherwise a null pixmap

int GravatarCache::maximumSize() const

Returns the maximum cache size in bytes. Returns the maximum cache size

See also setMaximumSize().

void GravatarCache::saveGravatarPixmap(const Gravatar::Hash &hash, const QPixmap &pixmap, int size)

Saves a Gravatar pixmap to the cache. hash the hash associated with the pixmap pixmap the pixmap to save size the requested pixmap size, part of the cache key

void GravatarCache::saveMissingGravatar(const Gravatar::Hash &hash)

Records a missing Gravatar for the given hash. hash the hash for which no Gravatar was found

[static] Gravatar::GravatarCache *GravatarCache::self()

Returns the singleton instance of GravatarCache. Returns the GravatarCache singleton instance

void GravatarCache::setMaximumSize(int maximumSize)

Sets the maximum cache size in bytes. maximumSize the maximum size in bytes

See also maximumSize().