diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-28 18:31:12 +0000 |
commit | 0a80cfd57d271dd44221467efb426675fa470356 (patch) | |
tree | 6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/kvilib/irc/kvi_ircuserdb.cpp | |
parent | 3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff) | |
download | kvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip |
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kvilib/irc/kvi_ircuserdb.cpp')
-rw-r--r-- | src/kvilib/irc/kvi_ircuserdb.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/kvilib/irc/kvi_ircuserdb.cpp b/src/kvilib/irc/kvi_ircuserdb.cpp index 38b52522..bfc1c615 100644 --- a/src/kvilib/irc/kvi_ircuserdb.cpp +++ b/src/kvilib/irc/kvi_ircuserdb.cpp @@ -34,7 +34,7 @@ //static int cacheHit = 0; //static int cacheMiss = 0; -KviIrcUserEntry::KviIrcUserEntry(const QString &user,const QString &host) +KviIrcUserEntry::KviIrcUserEntry(const TQString &user,const TQString &host) { m_szUser = user; m_szHost = host; @@ -48,15 +48,15 @@ KviIrcUserEntry::KviIrcUserEntry(const QString &user,const QString &host) m_bUseCustomColor=false; } -void KviIrcUserEntry::setRealName(const QString &rn) +void KviIrcUserEntry::setRealName(const TQString &rn) { m_szRealName = rn; - m_szRealName = KviQString::trimmed(m_szRealName); + m_szRealName = KviTQString::trimmed(m_szRealName); if(m_szRealName.length()>=3) { - if( (m_szRealName[0].unicode()==KVI_TEXT_COLOR) && (m_szRealName[2].unicode()==KVI_TEXT_RESET) ) + if( (m_szRealName[0].tqunicode()==KVI_TEXT_COLOR) && (m_szRealName[2].tqunicode()==KVI_TEXT_RESET) ) { - switch(m_szRealName[1].unicode()) + switch(m_szRealName[1].tqunicode()) { case '1': // hum.. encoded as hidden color code eh ? publish is somewhere, so others might implement this... setGender(Male); @@ -92,7 +92,7 @@ KviAvatar * KviIrcUserEntry::forgetAvatar() } KviIrcUserDataBase::KviIrcUserDataBase() -: QObject() +: TQObject() { // we expect a maximum of ~4000 users (= ~16 KB array on a 32 bit machine) // ...after that we will loose in performance @@ -102,7 +102,7 @@ KviIrcUserDataBase::KviIrcUserDataBase() // the performance increase since kvirc versions < 3.0.0 // is really big anyway (there was a linear list instead of a hash!!!) - m_pDict = new KviPointerHashTable<QString,KviIrcUserEntry>(4001,false); + m_pDict = new KviPointerHashTable<TQString,KviIrcUserEntry>(4001,false); m_pDict->setAutoDelete(true); setupConnectionWithReguserDb(); } @@ -112,9 +112,9 @@ KviIrcUserDataBase::~KviIrcUserDataBase() delete m_pDict; } -bool KviIrcUserDataBase::haveCustomColor(const QString & nick) +bool KviIrcUserDataBase::haveCustomColor(const TQString & nick) { - KviIrcUserEntry *u = find(nick); + KviIrcUserEntry *u = tqfind(nick); if(!u) return false; if( u->m_szLastRegisteredMatchNick!=nick) registeredUser(nick); @@ -125,9 +125,9 @@ bool KviIrcUserDataBase::haveCustomColor(const QString & nick) return false; } -QColor* KviIrcUserDataBase::customColor(const QString & nick) +TQColor* KviIrcUserDataBase::customColor(const TQString & nick) { - KviIrcUserEntry *u = find(nick); + KviIrcUserEntry *u = tqfind(nick); if(!u) return 0; if( u->m_szLastRegisteredMatchNick!=nick) registeredUser(nick); @@ -140,10 +140,10 @@ QColor* KviIrcUserDataBase::customColor(const QString & nick) } -KviRegisteredUser* KviIrcUserDataBase::registeredUser(const QString & nick,const QString & user,const QString & host) +KviRegisteredUser* KviIrcUserDataBase::registeredUser(const TQString & nick,const TQString & user,const TQString & host) { if(nick.isEmpty()) return 0; - KviIrcUserEntry *u = find(nick); + KviIrcUserEntry *u = tqfind(nick); if(!u) return g_pRegisteredUserDataBase->findMatchingUser(nick,user,host); KviRegisteredUser* pUser=0; @@ -171,7 +171,7 @@ KviRegisteredUser* KviIrcUserDataBase::registeredUser(const QString & nick,const u->m_szRegisteredUserName=pUser->name(); u->m_bUseCustomColor=pUser->getBoolProperty("useCustomColor"); - QString szTmp=pUser->getProperty("customColor"); + TQString szTmp=pUser->getProperty("customColor"); KviStringConversion::fromString(szTmp,u->m_cachedColor); u->m_bNotFoundRegUserLoockup=false; //to be shure @@ -186,10 +186,10 @@ KviRegisteredUser* KviIrcUserDataBase::registeredUser(const QString & nick,const return pUser; } -KviRegisteredUser* KviIrcUserDataBase::registeredUser(const QString & nick) +KviRegisteredUser* KviIrcUserDataBase::registeredUser(const TQString & nick) { if(nick.isEmpty()) return 0; - KviIrcUserEntry *u = find(nick); + KviIrcUserEntry *u = tqfind(nick); if(!u) return 0; return registeredUser(nick,u->user(),u->host()); } @@ -197,13 +197,13 @@ KviRegisteredUser* KviIrcUserDataBase::registeredUser(const QString & nick) void KviIrcUserDataBase::clear() { delete m_pDict; - m_pDict = new KviPointerHashTable<QString,KviIrcUserEntry>(4001,false); + m_pDict = new KviPointerHashTable<TQString,KviIrcUserEntry>(4001,false); m_pDict->setAutoDelete(true); } -KviIrcUserEntry * KviIrcUserDataBase::insertUser(const QString &nick,const QString &user,const QString &hostname) +KviIrcUserEntry * KviIrcUserDataBase::insertUser(const TQString &nick,const TQString &user,const TQString &hostname) { - KviIrcUserEntry * e = m_pDict->find(nick); + KviIrcUserEntry * e = m_pDict->tqfind(nick); if(e) { e->m_nRefs++; @@ -219,7 +219,7 @@ KviIrcUserEntry * KviIrcUserDataBase::insertUser(const QString &nick,const QStri return e; } -void KviIrcUserDataBase::removeUser(const QString &nick,KviIrcUserEntry * e) +void KviIrcUserDataBase::removeUser(const TQString &nick,KviIrcUserEntry * e) { e->m_nRefs--; if(e->m_nRefs == 0)m_pDict->remove(nick); @@ -227,17 +227,17 @@ void KviIrcUserDataBase::removeUser(const QString &nick,KviIrcUserEntry * e) void KviIrcUserDataBase::setupConnectionWithReguserDb() { - connect(g_pRegisteredUserDataBase,SIGNAL(userRemoved(const QString&)),this,SLOT(registeredUserRemoved(const QString&))); - connect(g_pRegisteredUserDataBase,SIGNAL(userChanged(const QString&)),this,SLOT(registeredUserChanged(const QString&))); - connect(g_pRegisteredUserDataBase,SIGNAL(userAdded(const QString&)),this,SLOT(registeredUserAdded(const QString&))); - connect(g_pRegisteredUserDataBase,SIGNAL(databaseCleared()),this,SLOT(registeredDatabaseCleared())); + connect(g_pRegisteredUserDataBase,TQT_SIGNAL(userRemoved(const TQString&)),this,TQT_SLOT(registeredUserRemoved(const TQString&))); + connect(g_pRegisteredUserDataBase,TQT_SIGNAL(userChanged(const TQString&)),this,TQT_SLOT(registeredUserChanged(const TQString&))); + connect(g_pRegisteredUserDataBase,TQT_SIGNAL(userAdded(const TQString&)),this,TQT_SLOT(registeredUserAdded(const TQString&))); + connect(g_pRegisteredUserDataBase,TQT_SIGNAL(databaseCleared()),this,TQT_SLOT(registeredDatabaseCleared())); } -void KviIrcUserDataBase::registeredUserRemoved(const QString& user) +void KviIrcUserDataBase::registeredUserRemoved(const TQString& user) { - KviPointerHashTableIterator<QString,KviIrcUserEntry> it( *m_pDict ); + KviPointerHashTableIterator<TQString,KviIrcUserEntry> it( *m_pDict ); for( ; it.current(); ++it ) { if(it.current()->m_szRegisteredUserName==user) @@ -248,10 +248,10 @@ void KviIrcUserDataBase::registeredUserRemoved(const QString& user) } } -void KviIrcUserDataBase::registeredUserChanged(const QString& user) +void KviIrcUserDataBase::registeredUserChanged(const TQString& user) { //the same as above - KviPointerHashTableIterator<QString,KviIrcUserEntry> it( *m_pDict ); + KviPointerHashTableIterator<TQString,KviIrcUserEntry> it( *m_pDict ); for( ; it.current(); ++it ) { if(it.current()->m_szRegisteredUserName==user) @@ -262,9 +262,9 @@ void KviIrcUserDataBase::registeredUserChanged(const QString& user) } } -void KviIrcUserDataBase::registeredUserAdded(const QString& user) +void KviIrcUserDataBase::registeredUserAdded(const TQString& user) { - KviPointerHashTableIterator<QString,KviIrcUserEntry> it( *m_pDict ); + KviPointerHashTableIterator<TQString,KviIrcUserEntry> it( *m_pDict ); for( ; it.current(); ++it ) { if(it.current()->m_szRegisteredUserName.isEmpty()) @@ -276,7 +276,7 @@ void KviIrcUserDataBase::registeredUserAdded(const QString& user) void KviIrcUserDataBase::registeredDatabaseCleared() { - KviPointerHashTableIterator<QString,KviIrcUserEntry> it( *m_pDict ); + KviPointerHashTableIterator<TQString,KviIrcUserEntry> it( *m_pDict ); for( ; it.current(); ++it ) { it.current()->m_szRegisteredUserName=""; |