KVIrc  4.9.2
DeveloperAPIs
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Attributes | List of all members
KviAvatarCache Class Reference

Avatar cache handling class. More...

#include <KviAvatarCache.h>

Public Member Functions

void cleanup ()
 Deletes the cache. More...
 
void load (const QString &szFileName)
 Loads the cache. More...
 
const QString & lookup (const KviIrcMask &mask, const QString &szNetwork)
 Search a user in the cache and returns the id of the avatar. More...
 
void remove (const KviIrcMask &mask, const QString &szNetwork)
 Remove an avatar from the cache. More...
 
void replace (const QString &szIdString, const KviIrcMask &mask, const QString &szNetwork)
 Replaces a cached avatar. More...
 
void save (const QString &szFileName)
 Saves the cache. More...
 

Static Public Member Functions

static void done ()
 Destroys the avatar cache. More...
 
static void init ()
 Initializes the avatar cache. More...
 
static KviAvatarCacheinstance ()
 Returns the instance of the avatar cache. More...
 

Public Attributes

KviPointerHashTable< QString,
KviAvatarCacheEntry > * 
m_pAvatarDict
 

Protected Member Functions

 KviAvatarCache ()
 Constructs the avatar cache object. More...
 
 ~KviAvatarCache ()
 Destroys the avatar cache object. More...
 

Static Protected Attributes

static KviAvatarCachem_pAvatarCacheInstance = nullptr
 

Detailed Description

Avatar cache handling class.

Constructor & Destructor Documentation

KviAvatarCache::KviAvatarCache ( )
protected

Constructs the avatar cache object.

Returns
KviAvatarCache

References CACHE_DICT_SIZE, and m_pAvatarDict.

Referenced by init().

KviAvatarCache::~KviAvatarCache ( )
protected

Destroys the avatar cache object.

References m_pAvatarDict.

Member Function Documentation

void KviAvatarCache::cleanup ( )
void KviAvatarCache::done ( )
static

Destroys the avatar cache.

Returns
void

References m_pAvatarCacheInstance.

Referenced by KviApplication::~KviApplication().

void KviAvatarCache::init ( )
static

Initializes the avatar cache.

Returns
void

References KviAvatarCache(), and m_pAvatarCacheInstance.

Referenced by KviApplication::setup().

static KviAvatarCache* KviAvatarCache::instance ( )
inlinestatic
void KviAvatarCache::load ( const QString &  szFileName)
const QString & KviAvatarCache::lookup ( const KviIrcMask mask,
const QString &  szNetwork 
)

Search a user in the cache and returns the id of the avatar.

Parameters
maskThe mask of the user
szNetworkThe network where the user is on
Returns
const QString &

References e, KviQString::Empty, kvi_unixTime, m_pAvatarDict, KviIrcMask::mask(), KviIrcMask::NickCleanUserSmartNet, _KviAvatarCacheEntry::szIdString, and _KviAvatarCacheEntry::tLastAccess.

Referenced by KviConsoleWindow::checkDefaultAvatar().

void KviAvatarCache::remove ( const KviIrcMask mask,
const QString &  szNetwork 
)

Remove an avatar from the cache.

Parameters
maskThe mask of the user
szNetworkThe network where the user is on
Returns
void

References m_pAvatarDict, KviIrcMask::mask(), and KviIrcMask::NickCleanUserSmartNet.

Referenced by KviConsoleWindow::avatarChanged(), and KviConsoleWindow::checkDefaultAvatar().

void KviAvatarCache::replace ( const QString &  szIdString,
const KviIrcMask mask,
const QString &  szNetwork 
)

Replaces a cached avatar.

Parameters
szIdStringThe id of the avatar
maskThe mask of the user
szNetworkThe network where the user is on
Returns
void

References cleanup(), e, kvi_unixTime, m_pAvatarDict, KviIrcMask::mask(), MAX_AVATARS_IN_CACHE, KviIrcMask::NickCleanUserSmartNet, _KviAvatarCacheEntry::szIdString, and _KviAvatarCacheEntry::tLastAccess.

Referenced by KviConsoleWindow::avatarChanged().

void KviAvatarCache::save ( const QString &  szFileName)

Member Data Documentation

KviAvatarCache * KviAvatarCache::m_pAvatarCacheInstance = nullptr
staticprotected

Referenced by done(), and init().

KviPointerHashTable<QString, KviAvatarCacheEntry>* KviAvatarCache::m_pAvatarDict

The documentation for this class was generated from the following files: