diff options
Diffstat (limited to 'src/kvilib/irc/kvi_avatarcache.cpp')
-rw-r--r-- | src/kvilib/irc/kvi_avatarcache.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/kvilib/irc/kvi_avatarcache.cpp b/src/kvilib/irc/kvi_avatarcache.cpp index d24562ea..59c0ed61 100644 --- a/src/kvilib/irc/kvi_avatarcache.cpp +++ b/src/kvilib/irc/kvi_avatarcache.cpp @@ -66,7 +66,7 @@ void KviAvatarCache::done() KviAvatarCache::KviAvatarCache() { - m_pAvatarDict = new KviPointerHashTable<QString,KviAvatarCacheEntry>(CACHE_DICT_SIZE,false); + m_pAvatarDict = new KviPointerHashTable<TQString,KviAvatarCacheEntry>(CACHE_DICT_SIZE,false); m_pAvatarDict->setAutoDelete(true); } @@ -76,19 +76,19 @@ KviAvatarCache::~KviAvatarCache() } -void KviAvatarCache::replace(const QString &szIdString,const KviIrcMask &mask,const QString &szNetwork) +void KviAvatarCache::tqreplace(const TQString &szIdString,const KviIrcMask &tqmask,const TQString &szNetwork) { - QString szKey; + TQString szKey; - mask.mask(szKey,KviIrcMask::NickCleanUserSmartNet); - szKey.append(QChar('+')); + tqmask.tqmask(szKey,KviIrcMask::NickCleanUserSmartNet); + szKey.append(TQChar('+')); szKey.append(szNetwork); KviAvatarCacheEntry * e = new KviAvatarCacheEntry; e->szIdString = szIdString; e->tLastAccess = kvi_unixTime(); - m_pAvatarDict->replace(szKey,e); + m_pAvatarDict->tqreplace(szKey,e); if(m_pAvatarDict->count() > MAX_AVATARS_IN_CACHE) { @@ -96,12 +96,12 @@ void KviAvatarCache::replace(const QString &szIdString,const KviIrcMask &mask,co } } -void KviAvatarCache::remove(const KviIrcMask &mask,const QString &szNetwork) +void KviAvatarCache::remove(const KviIrcMask &tqmask,const TQString &szNetwork) { - QString szKey; + TQString szKey; - mask.mask(szKey,KviIrcMask::NickCleanUserSmartNet); - szKey.append(QChar('+')); + tqmask.tqmask(szKey,KviIrcMask::NickCleanUserSmartNet); + szKey.append(TQChar('+')); szKey.append(szNetwork); m_pAvatarDict->remove(szKey); @@ -109,21 +109,21 @@ void KviAvatarCache::remove(const KviIrcMask &mask,const QString &szNetwork) -const QString & KviAvatarCache::lookup(const KviIrcMask &mask,const QString &szNetwork) +const TQString & KviAvatarCache::lookup(const KviIrcMask &tqmask,const TQString &szNetwork) { - QString szKey; + TQString szKey; - mask.mask(szKey,KviIrcMask::NickCleanUserSmartNet); - szKey.append(QChar('+')); + tqmask.tqmask(szKey,KviIrcMask::NickCleanUserSmartNet); + szKey.append(TQChar('+')); szKey.append(szNetwork); - KviAvatarCacheEntry * e = m_pAvatarDict->find(szKey); - if(!e)return KviQString::empty; + KviAvatarCacheEntry * e = m_pAvatarDict->tqfind(szKey); + if(!e)return KviTQString::empty; e->tLastAccess = kvi_unixTime(); return e->szIdString; } -void KviAvatarCache::load(const QString &szFileName) +void KviAvatarCache::load(const TQString &szFileName) { m_pAvatarDict->clear(); @@ -142,14 +142,14 @@ void KviAvatarCache::load(const QString &szFileName) kvi_time_t tLastAccess = cfg.readUIntEntry("LastAccess",0); if((tNow - tLastAccess) < MAX_UNACCESSED_TIME) { - QString szIdString = cfg.readQStringEntry("Avatar",""); + TQString szIdString = cfg.readTQStringEntry("Avatar",""); if(!szIdString.isEmpty()) { KviAvatarCacheEntry * e = new KviAvatarCacheEntry; e->tLastAccess = tLastAccess; e->szIdString = szIdString; - m_pAvatarDict->replace(it.currentKey(),e); + m_pAvatarDict->tqreplace(it.currentKey(),e); cnt++; if(cnt >= MAX_AVATARS_IN_CACHE)return; // done } @@ -158,12 +158,12 @@ void KviAvatarCache::load(const QString &szFileName) } } -void KviAvatarCache::save(const QString &szFileName) +void KviAvatarCache::save(const TQString &szFileName) { KviConfig cfg(szFileName,KviConfig::Write); // cfg.clear(); // not needed with KviConfig::Write - KviPointerHashTableIterator<QString,KviAvatarCacheEntry> it(*m_pAvatarDict); + KviPointerHashTableIterator<TQString,KviAvatarCacheEntry> it(*m_pAvatarDict); while(KviAvatarCacheEntry * e = it.current()) { @@ -180,11 +180,11 @@ void KviAvatarCache::save(const QString &szFileName) void KviAvatarCache::cleanup() { // first do a quick run deleting the avatars really too old - KviPointerHashTableIterator<QString,KviAvatarCacheEntry> it(*m_pAvatarDict); + KviPointerHashTableIterator<TQString,KviAvatarCacheEntry> it(*m_pAvatarDict); kvi_time_t tNow = kvi_unixTime(); - KviPointerList<QString> l; + KviPointerList<TQString> l; l.setAutoDelete(false); KviAvatarCacheEntry * e; @@ -193,12 +193,12 @@ void KviAvatarCache::cleanup() { if((tNow - e->tLastAccess) > MAX_UNACCESSED_TIME) { - l.append(new QString(it.currentKey())); + l.append(new TQString(it.currentKey())); } ++it; } - for(QString *s = l.first();s;s = l.next())m_pAvatarDict->remove(*s); + for(TQString *s = l.first();s;s = l.next())m_pAvatarDict->remove(*s); if(m_pAvatarDict->count() < CACHE_GUARD_LEVEL)return; |