summaryrefslogtreecommitdiffstats
path: root/src/kvirc/kernel/kvi_notifylist.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
commit0a80cfd57d271dd44221467efb426675fa470356 (patch)
tree6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/kvirc/kernel/kvi_notifylist.cpp
parent3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff)
downloadkvirc-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/kvirc/kernel/kvi_notifylist.cpp')
-rw-r--r--src/kvirc/kernel/kvi_notifylist.cpp268
1 files changed, 134 insertions, 134 deletions
diff --git a/src/kvirc/kernel/kvi_notifylist.cpp b/src/kvirc/kernel/kvi_notifylist.cpp
index bee7fd4..312c184 100644
--- a/src/kvirc/kernel/kvi_notifylist.cpp
+++ b/src/kvirc/kernel/kvi_notifylist.cpp
@@ -47,7 +47,7 @@
#include "kvi_kvs_eventtriggers.h"
#include "kvi_qcstring.h"
-#include <qstringlist.h>
+#include <tqstringlist.h>
// FIXME: #warning "Finish this doc!"
@@ -70,7 +70,7 @@
So for example, assume to register a frend of yours like Szymon:[br]
[example]
[cmd:reguser.add]reguser.add[/cmd] Szymon
- [cmd:reguser.addmask]reguser.addmask[/cmd] Szymon Pragma!*@*.it
+ [cmd:reguser.addtqmask]reguser.addtqmask[/cmd] Szymon Pragma!*@*.it
[/example]
And then want it in the notify list; nothing easier, just set
hist "notify" property to the nickname that you want him to be "looked for":[br]
@@ -82,7 +82,7 @@
"Pragma [someuser@somehost.it] is on IRC".[br]
If Szymon uses often "[Pragma]" as his secondary nickname , you can do the following:[br]
[example]
- [cmd:reguser.addmask]reguser.addmask[/cmd] Szymon [Pragma]*@*.it
+ [cmd:reguser.addtqmask]reguser.addtqmask[/cmd] Szymon [Pragma]*@*.it
[cmd:reguser.setproperty]reguser.setproperty[/cmd] Szymon notify "Pragma [Pragma]"
[/example]
KVIrc will then look for both nicknames getting online.[br]
@@ -94,7 +94,7 @@
This might be a false assumption (since somehod.com does not even match *.it),
but it is the best result that the "stupid ISON method" can achieve.[br]
The "intelligent ISON method" will also check the Pragma's username and hostname
- and match it in the registered masks; so in the example above, you will be notified if
+ and match it in the registered tqmasks; so in the example above, you will be notified if
any user that matches Pragma!*@*.it gets online; (but you will NOT be notified if
(for example) Pragma!someuser@somehost.com gets online).[br]
So what's the point in including a stupid method? :) Well...the intelligent
@@ -117,7 +117,7 @@
// Basic NotifyListManager: this does completely nothing
KviNotifyListManager::KviNotifyListManager(KviIrcConnection * pConnection)
-: QObject(0,"notify_list_manager")
+: TQObject(0,"notify_list_manager")
{
m_pConnection = pConnection;
m_pConsole = pConnection->console();
@@ -150,7 +150,7 @@ bool KviNotifyListManager::handleWatchReply(KviIrcMessage *)
return false;
}
-void KviNotifyListManager::notifyOnLine(const QString &nick,const QString &user,const QString &host,const QString &szReason,bool bJoin)
+void KviNotifyListManager::notifyOnLine(const TQString &nick,const TQString &user,const TQString &host,const TQString &szReason,bool bJoin)
{
if(bJoin)
m_pConsole->notifyListView()->join(nick,user,host);
@@ -158,35 +158,35 @@ void KviNotifyListManager::notifyOnLine(const QString &nick,const QString &user,
KviWindow * out = KVI_OPTION_BOOL(KviOption_boolNotifyListChangesToActiveWindow) ? m_pConsole->activeWindow() : m_pConsole;
if(KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnNotifyOnLine,out,nick))return;
- QString szWho;
- QString szMsg;
+ TQString szWho;
+ TQString szMsg;
if(!(user.isEmpty() || host.isEmpty()))
- KviQString::sprintf(szWho,"\r!n\r%Q\r [%Q@\r!h\r%Q\r]",&nick,&user,&host);
+ KviTQString::sprintf(szWho,"\r!n\r%Q\r [%Q@\r!h\r%Q\r]",&nick,&user,&host);
else
- KviQString::sprintf(szWho,"\r!n\r%Q\r",&nick);
+ KviTQString::sprintf(szWho,"\r!n\r%Q\r",&nick);
- KviPointerHashTable<QString,KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict();
- KviPointerHashTableIterator<QString,KviRegisteredUser> it(*d);
- QString szNotify;
+ KviPointerHashTable<TQString,KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict();
+ KviPointerHashTableIterator<TQString,KviRegisteredUser> it(*d);
+ TQString szNotify;
while(KviRegisteredUser * u = it.current())
{
- if(QStringList::split(",",u->getProperty("notify")).findIndex(nick)!=-1)
+ if(TQStringList::split(",",u->getProperty("notify")).tqfindIndex(nick)!=-1)
{
- QString szComment=u->getProperty("comment");
+ TQString szComment=u->getProperty("comment");
if(!szComment.isEmpty())
- KviQString::sprintf(szMsg,"%Q (%Q), Group \"%Q\" is on IRC as (%Q)",&(u->name()),&szComment,&(u->group()),&szWho);
+ KviTQString::sprintf(szMsg,"%Q (%Q), Group \"%Q\" is on IRC as (%Q)",&(u->name()),&szComment,&(u->group()),&szWho);
else
- KviQString::sprintf(szMsg,"%Q, Group \"%Q\" is on IRC as (%Q)",&(u->name()),&(u->group()),&szWho);
+ KviTQString::sprintf(szMsg,"%Q, Group \"%Q\" is on IRC as (%Q)",&(u->name()),&(u->group()),&szWho);
break;
}
++it;
}
- QString szFmt = __tr2qs("%Q is on IRC");
+ TQString szFmt = __tr2qs("%Q is on IRC");
if(szMsg.isEmpty())
- KviQString::sprintf(szMsg,szFmt,&szWho);
+ KviTQString::sprintf(szMsg,szFmt,&szWho);
if((!szReason.isEmpty()) && (_OUTPUT_VERBOSE))
{
@@ -206,46 +206,46 @@ void KviNotifyListManager::notifyOnLine(const QString &nick,const QString &user,
szWho = "<b>";
szWho += nick;
szWho += "</b>";
- KviQString::sprintf(szMsg,szFmt,&szWho);
+ KviTQString::sprintf(szMsg,szFmt,&szWho);
g_pApp->notifierMessage(0,KVI_OPTION_MSGTYPE(KVI_OUT_NOTIFYONLINE).pixId(),szMsg,15);
}
}
}
-void KviNotifyListManager::notifyOffLine(const QString &nick,const QString &user,const QString &host,const QString &szReason)
+void KviNotifyListManager::notifyOffLine(const TQString &nick,const TQString &user,const TQString &host,const TQString &szReason)
{
KviWindow * out = KVI_OPTION_BOOL(KviOption_boolNotifyListChangesToActiveWindow) ? m_pConsole->activeWindow() : m_pConsole;
if(!KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnNotifyOffLine,out,nick))
{
- QString szWho;
+ TQString szWho;
if(!(user.isEmpty() || host.isEmpty()))
- KviQString::sprintf(szWho,"\r!n\r%Q\r [%Q@\r!h\r%Q\r]",&nick,&user,&host);
+ KviTQString::sprintf(szWho,"\r!n\r%Q\r [%Q@\r!h\r%Q\r]",&nick,&user,&host);
else
- KviQString::sprintf(szWho,"\r!n\r%Q\r",&nick);
+ KviTQString::sprintf(szWho,"\r!n\r%Q\r",&nick);
- QString szMsg;
+ TQString szMsg;
- KviPointerHashTable<QString,KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict();
- KviPointerHashTableIterator<QString,KviRegisteredUser> it(*d);
- QString szNotify;
+ KviPointerHashTable<TQString,KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict();
+ KviPointerHashTableIterator<TQString,KviRegisteredUser> it(*d);
+ TQString szNotify;
while(KviRegisteredUser * u = it.current())
{
- if(QStringList::split(",",u->getProperty("notify")).findIndex(nick)!=-1)
+ if(TQStringList::split(",",u->getProperty("notify")).tqfindIndex(nick)!=-1)
{
- QString szComment=u->getProperty("comment");
+ TQString szComment=u->getProperty("comment");
if(!szComment.isEmpty())
- KviQString::sprintf(szMsg,"%Q (%Q), Group \"%Q\" has left IRC as (%Q)",&(u->name()),&szComment,&(u->group()),&szWho);
+ KviTQString::sprintf(szMsg,"%Q (%Q), Group \"%Q\" has left IRC as (%Q)",&(u->name()),&szComment,&(u->group()),&szWho);
else
- KviQString::sprintf(szMsg,"%Q, Group \"%Q\" has left IRC as (%Q)",&(u->name()),&(u->group()),&szWho);
+ KviTQString::sprintf(szMsg,"%Q, Group \"%Q\" has left IRC as (%Q)",&(u->name()),&(u->group()),&szWho);
break;
}
++it;
}
if(szMsg.isEmpty())
- KviQString::sprintf(szMsg,__tr2qs("%Q has left IRC"),&szWho);
+ KviTQString::sprintf(szMsg,__tr2qs("%Q has left IRC"),&szWho);
if((!szReason.isEmpty()) && (_OUTPUT_VERBOSE))
{
@@ -319,22 +319,22 @@ void KviNotifyListManager::notifyOffLine(const QString &nick,const QString &user
KviIsOnNotifyListManager::KviIsOnNotifyListManager(KviIrcConnection * pConnection)
: KviNotifyListManager(pConnection)
{
- m_pRegUserDict = new KviPointerHashTable<QString,QString>(17,false); // case insensitive , copy keys
+ m_pRegUserDict = new KviPointerHashTable<TQString,TQString>(17,false); // case insensitive , copy keys
m_pRegUserDict->setAutoDelete(true);
- m_pNotifyList = new KviPointerList<QString>;
+ m_pNotifyList = new KviPointerList<TQString>;
m_pNotifyList->setAutoDelete(true);
- m_pIsOnList = new KviPointerList<QString>;
+ m_pIsOnList = new KviPointerList<TQString>;
m_pIsOnList->setAutoDelete(true);
- m_pOnlineList = new KviPointerList<QString>;
+ m_pOnlineList = new KviPointerList<TQString>;
m_pOnlineList->setAutoDelete(true);
- m_pUserhostList = new KviPointerList<QString>;
+ m_pUserhostList = new KviPointerList<TQString>;
m_pUserhostList->setAutoDelete(true);
- m_pDelayedNotifyTimer = new QTimer();
- connect(m_pDelayedNotifyTimer,SIGNAL(timeout()),this,SLOT(newNotifySession()));
- m_pDelayedIsOnTimer = new QTimer();
- connect(m_pDelayedIsOnTimer,SIGNAL(timeout()),this,SLOT(newIsOnSession()));
- m_pDelayedUserhostTimer = new QTimer();
- connect(m_pDelayedUserhostTimer,SIGNAL(timeout()),this,SLOT(newUserhostSession()));
+ m_pDelayedNotifyTimer = new TQTimer();
+ connect(m_pDelayedNotifyTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(newNotifySession()));
+ m_pDelayedIsOnTimer = new TQTimer();
+ connect(m_pDelayedIsOnTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(newIsOnSession()));
+ m_pDelayedUserhostTimer = new TQTimer();
+ connect(m_pDelayedUserhostTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(newUserhostSession()));
m_bRunning = false;
}
@@ -376,24 +376,24 @@ void KviIsOnNotifyListManager::buildRegUserDict()
{
m_pRegUserDict->clear();
- const KviPointerHashTable<QString,KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict();
- KviPointerHashTableIterator<QString,KviRegisteredUser> it(*d);
+ const KviPointerHashTable<TQString,KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict();
+ KviPointerHashTableIterator<TQString,KviRegisteredUser> it(*d);
while(KviRegisteredUser * u = it.current())
{
- QString notify;
+ TQString notify;
if(u->getProperty("notify",notify))
{
notify.stripWhiteSpace();
while(!notify.isEmpty())
{
- int idx = notify.find(' ');
+ int idx = notify.tqfind(' ');
if(idx > 0)
{
- QString single = notify.left(idx);
- m_pRegUserDict->replace(single,new QString(u->name()));
+ TQString single = notify.left(idx);
+ m_pRegUserDict->tqreplace(single,new TQString(u->name()));
notify.remove(0,idx+1);
} else {
- m_pRegUserDict->replace(notify,new QString(u->name()));
+ m_pRegUserDict->tqreplace(notify,new TQString(u->name()));
notify = "";
}
}
@@ -435,10 +435,10 @@ void KviIsOnNotifyListManager::newNotifySession()
void KviIsOnNotifyListManager::buildNotifyList()
{
m_pNotifyList->clear();
- KviPointerHashTableIterator<QString,QString> it(*m_pRegUserDict);
+ KviPointerHashTableIterator<TQString,TQString> it(*m_pRegUserDict);
while(it.current())
{
- m_pNotifyList->append(new QString(it.currentKey()));
+ m_pNotifyList->append(new TQString(it.currentKey()));
++it;
}
}
@@ -472,7 +472,7 @@ void KviIsOnNotifyListManager::buildIsOnList()
m_pIsOnList->clear();
m_szIsOnString = "";
m_pNotifyList->setAutoDelete(false);
- while(QString * s = m_pNotifyList->first())
+ while(TQString * s = m_pNotifyList->first())
{
if(((m_szIsOnString.length() + s->length()) + 1) < 504)
{
@@ -489,7 +489,7 @@ void KviIsOnNotifyListManager::sendIsOn()
{
if(_OUTPUT_PARANOIC)
m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: Checking for: %Q"),&m_szIsOnString);
- KviQCString szDec = m_pConnection->encodeText(m_szIsOnString);
+ KviTQCString szDec = m_pConnection->encodeText(m_szIsOnString);
m_pConnection->sendFmtData("ISON %s",szDec.data());
if(m_pConnection->lagMeter())
m_pConnection->lagMeter()->lagCheckRegister("@notify_ison",40); // not that reliable
@@ -506,7 +506,7 @@ bool KviIsOnNotifyListManager::handleIsOn(KviIrcMessage *msg)
// Check if it is our ISON
// all the nicks must be on the IsOnList
- KviPointerList<QString> tmplist;
+ KviPointerList<TQString> tmplist;
tmplist.setAutoDelete(false);
KviStr nk;
@@ -519,10 +519,10 @@ bool KviIsOnNotifyListManager::handleIsOn(KviIrcMessage *msg)
if(nk.hasData())
{
bool bGotIt = false;
- QString dnk = m_pConnection->decodeText(nk.ptr());
- for(QString * s = m_pIsOnList->first();s && (!bGotIt);s = m_pIsOnList->next())
+ TQString dnk = m_pConnection->decodeText(nk.ptr());
+ for(TQString * s = m_pIsOnList->first();s && (!bGotIt);s = m_pIsOnList->next())
{
- if(KviQString::equalCI(*s,dnk))
+ if(KviTQString::equalCI(*s,dnk))
{
tmplist.append(s);
bGotIt = true;
@@ -552,7 +552,7 @@ bool KviIsOnNotifyListManager::handleIsOn(KviIrcMessage *msg)
// The nicks in the IsOnList that are also in the reply are online , and go to the OnlineList
// the remaining in the IsOnList are offline
- QString * s;
+ TQString * s;
for(s = tmplist.first();s;s = tmplist.next())
{
@@ -579,12 +579,12 @@ bool KviIsOnNotifyListManager::handleIsOn(KviIrcMessage *msg)
// ok... complex step now: the remaining users in the userhost list are online
// if they have been online before, just remove them from the list
- // otherwise they must be matched for masks
+ // otherwise they must be matched for tqmasks
// and eventually inserted in the notify view later
KviIrcUserDataBase * db = console()->connection()->userDataBase();
- KviPointerList<QString> l;
+ KviPointerList<TQString> l;
l.setAutoDelete(false);
for(s = m_pOnlineList->first();s;s = m_pOnlineList->next())
@@ -592,7 +592,7 @@ bool KviIsOnNotifyListManager::handleIsOn(KviIrcMessage *msg)
if(KviUserListEntry * ent = m_pConsole->notifyListView()->findEntry(*s))
{
// the user was online from a previous notify session
- // might the mask have been changed ? (heh...this is tricky, maybe too much even)
+ // might the tqmask have been changed ? (heh...this is tricky, maybe too much even)
if(KVI_OPTION_BOOL(KviOption_boolNotifyListSendUserhostForOnlineUsers))
{
// user wants to be sure about online users....
@@ -621,15 +621,15 @@ bool KviIsOnNotifyListManager::handleIsOn(KviIrcMessage *msg)
//l.append(s); // we will remove him from the list
} else {
// the user was not online!
- // check if we have a cached mask
+ // check if we have a cached tqmask
if(db)
{
- if(KviIrcUserEntry * ue = db->find(*s))
+ if(KviIrcUserEntry * ue = db->tqfind(*s))
{
- // already in the db... do we have a mask ?
+ // already in the db... do we have a tqmask ?
if(ue->hasUser() && ue->hasHost())
{
- // yup! we have a complete mask to match on
+ // yup! we have a complete tqmask to match on
KviIrcMask mk(*s,ue->user(),ue->host());
// lookup the user's name in the m_pRegUserDict
if(!doMatchUser(*s,mk))return true; // critical problems = have to restart!!!
@@ -656,34 +656,34 @@ bool KviIsOnNotifyListManager::handleIsOn(KviIrcMessage *msg)
// FIXME: #warning "Nickname escapes (links) in the notifylist messages!"
-bool KviIsOnNotifyListManager::doMatchUser(const QString &notifyString,const KviIrcMask & mask)
+bool KviIsOnNotifyListManager::doMatchUser(const TQString &notifyString,const KviIrcMask & tqmask)
{
- QString * nam = m_pRegUserDict->find(notifyString);
+ TQString * nam = m_pRegUserDict->tqfind(notifyString);
if(nam)
{
// ok...find the user
if(KviRegisteredUser * u = g_pRegisteredUserDataBase->findUserByName(*nam))
{
// ok ... match the user
- if(u->matchesFixed(mask))
+ if(u->matchesFixed(tqmask))
{
// new user online
- if(!(m_pConsole->notifyListView()->findEntry(mask.nick())))
+ if(!(m_pConsole->notifyListView()->findEntry(tqmask.nick())))
{
- notifyOnLine(mask.nick(),mask.user(),mask.host());
+ notifyOnLine(tqmask.nick(),tqmask.user(),tqmask.host());
} // else already online , and matching...all ok
} else {
// not matched.... has he been online before ?
- if(m_pConsole->notifyListView()->findEntry(mask.nick()))
+ if(m_pConsole->notifyListView()->findEntry(tqmask.nick()))
{
- // has been online just a sec ago , but now the mask does not match
+ // has been online just a sec ago , but now the tqmask does not match
// either reguserdb has changed , or the user went offline and another one got his nick
// in the meantime... (ugly situation anyway)
- notifyOffLine(mask.nick(),mask.user(),mask.host(),__tr2qs("registration mask changed, or nickname is being used by someone else"));
+ notifyOffLine(tqmask.nick(),tqmask.user(),tqmask.host(),__tr2qs("registration tqmask changed, or nickname is being used by someone else"));
} else {
// has never been online
if(_OUTPUT_VERBOSE)
- m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: \r!n\r%Q\r appears to be online, but the mask [%Q@\r!h\r%Q\r] does not match (registration mask does not match, or nickname is being used by someone else)"),&(mask.nick()),&(mask.user()),&(mask.host()));
+ m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: \r!n\r%Q\r appears to be online, but the tqmask [%Q@\r!h\r%Q\r] does not match (registration tqmask does not match, or nickname is being used by someone else)"),&(tqmask.nick()),&(tqmask.user()),&(tqmask.host()));
}
}
} else {
@@ -743,7 +743,7 @@ void KviIsOnNotifyListManager::buildUserhostList()
m_pOnlineList->setAutoDelete(false);
int i = 0;
- QString * s;
+ TQString * s;
while((s = m_pOnlineList->first()) && (i < MAX_USERHOST_ENTRIES))
{
if(!m_szUserhostString.isEmpty())m_szUserhostString.append(' ');
@@ -759,7 +759,7 @@ void KviIsOnNotifyListManager::sendUserhost()
{
if(_OUTPUT_PARANOIC)
m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: Checking userhost for: %Q"),&m_szUserhostString);
- KviQCString ccc = m_pConnection->encodeText(m_szUserhostString);
+ KviTQCString ccc = m_pConnection->encodeText(m_szUserhostString);
m_pConnection->sendFmtData("USERHOST %s",ccc.data());
if(m_pConnection->lagMeter())
m_pConnection->lagMeter()->lagCheckRegister("@notify_userhost",50);
@@ -784,7 +784,7 @@ bool KviIsOnNotifyListManager::handleUserhost(KviIrcMessage *msg)
aux = kvi_extractToken(nk,aux,' ');
if(nk.hasData())
{
- // split it in a mask
+ // split it in a tqmask
KviStr nick;
KviStr user;
KviStr host;
@@ -809,13 +809,13 @@ bool KviIsOnNotifyListManager::handleUserhost(KviIrcMessage *msg)
}
bool bGotIt = false;
- QString szNick = m_pConnection->decodeText(nick.ptr());
- QString szUser = m_pConnection->decodeText(user.ptr());
- QString szHost = m_pConnection->decodeText(host.ptr());
+ TQString szNick = m_pConnection->decodeText(nick.ptr());
+ TQString szUser = m_pConnection->decodeText(user.ptr());
+ TQString szHost = m_pConnection->decodeText(host.ptr());
- for(QString * s = m_pUserhostList->first();s && (!bGotIt);s = m_pUserhostList->next())
+ for(TQString * s = m_pUserhostList->first();s && (!bGotIt);s = m_pUserhostList->next())
{
- if(KviQString::equalCI(*s,szNick))
+ if(KviTQString::equalCI(*s,szNick))
{
KviIrcMask * mk = new KviIrcMask(szNick,szUser,szHost);
tmplist.append(mk);
@@ -854,7 +854,7 @@ bool KviIsOnNotifyListManager::handleUserhost(KviIrcMessage *msg)
if(!(m_pUserhostList->isEmpty()))
{
// ops...someone is no longer online ?
- while(QString * s = m_pUserhostList->first())
+ while(TQString * s = m_pUserhostList->first())
{
if(_OUTPUT_VERBOSE)
m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: \r!n\r%Q\r appears to have gone offline before USERHOST reply was received, will recheck in the next loop"),s);
@@ -905,7 +905,7 @@ void KviIsOnNotifyListManager::stop()
KviStupidNotifyListManager::KviStupidNotifyListManager(KviIrcConnection * pConnection)
: KviNotifyListManager(pConnection)
{
- m_pNickList = new KviPointerList<QString>;
+ m_pNickList = new KviPointerList<TQString>;
m_pNickList->setAutoDelete(true);
m_iRestartTimer = 0;
}
@@ -944,19 +944,19 @@ void KviStupidNotifyListManager::start()
void KviStupidNotifyListManager::sendIsOn()
{
m_szLastIsOnMsg = "";
- QString * nick = m_pNickList->at(m_iNextNickToCheck);
+ TQString * nick = m_pNickList->at(m_iNextNickToCheck);
__range_valid(nick);
int i = 0;
while(nick && ((nick->length() + 5 + m_szLastIsOnMsg.length()) < 510))
{
- KviQString::appendFormatted(m_szLastIsOnMsg," %Q",nick);
+ KviTQString::appendFormatted(m_szLastIsOnMsg," %Q",nick);
nick = m_pNickList->next();
i++;
}
if(_OUTPUT_PARANOIC)
m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: Checking for:%Q"),&m_szLastIsOnMsg);
- KviQCString dat = m_pConnection->encodeText(m_szLastIsOnMsg);
+ KviTQCString dat = m_pConnection->encodeText(m_szLastIsOnMsg);
m_pConnection->sendFmtData("ISON%s",dat.data());
if(m_pConnection->lagMeter())
@@ -978,9 +978,9 @@ bool KviStupidNotifyListManager::handleIsOn(KviIrcMessage * msg)
aux = kvi_extractToken(nk,aux,' ');
if(nk.hasData())
{
- QString nkd = m_pConnection->decodeText(nk.ptr());
- QString nksp = " " + nkd;
- m_szLastIsOnMsg.replace(nksp,"",false);
+ TQString nkd = m_pConnection->decodeText(nk.ptr());
+ TQString nksp = " " + nkd;
+ m_szLastIsOnMsg.tqreplace(nksp,"",false);
if(!(m_pConsole->notifyListView()->findEntry(nkd)))
{
// not yet notified
@@ -989,9 +989,9 @@ bool KviStupidNotifyListManager::handleIsOn(KviIrcMessage * msg)
}
}
// ok...check the users that have left irc now...
- QStringList sl = QStringList::split(' ',m_szLastIsOnMsg);
+ TQStringList sl = TQStringList::split(' ',m_szLastIsOnMsg);
- for(QStringList::Iterator it = sl.begin();it != sl.end();++it)
+ for(TQStringList::Iterator it = sl.begin();it != sl.end();++it)
{
if(m_pConsole->notifyListView()->findEntry(*it))
{
@@ -1020,7 +1020,7 @@ bool KviStupidNotifyListManager::handleIsOn(KviIrcMessage * msg)
return true;
}
-void KviStupidNotifyListManager::timerEvent(QTimerEvent *e)
+void KviStupidNotifyListManager::timerEvent(TQTimerEvent *e)
{
if(e->timerId() == m_iRestartTimer)
{
@@ -1030,7 +1030,7 @@ void KviStupidNotifyListManager::timerEvent(QTimerEvent *e)
sendIsOn();
return;
}
- QObject::timerEvent(e);
+ TQObject::timerEvent(e);
}
void KviStupidNotifyListManager::stop()
@@ -1050,15 +1050,15 @@ void KviStupidNotifyListManager::stop()
void KviStupidNotifyListManager::buildNickList()
{
- const KviPointerHashTable<QString,KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict();
- KviPointerHashTableIterator<QString,KviRegisteredUser> it(*d);
+ const KviPointerHashTable<TQString,KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict();
+ KviPointerHashTableIterator<TQString,KviRegisteredUser> it(*d);
m_pNickList->clear();
while(it.current())
{
- QString notify;
+ TQString notify;
if(it.current()->getProperty("notify",notify))
{
- m_pNickList->append(new QString(notify));
+ m_pNickList->append(new TQString(notify));
}
++it;
}
@@ -1073,7 +1073,7 @@ void KviStupidNotifyListManager::buildNickList()
KviWatchNotifyListManager::KviWatchNotifyListManager(KviIrcConnection * pConnection)
: KviNotifyListManager(pConnection)
{
- m_pRegUserDict = new KviPointerHashTable<QString,QString>(17,false);
+ m_pRegUserDict = new KviPointerHashTable<TQString,TQString>(17,false);
m_pRegUserDict->setAutoDelete(true);
}
@@ -1086,18 +1086,18 @@ void KviWatchNotifyListManager::buildRegUserDict()
{
m_pRegUserDict->clear();
- const KviPointerHashTable<QString,KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict();
- KviPointerHashTableIterator<QString,KviRegisteredUser> it(*d);
+ const KviPointerHashTable<TQString,KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict();
+ KviPointerHashTableIterator<TQString,KviRegisteredUser> it(*d);
while(KviRegisteredUser * u = it.current())
{
- QString notify;
+ TQString notify;
if(u->getProperty("notify",notify))
{
notify.stripWhiteSpace();
- QStringList sl = QStringList::split(' ',notify);
- for(QStringList::Iterator it = sl.begin();it != sl.end();++it)
+ TQStringList sl = TQStringList::split(' ',notify);
+ for(TQStringList::Iterator it = sl.begin();it != sl.end();++it)
{
- m_pRegUserDict->replace(*it,new QString(u->name()));
+ m_pRegUserDict->tqreplace(*it,new TQString(u->name()));
}
}
++it;
@@ -1110,30 +1110,30 @@ void KviWatchNotifyListManager::start()
buildRegUserDict();
- QString watchStr;
+ TQString watchStr;
- KviPointerHashTableIterator<QString,QString> it(*m_pRegUserDict);
+ KviPointerHashTableIterator<TQString,TQString> it(*m_pRegUserDict);
while(it.current())
{
- QString nk = it.currentKey();
- if(nk.find('*') == -1)
+ TQString nk = it.currentKey();
+ if(nk.tqfind('*') == -1)
{
if((watchStr.length() + nk.length() + 2) > 501)
{
- KviQCString dat = m_pConnection->encodeText(watchStr);
+ KviTQCString dat = m_pConnection->encodeText(watchStr);
m_pConnection->sendFmtData("WATCH%s",dat.data());
if(_OUTPUT_VERBOSE)
m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: Adding watch entries for%Q"),&watchStr);
watchStr = "";
}
- KviQString::appendFormatted(watchStr," +%Q",&nk);
+ KviTQString::appendFormatted(watchStr," +%Q",&nk);
}
++it;
}
if(!watchStr.isEmpty())
{
- KviQCString dat = m_pConnection->encodeText(watchStr);
+ KviTQCString dat = m_pConnection->encodeText(watchStr);
m_pConnection->sendFmtData("WATCH%s",dat.data());
if(_OUTPUT_VERBOSE)
m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: Adding watch entries for%Q"),&watchStr);
@@ -1146,9 +1146,9 @@ void KviWatchNotifyListManager::stop()
m_pRegUserDict->clear();
}
-bool KviWatchNotifyListManager::doMatchUser(KviIrcMessage * msg,const QString &notifyString,const KviIrcMask & mask)
+bool KviWatchNotifyListManager::doMatchUser(KviIrcMessage * msg,const TQString &notifyString,const KviIrcMask & tqmask)
{
- QString * nam = m_pRegUserDict->find(notifyString);
+ TQString * nam = m_pRegUserDict->tqfind(notifyString);
if(nam)
{
@@ -1156,39 +1156,39 @@ bool KviWatchNotifyListManager::doMatchUser(KviIrcMessage * msg,const QString &n
if(KviRegisteredUser * u = g_pRegisteredUserDataBase->findUserByName(*nam))
{
// ok ... match the user
- if(u->matchesFixed(mask))
+ if(u->matchesFixed(tqmask))
{
// new user online
- if(!(m_pConsole->notifyListView()->findEntry(mask.nick())))
+ if(!(m_pConsole->notifyListView()->findEntry(tqmask.nick())))
{
- notifyOnLine(mask.nick(),mask.user(),mask.host(),"watch");
+ notifyOnLine(tqmask.nick(),tqmask.user(),tqmask.host(),"watch");
} else {
// else already online , and matching...all ok
if(msg->numeric() == RPL_NOWON)
{
// This is a reply to a /watch +something (should not happen, unless the user is messing) or to /watch l (user requested)
- notifyOnLine(mask.nick(),mask.user(),mask.host(),
+ notifyOnLine(tqmask.nick(),tqmask.user(),tqmask.host(),
__tr2qs("watch entry listing requested by user"),false);
} else {
// This is a RPL_LOGON....we're desynched ?
- notifyOnLine(mask.nick(),mask.user(),mask.host(),
+ notifyOnLine(tqmask.nick(),tqmask.user(),tqmask.host(),
__tr2qs("possible watch list desync"),false);
}
}
} else {
// not matched.... has he been online before ?
- if(m_pConsole->notifyListView()->findEntry(mask.nick()))
+ if(m_pConsole->notifyListView()->findEntry(tqmask.nick()))
{
- // has been online just a sec ago , but now the mask does not match
+ // has been online just a sec ago , but now the tqmask does not match
// prolly the reguserdb has been changed
- notifyOffLine(mask.nick(),mask.user(),mask.host(),
- __tr2qs("registration mask changed or desync with the watch service"));
+ notifyOffLine(tqmask.nick(),tqmask.user(),tqmask.host(),
+ __tr2qs("registration tqmask changed or desync with the watch service"));
} else {
// has never been online
if(_OUTPUT_VERBOSE)
m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,
- __tr("Notify list: \r!n\r%Q\r appears to be online, but the mask [%Q@\r!h\r%Q\r] does not match (watch: registration mask does not match, or nickname is being used by someone else)"),
- &(mask.nick()),&(mask.user()),&(mask.host()));
+ __tr("Notify list: \r!n\r%Q\r appears to be online, but the tqmask [%Q@\r!h\r%Q\r] does not match (watch: registration tqmask does not match, or nickname is being used by someone else)"),
+ &(tqmask.nick()),&(tqmask.user()),&(tqmask.host()));
}
}
} else {
@@ -1202,9 +1202,9 @@ bool KviWatchNotifyListManager::doMatchUser(KviIrcMessage * msg,const QString &n
} else {
// not in our dictionary
// prolly someone used /WATCH behind our back... bad boy!
- if(!(m_pConsole->notifyListView()->findEntry(mask.nick())))
+ if(!(m_pConsole->notifyListView()->findEntry(tqmask.nick())))
{
- notifyOnLine(mask.nick(),mask.user(),mask.host(),__tr2qs("watch entry added by user"));
+ notifyOnLine(tqmask.nick(),tqmask.user(),tqmask.host(),__tr2qs("watch entry added by user"));
}
}
return true;
@@ -1228,9 +1228,9 @@ bool KviWatchNotifyListManager::handleWatchReply(KviIrcMessage *msg)
const char * nk = msg->safeParam(1);
const char * us = msg->safeParam(2);
const char * ho = msg->safeParam(3);
- QString dnk = m_pConnection->decodeText(nk);
- QString dus = m_pConnection->decodeText(us);
- QString dho = m_pConnection->decodeText(ho);
+ TQString dnk = m_pConnection->decodeText(nk);
+ TQString dus = m_pConnection->decodeText(us);
+ TQString dho = m_pConnection->decodeText(ho);
if((msg->numeric() == RPL_LOGON) || (msg->numeric() == RPL_NOWON))
{
@@ -1247,7 +1247,7 @@ bool KviWatchNotifyListManager::handleWatchReply(KviIrcMessage *msg)
if(_OUTPUT_VERBOSE)
m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: Stopped watching for \r!n\r%Q\r"),&dnk);
}
- if(m_pRegUserDict->find(dnk))m_pRegUserDict->remove(dnk); // kill that
+ if(m_pRegUserDict->tqfind(dnk))m_pRegUserDict->remove(dnk); // kill that
return true;
@@ -1263,7 +1263,7 @@ bool KviWatchNotifyListManager::handleWatchReply(KviIrcMessage *msg)
if(_OUTPUT_VERBOSE)
m_pConsole->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Notify list: \r!n\r%Q\r is offline (watch)"),&dnk);
} else {
- // This is a RPL_LOGOFF for an user that has not matched the reg-mask
+ // This is a RPL_LOGOFF for an user that has not matched the reg-tqmask
notifyOffLine(dnk,dus,dho,__tr2qs("unmatched watch list entry"));
}
}