diff options
Diffstat (limited to 'konversation/src/outputfilter.cpp')
-rw-r--r-- | konversation/src/outputfilter.cpp | 358 |
1 files changed, 179 insertions, 179 deletions
diff --git a/konversation/src/outputfilter.cpp b/konversation/src/outputfilter.cpp index 40823e2..1a291a5 100644 --- a/konversation/src/outputfilter.cpp +++ b/konversation/src/outputfilter.cpp @@ -23,13 +23,13 @@ #include "linkaddressbook/addressbook.h" #include "query.h" -#include <qstringlist.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qregexp.h> -#include <qmap.h> -#include <qvaluelist.h> -#include <qtextcodec.h> +#include <tqstringlist.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqregexp.h> +#include <tqmap.h> +#include <tqvaluelist.h> +#include <tqtextcodec.h> #include <klocale.h> #include <kdebug.h> @@ -46,7 +46,7 @@ namespace Konversation { OutputFilter::OutputFilter(Server* server) - : QObject(server) + : TQObject(server) { m_server = server; } @@ -56,24 +56,24 @@ namespace Konversation } // replace all aliases in the string and return true if anything got replaced at all - bool OutputFilter::replaceAliases(QString& line) + bool OutputFilter::replaceAliases(TQString& line) { - QStringList aliasList=Preferences::aliasList(); - QString cc(Preferences::commandChar()); + TQStringList aliasList=Preferences::aliasList(); + TQString cc(Preferences::commandChar()); // check if the line starts with a defined alias for(unsigned int index=0;index<aliasList.count();index++) { // cut alias pattern from definition - QString aliasPattern(aliasList[index].section(' ',0,0)); + TQString aliasPattern(aliasList[index].section(' ',0,0)); // cut first word from command line, so we do not wrongly find an alias // that starts with the same letters, like /m would override /me - QString lineStart=line.section(' ',0,0); + TQString lineStart=line.section(' ',0,0); // pattern found? // TODO: cc may be a regexp character here ... we should escape it then if (lineStart==cc+aliasPattern) { - QString aliasReplace; + TQString aliasReplace; // cut alias replacement from definition if ( aliasList[index].contains("%p") ) @@ -97,19 +97,19 @@ namespace Konversation return false; } - QStringList OutputFilter::splitForEncoding(const QString& inputLine, uint max) + TQStringList OutputFilter::splitForEncoding(const TQString& inputLine, uint max) { uint sublen = 0; //The encoded length since the last split int charLength = 0; //the length of this char int lastBreakPoint = 0; //FIXME should we run this through the encoder first, checking with "canEncode"? - QString text = inputLine; // the text we'll send, currently in Unicode - QStringList finals; // The strings we're going to output + TQString text = inputLine; // the text we'll send, currently in Unicode + TQStringList finals; // The strings we're going to output - QString channelCodecName=Preferences::channelEncoding(m_server->getDisplayName(), destination); + TQString channelCodecName=Preferences::channelEncoding(m_server->getDisplayName(), destination); //Get the codec we're supposed to use. This must not fail. (not verified) - QTextCodec* codec; + TQTextCodec* codec; // I copied this bit straight out of Server::send if (channelCodecName.isEmpty()) @@ -126,8 +126,8 @@ namespace Konversation while(text.length() > max) { - // The most important bit - turn the current char into a QCString so we can measure it - QCString ch = codec->fromUnicode(QString(text[index])); + // The most important bit - turn the current char into a TQCString so we can measure it + TQCString ch = codec->fromUnicode(TQString(text[index])); charLength = ch.length(); // If adding this char puts us over the limit: @@ -165,14 +165,14 @@ namespace Konversation return finals; } - OutputFilterResult OutputFilter::parse(const QString& myNick,const QString& originalLine,const QString& name) + OutputFilterResult OutputFilter::parse(const TQString& myNick,const TQString& originalLine,const TQString& name) { setCommandChar(); OutputFilterResult result; destination=name; - QString inputLine(originalLine); + TQString inputLine(originalLine); if(inputLine.isEmpty() || inputLine == "\n") return result; @@ -180,7 +180,7 @@ namespace Konversation //Protect against nickserv auth being sent as a message on the off chance // someone didn't notice leading spaces { - QString testNickServ( inputLine.stripWhiteSpace() ); + TQString testNickServ( inputLine.stripWhiteSpace() ); if(testNickServ.startsWith(commandChar+"nickserv", false) || testNickServ.startsWith(commandChar+"ns", false)) { @@ -198,13 +198,13 @@ namespace Konversation inputLine.replace("%I","\x09"); // replace %I with italics char inputLine.replace("%O","\x0f"); // replace %O with reset to default char inputLine.replace("%S","\x13"); // replace %S with strikethru char - // inputLine.replace(QRegExp("%?"),"\x15"); + // inputLine.replace(TQRegExp("%?"),"\x15"); inputLine.replace("%R","\x16"); // replace %R with reverse char inputLine.replace("%U","\x1f"); // replace %U with underline char inputLine.replace("%\x01","%"); // restore double %% as single % } - QString line=inputLine.lower(); + TQString line=inputLine.lower(); // Convert double command chars at the beginning to single ones if(line.startsWith(commandChar+commandChar) && !destination.isEmpty()) @@ -215,8 +215,8 @@ namespace Konversation // Server command? else if(line.startsWith(commandChar)) { - QString command = inputLine.section(' ', 0, 0).mid(1).lower(); - QString parameter = inputLine.section(' ', 1); + TQString command = inputLine.section(' ', 0, 0).mid(1).lower(); + TQString parameter = inputLine.section(' ', 1); if (command !="topic") parameter = parameter.stripWhiteSpace(); @@ -294,12 +294,12 @@ namespace Konversation { BYPASS_COMMAND_PARSING: - QStringList outputList=splitForEncoding(inputLine, m_server->getPreLength("PRIVMSG", destination)); + TQStringList outputList=splitForEncoding(inputLine, m_server->getPreLength("PRIVMSG", destination)); if (outputList.count() > 1) { - result.output=QString(); + result.output=TQString(); result.outputList=outputList; - for ( QStringList::Iterator it = outputList.begin(); it != outputList.end(); ++it ) + for ( TQStringList::Iterator it = outputList.begin(); it != outputList.end(); ++it ) { result.toServerList += "PRIVMSG " + destination + " :" + *it; } @@ -324,7 +324,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseShowTuner(const QString ¶meter) + OutputFilterResult OutputFilter::parseShowTuner(const TQString ¶meter) { KonversationApplication *konvApp = static_cast<KonversationApplication*>(KApplication::kApplication()); OutputFilterResult result; @@ -339,37 +339,37 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseOp(const QString ¶meter) + OutputFilterResult OutputFilter::parseOp(const TQString ¶meter) { return changeMode(parameter,'o','+'); } - OutputFilterResult OutputFilter::parseDeop(const QString &ownNick, const QString ¶meter) + OutputFilterResult OutputFilter::parseDeop(const TQString &ownNick, const TQString ¶meter) { return changeMode(addNickToEmptyNickList(ownNick,parameter),'o','-'); } - OutputFilterResult OutputFilter::parseHop(const QString ¶meter) + OutputFilterResult OutputFilter::parseHop(const TQString ¶meter) { return changeMode(parameter, 'h', '+'); } - OutputFilterResult OutputFilter::parseDehop(const QString &ownNick, const QString ¶meter) + OutputFilterResult OutputFilter::parseDehop(const TQString &ownNick, const TQString ¶meter) { return changeMode(addNickToEmptyNickList(ownNick,parameter), 'h', '-'); } - OutputFilterResult OutputFilter::parseVoice(const QString ¶meter) + OutputFilterResult OutputFilter::parseVoice(const TQString ¶meter) { return changeMode(parameter,'v','+'); } - OutputFilterResult OutputFilter::parseUnvoice(const QString &ownNick, const QString ¶meter) + OutputFilterResult OutputFilter::parseUnvoice(const TQString &ownNick, const TQString ¶meter) { return changeMode(addNickToEmptyNickList(ownNick,parameter),'v','-'); } - OutputFilterResult OutputFilter::parseJoin(QString& channelName) + OutputFilterResult OutputFilter::parseJoin(TQString& channelName) { OutputFilterResult result; @@ -402,14 +402,14 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseKick(const QString ¶meter) + OutputFilterResult OutputFilter::parseKick(const TQString ¶meter) { OutputFilterResult result; if(isAChannel(destination)) { // get nick to kick - QString victim = parameter.left(parameter.find(" ")); + TQString victim = parameter.left(parameter.find(" ")); if(victim.isEmpty()) { @@ -418,7 +418,7 @@ namespace Konversation else { // get kick reason (if any) - QString reason = parameter.mid(victim.length() + 1); + TQString reason = parameter.mid(victim.length() + 1); // if no reason given, take default reason if(reason.isEmpty()) @@ -437,7 +437,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parsePart(const QString ¶meter) + OutputFilterResult OutputFilter::parsePart(const TQString ¶meter) { OutputFilterResult result; @@ -460,9 +460,9 @@ namespace Konversation if(isAChannel(parameter)) { // get channel name - QString channel = parameter.left(parameter.find(" ")); + TQString channel = parameter.left(parameter.find(" ")); // get part reason (if any) - QString reason = parameter.mid(channel.length() + 1); + TQString reason = parameter.mid(channel.length() + 1); // if no reason given, take default reason if(reason.isEmpty()) @@ -489,7 +489,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseTopic(const QString ¶meter) + OutputFilterResult OutputFilter::parseTopic(const TQString ¶meter) { OutputFilterResult result; @@ -512,9 +512,9 @@ namespace Konversation if(isAChannel(parameter)) { // get channel name - QString channel=parameter.left(parameter.find(" ")); + TQString channel=parameter.left(parameter.find(" ")); // get topic (if any) - QString topic=parameter.mid(channel.length()+1); + TQString topic=parameter.mid(channel.length()+1); // if no topic given, retrieve topic if(topic.isEmpty()) { @@ -525,7 +525,7 @@ namespace Konversation { result.toServer = "TOPIC " + channel + " :"; //If we get passed a ^A as a topic its a sign we should clear the topic. - //Used to be a \n, but those get smashed by QStringList::split and readded later + //Used to be a \n, but those get smashed by TQStringList::split and readded later //Now is not the time to fight with that. FIXME //If anyone out there *can* actually set the topic to a single ^A, now they have to //specify it twice to get one. @@ -553,7 +553,7 @@ namespace Konversation return result; } - void OutputFilter::parseAway(QString& reason) + void OutputFilter::parseAway(TQString& reason) { if (reason.isEmpty() && m_server->isAway()) m_server->requestUnaway(); @@ -566,7 +566,7 @@ namespace Konversation m_server->requestUnaway(); } - OutputFilterResult OutputFilter::parseNames(const QString ¶meter) + OutputFilterResult OutputFilter::parseNames(const TQString ¶meter) { OutputFilterResult result; result.toServer = "NAMES "; @@ -574,14 +574,14 @@ namespace Konversation { return error(i18n("%1NAMES with no target may disconnect you from the server. Specify '*' if you really want this.").arg(commandChar)); } - else if (parameter != QChar('*')) + else if (parameter != TQChar('*')) { result.toServer.append(parameter); } return result; } - OutputFilterResult OutputFilter::parseClose(QString parm) + OutputFilterResult OutputFilter::parseClose(TQString parm) { if (parm.isEmpty()) parm=destination; @@ -597,7 +597,7 @@ namespace Konversation return OutputFilterResult(); } - OutputFilterResult OutputFilter::parseQuit(const QString &reason) + OutputFilterResult OutputFilter::parseQuit(const TQString &reason) { OutputFilterResult result; @@ -611,11 +611,11 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseNotice(const QString ¶meter) + OutputFilterResult OutputFilter::parseNotice(const TQString ¶meter) { OutputFilterResult result; - QString recipient = parameter.left(parameter.find(" ")); - QString message = parameter.mid(recipient.length()+1); + TQString recipient = parameter.left(parameter.find(" ")); + TQString message = parameter.mid(recipient.length()+1); if(parameter.isEmpty() || message.isEmpty()) { @@ -632,7 +632,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseMe(const QString ¶meter, const QString &destination) + OutputFilterResult OutputFilter::parseMe(const TQString ¶meter, const TQString &destination) { OutputFilterResult result; @@ -650,12 +650,12 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseMsg(const QString &myNick, const QString ¶meter, bool isQuery) + OutputFilterResult OutputFilter::parseMsg(const TQString &myNick, const TQString ¶meter, bool isQuery) { OutputFilterResult result; - QString recipient = parameter.section(" ", 0, 0, QString::SectionSkipEmpty); - QString message = parameter.section(" ", 1); - QString output; + TQString recipient = parameter.section(" ", 0, 0, TQString::SectionSkipEmpty); + TQString message = parameter.section(" ", 1); + TQString output; if (recipient.isEmpty()) { @@ -681,7 +681,7 @@ namespace Konversation else if (message.startsWith(commandChar+"me")) { result.toServer = "PRIVMSG " + recipient + " :" + '\x01' + "ACTION " + message.mid(4) + '\x01'; - output = QString("* %1 %2").arg(myNick).arg(message.mid(4)); + output = TQString("* %1 %2").arg(myNick).arg(message.mid(4)); } else { @@ -728,11 +728,11 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseSMsg(const QString ¶meter) + OutputFilterResult OutputFilter::parseSMsg(const TQString ¶meter) { OutputFilterResult result; - QString recipient = parameter.left(parameter.find(" ")); - QString message = parameter.mid(recipient.length() + 1); + TQString recipient = parameter.left(parameter.find(" ")); + TQString message = parameter.mid(recipient.length() + 1); if(message.startsWith(commandChar + "me")) { @@ -746,24 +746,24 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseCtcp(const QString ¶meter) + OutputFilterResult OutputFilter::parseCtcp(const TQString ¶meter) { OutputFilterResult result; // who is the recipient? - QString recipient = parameter.section(' ', 0, 0); + TQString recipient = parameter.section(' ', 0, 0); // what is the first word of the ctcp? - QString request = parameter.section(' ', 1, 1, QString::SectionSkipEmpty).upper(); + TQString request = parameter.section(' ', 1, 1, TQString::SectionSkipEmpty).upper(); // what is the complete ctcp command? - QString message = parameter.section(' ', 2, 0xffffff, QString::SectionSkipEmpty); + TQString message = parameter.section(' ', 2, 0xffffff, TQString::SectionSkipEmpty); - QString out = request; + TQString out = request; if (!message.isEmpty()) out+= ' ' + message; if (request == "PING") { - unsigned int time_t = QDateTime::currentDateTime().toTime_t(); - result.toServer = QString("PRIVMSG %1 :\x01PING %2\x01").arg(recipient).arg(time_t); + unsigned int time_t = TQDateTime::currentDateTime().toTime_t(); + result.toServer = TQString("PRIVMSG %1 :\x01PING %2\x01").arg(recipient).arg(time_t); result.output = i18n("Sending CTCP-%1 request to %2.").arg("PING").arg(recipient); } else @@ -777,13 +777,13 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::changeMode(const QString ¶meter,char mode,char giveTake) + OutputFilterResult OutputFilter::changeMode(const TQString ¶meter,char mode,char giveTake) { OutputFilterResult result; // TODO: Make sure this works with +l <limit> and +k <password> also! - QString token; - QString tmpToken; - QStringList nickList = QStringList::split(' ', parameter); + TQString token; + TQString tmpToken; + TQStringList nickList = TQStringList::split(' ', parameter); if(nickList.count()) { @@ -804,10 +804,10 @@ namespace Konversation if(token.length()) { unsigned int modeCount = nickList.count(); - QString modes; + TQString modes; modes.fill(mode, modeCount); - token += QString(" ") + QChar(giveTake) + modes; + token += TQString(" ") + TQChar(giveTake) + modes; tmpToken = token; for(unsigned int index = 0; index < modeCount; index++) @@ -830,7 +830,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseDcc(const QString ¶meter) + OutputFilterResult OutputFilter::parseDcc(const TQString ¶meter) { OutputFilterResult result; @@ -841,10 +841,10 @@ namespace Konversation } else { - QString tmpParameter = parameter; - QStringList parameterList = QStringList::split(' ', tmpParameter.replace("\\ ", "%20")); + TQString tmpParameter = parameter; + TQStringList parameterList = TQStringList::split(' ', tmpParameter.replace("\\ ", "%20")); - QString dccType = parameterList[0].lower(); + TQString dccType = parameterList[0].lower(); if(dccType=="close") { @@ -868,7 +868,7 @@ namespace Konversation //We could easily check if the remote file exists, but then we might //end up asking for creditionals twice, so settle for only checking locally - if(!fileURL.isLocalFile() || QFile::exists( fileURL.path() )) + if(!fileURL.isLocalFile() || TQFile::exists( fileURL.path() )) { emit openDccSend(parameterList[1],fileURL); } @@ -903,16 +903,16 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::sendRequest(const QString &recipient,const QString &fileName,const QString &address,const QString &port,unsigned long size) + OutputFilterResult OutputFilter::sendRequest(const TQString &recipient,const TQString &fileName,const TQString &address,const TQString &port,unsigned long size) { OutputFilterResult result; - QString niftyFileName(fileName); - /*QFile file(fileName); - QFileInfo info(file);*/ + TQString niftyFileName(fileName); + /*TQFile file(fileName); + TQFileInfo info(file);*/ result.toServer = "PRIVMSG " + recipient + " :" + '\x01' + "DCC SEND " + fileName - + ' ' + address + ' ' + port + ' ' + QString::number(size) + '\x01'; + + ' ' + address + ' ' + port + ' ' + TQString::number(size) + '\x01'; // Dirty hack to avoid printing ""name with spaces.ext"" instead of "name with spaces.ext" if ((fileName.startsWith("\"")) && (fileName.endsWith("\""))) @@ -921,14 +921,14 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::passiveSendRequest(const QString& recipient,const QString &fileName,const QString &address,unsigned long size,const QString &token) + OutputFilterResult OutputFilter::passiveSendRequest(const TQString& recipient,const TQString &fileName,const TQString &address,unsigned long size,const TQString &token) { OutputFilterResult result; - QString niftyFileName(fileName); + TQString niftyFileName(fileName); result.toServer = "PRIVMSG " + recipient + " :" + '\x01' + "DCC SEND " + fileName - + ' ' + address + " 0 " + QString::number(size) + ' ' + token + '\x01'; + + ' ' + address + " 0 " + TQString::number(size) + ' ' + token + '\x01'; // Dirty hack to avoid printing ""name with spaces.ext"" instead of "name with spaces.ext" if ((fileName.startsWith("\"")) && (fileName.endsWith("\""))) @@ -938,13 +938,13 @@ namespace Konversation } // Accepting Resume Request - OutputFilterResult OutputFilter::acceptResumeRequest(const QString &recipient,const QString &fileName,const QString &port,int startAt) + OutputFilterResult OutputFilter::acceptResumeRequest(const TQString &recipient,const TQString &fileName,const TQString &port,int startAt) { - QString niftyFileName(fileName); + TQString niftyFileName(fileName); OutputFilterResult result; result.toServer = "PRIVMSG " + recipient + " :" + '\x01' + "DCC ACCEPT " + fileName + ' ' + port - + ' ' + QString::number(startAt) + '\x01'; + + ' ' + TQString::number(startAt) + '\x01'; // Dirty hack to avoid printing ""name with spaces.ext"" instead of "name with spaces.ext" if ((fileName.startsWith("\"")) && (fileName.endsWith("\""))) @@ -953,15 +953,15 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::resumeRequest(const QString &sender,const QString &fileName,const QString &port,KIO::filesize_t startAt) + OutputFilterResult OutputFilter::resumeRequest(const TQString &sender,const TQString &fileName,const TQString &port,KIO::filesize_t startAt) { - QString niftyFileName(fileName); + TQString niftyFileName(fileName); OutputFilterResult result; - /*QString newFileName(fileName); + /*TQString newFileName(fileName); newFileName.replace(" ", "_");*/ result.toServer = "PRIVMSG " + sender + " :" + '\x01' + "DCC RESUME " + fileName + ' ' + port + ' ' - + QString::number(startAt) + '\x01'; + + TQString::number(startAt) + '\x01'; // Dirty hack to avoid printing ""name with spaces.ext"" instead of "name with spaces.ext" if ((fileName.startsWith("\"")) && (fileName.endsWith("\""))) @@ -970,15 +970,15 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::acceptPassiveSendRequest(const QString& recipient,const QString &fileName,const QString &address,const QString &port,unsigned long size,const QString &token) + OutputFilterResult OutputFilter::acceptPassiveSendRequest(const TQString& recipient,const TQString &fileName,const TQString &address,const TQString &port,unsigned long size,const TQString &token) { OutputFilterResult result; - QString niftyFileName(fileName); + TQString niftyFileName(fileName); // "DCC SEND" to receive a file sounds weird, but it's ok. result.toServer = "PRIVMSG " + recipient + " :" + '\x01' + "DCC SEND " + fileName - + ' ' + address + ' ' + port + ' ' + QString::number(size) + ' ' + token + '\x01'; + + ' ' + address + ' ' + port + ' ' + TQString::number(size) + ' ' + token + '\x01'; // Dirty hack to avoid printing ""name with spaces.ext"" instead of "name with spaces.ext" if ((fileName.startsWith("\"")) && (fileName.endsWith("\""))) @@ -987,7 +987,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseInvite(const QString ¶meter) + OutputFilterResult OutputFilter::parseInvite(const TQString ¶meter) { OutputFilterResult result; @@ -997,8 +997,8 @@ namespace Konversation } else { - QString nick = parameter.section(' ', 0, 0, QString::SectionSkipEmpty); - QString channel = parameter.section(' ', 1, 1, QString::SectionSkipEmpty); + TQString nick = parameter.section(' ', 0, 0, TQString::SectionSkipEmpty); + TQString channel = parameter.section(' ', 1, 1, TQString::SectionSkipEmpty); if(channel.isEmpty()) { @@ -1028,7 +1028,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseExec(const QString& parameter) + OutputFilterResult OutputFilter::parseExec(const TQString& parameter) { OutputFilterResult result; @@ -1038,7 +1038,7 @@ namespace Konversation } else { - QStringList parameterList = QStringList::split(' ', parameter); + TQStringList parameterList = TQStringList::split(' ', parameter); if(parameterList[0].find("../") == -1) { @@ -1053,7 +1053,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseRaw(const QString& parameter) + OutputFilterResult OutputFilter::parseRaw(const TQString& parameter) { OutputFilterResult result; @@ -1073,11 +1073,11 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseNotify(const QString& parameter) + OutputFilterResult OutputFilter::parseNotify(const TQString& parameter) { OutputFilterResult result; - QString groupName = m_server->getDisplayName(); + TQString groupName = m_server->getDisplayName(); int serverGroupId = -1; @@ -1086,7 +1086,7 @@ namespace Konversation if (!parameter.isEmpty() && serverGroupId != -1) { - QStringList list = QStringList::split(' ', parameter); + TQStringList list = TQStringList::split(' ', parameter); for(unsigned int index = 0; index < list.count(); index++) { @@ -1103,7 +1103,7 @@ namespace Konversation } // show (new) notify list to user - QString list = Preferences::notifyStringByGroupName(groupName) + ' ' + Konversation::Addressbook::self()->allContactsNicksForServer(m_server->getServerName(), m_server->getDisplayName()).join(" "); + TQString list = Preferences::notifyStringByGroupName(groupName) + ' ' + Konversation::Addressbook::self()->allContactsNicksForServer(m_server->getServerName(), m_server->getDisplayName()).join(" "); result.typeString = i18n("Notify"); @@ -1116,15 +1116,15 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseOper(const QString& myNick,const QString& parameter) + OutputFilterResult OutputFilter::parseOper(const TQString& myNick,const TQString& parameter) { OutputFilterResult result; - QStringList parameterList = QStringList::split(' ', parameter); + TQStringList parameterList = TQStringList::split(' ', parameter); if(parameter.isEmpty() || parameterList.count() == 1) { - QString nick((parameterList.count() == 1) ? parameterList[0] : myNick); - QString password; + TQString nick((parameterList.count() == 1) ? parameterList[0] : myNick); + TQString password; bool keep = false; int ret = KIO::PasswordDialog::getNameAndPassword @@ -1150,7 +1150,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseBan(const QString& parameter, bool kick) + OutputFilterResult OutputFilter::parseBan(const TQString& parameter, bool kick) { OutputFilterResult result; // assume incorrect syntax first @@ -1158,11 +1158,11 @@ namespace Konversation if(!parameter.isEmpty()) { - QStringList parameterList=QStringList::split(' ',parameter); - QString channel; - QString option; + TQStringList parameterList=TQStringList::split(' ',parameter); + TQString channel; + TQString option; // check for option - QString lowerParameter = parameterList[0].lower(); + TQString lowerParameter = parameterList[0].lower(); bool host = (lowerParameter == "-host"); bool domain = (lowerParameter == "-domain"); bool uhost = (lowerParameter == "-userhost"); @@ -1203,14 +1203,14 @@ namespace Konversation { if (kick) { - QString victim = parameterList[0]; + TQString victim = parameterList[0]; parameterList.pop_front(); - QString reason = parameterList.join(" "); + TQString reason = parameterList.join(" "); result.toServer = "KICK " + channel + ' ' + victim + " :" + reason; - emit banUsers(QStringList(victim),channel,option); + emit banUsers(TQStringList(victim),channel,option); } else { @@ -1235,14 +1235,14 @@ namespace Konversation } // finally set the ban - OutputFilterResult OutputFilter::execBan(const QString& mask,const QString& channel) + OutputFilterResult OutputFilter::execBan(const TQString& mask,const TQString& channel) { OutputFilterResult result; result.toServer = "MODE " + channel + " +b " + mask; return result; } - OutputFilterResult OutputFilter::parseUnban(const QString& parameter) + OutputFilterResult OutputFilter::parseUnban(const TQString& parameter) { OutputFilterResult result; // assume incorrect syntax first @@ -1250,9 +1250,9 @@ namespace Konversation if(!parameter.isEmpty()) { - QStringList parameterList = QStringList::split(' ', parameter); - QString channel; - QString mask; + TQStringList parameterList = TQStringList::split(' ', parameter); + TQString channel; + TQString mask; // if the user specified a channel if(isAChannel(parameterList[0])) @@ -1289,14 +1289,14 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::execUnban(const QString& mask,const QString& channel) + OutputFilterResult OutputFilter::execUnban(const TQString& mask,const TQString& channel) { OutputFilterResult result; result.toServer = "MODE " + channel + " -b " + mask; return result; } - OutputFilterResult OutputFilter::parseIgnore(const QString& parameter) + OutputFilterResult OutputFilter::parseIgnore(const TQString& parameter) { OutputFilterResult result; // assume incorrect syntax first @@ -1305,7 +1305,7 @@ namespace Konversation // did the user give parameters at all? if(!parameter.isEmpty()) { - QStringList parameterList = QStringList::split(' ', parameter); + TQStringList parameterList = TQStringList::split(' ', parameter); // if nothing else said, only ignore channels and queries int value = Ignore::Channel | Ignore::Query; @@ -1328,7 +1328,7 @@ namespace Konversation parameterList[index] += "!*"; } - Preferences::addIgnore(parameterList[index] + ',' + QString::number(value)); + Preferences::addIgnore(parameterList[index] + ',' + TQString::number(value)); } result.output = i18n("Added %1 to your ignore list.").arg(parameterList.join(", ")); @@ -1348,7 +1348,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseUnignore(const QString& parameter) + OutputFilterResult OutputFilter::parseUnignore(const TQString& parameter) { OutputFilterResult result; @@ -1358,19 +1358,19 @@ namespace Konversation } else { - QString unignore = parameter.simplifyWhiteSpace(); - QStringList unignoreList = QStringList::split(' ',unignore); + TQString unignore = parameter.simplifyWhiteSpace(); + TQStringList unignoreList = TQStringList::split(' ',unignore); - QStringList succeeded; - QStringList failed; + TQStringList succeeded; + TQStringList failed; // Iterate over potential unignores - for (QStringList::Iterator it = unignoreList.begin(); it != unignoreList.end(); ++it) + for (TQStringList::Iterator it = unignoreList.begin(); it != unignoreList.end(); ++it) { // If pattern looks incomplete, try to complete it if (!(*it).contains('!')) { - QString fixedPattern = (*it); + TQString fixedPattern = (*it); fixedPattern += "!*"; bool success = false; @@ -1423,7 +1423,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseQuote(const QString& parameter) + OutputFilterResult OutputFilter::parseQuote(const TQString& parameter) { OutputFilterResult result; @@ -1439,7 +1439,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseSay(const QString& parameter) + OutputFilterResult OutputFilter::parseSay(const TQString& parameter) { OutputFilterResult result; @@ -1467,14 +1467,14 @@ namespace Konversation // # & + and ! are *often*, but not necessarily, channel identifiers. + and ! are non-RFC, so if a server doesn't offer 005 and // supports + and ! channels, I think thats broken behaviour on their part - not ours. - bool OutputFilter::isAChannel(const QString &check) + bool OutputFilter::isAChannel(const TQString &check) { Q_ASSERT(m_server); // XXX if we ever see the assert, we need the ternary - return m_server? m_server->isAChannel(check) : QString("#&").contains(check.at(0)); + return m_server? m_server->isAChannel(check) : TQString("#&").contains(check.at(0)); } - OutputFilterResult OutputFilter::usage(const QString& string) + OutputFilterResult OutputFilter::usage(const TQString& string) { OutputFilterResult result; result.typeString = i18n("Usage"); @@ -1483,7 +1483,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::info(const QString& string) + OutputFilterResult OutputFilter::info(const TQString& string) { OutputFilterResult result; result.typeString = i18n("Info"); @@ -1492,7 +1492,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::error(const QString& string) + OutputFilterResult OutputFilter::error(const TQString& string) { OutputFilterResult result; result.typeString = i18n("Error"); @@ -1501,7 +1501,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseAme(const QString& parameter) + OutputFilterResult OutputFilter::parseAme(const TQString& parameter) { OutputFilterResult result; @@ -1514,7 +1514,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseAmsg(const QString& parameter) + OutputFilterResult OutputFilter::parseAmsg(const TQString& parameter) { OutputFilterResult result; @@ -1527,22 +1527,22 @@ namespace Konversation return result; } - void OutputFilter::parseServer(const QString& parameter) + void OutputFilter::parseServer(const TQString& parameter) { if (parameter.isEmpty() && !m_server->isConnected() && !m_server->isConnecting()) emit reconnectServer(); else { - QStringList splitted = QStringList::split(" ", parameter); - QString host = splitted[0]; - QString port = "6667"; - QString password; + TQStringList splitted = TQStringList::split(" ", parameter); + TQString host = splitted[0]; + TQString port = "6667"; + TQString password; if (splitted.count() == 3) emit connectTo(Konversation::CreateNewConnection, splitted[0], splitted[1], splitted[2]); else if (splitted.count() == 2) { - if (splitted[0].contains(QRegExp(":[0-9]+$"))) + if (splitted[0].contains(TQRegExp(":[0-9]+$"))) emit connectTo(Konversation::CreateNewConnection, splitted[0], "", splitted[1]); else emit connectTo(Konversation::CreateNewConnection, splitted[0], splitted[1]); @@ -1552,7 +1552,7 @@ namespace Konversation } } - OutputFilterResult OutputFilter::parseOmsg(const QString& parameter) + OutputFilterResult OutputFilter::parseOmsg(const TQString& parameter) { OutputFilterResult result; @@ -1568,7 +1568,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseOnotice(const QString& parameter) + OutputFilterResult OutputFilter::parseOnotice(const TQString& parameter) { OutputFilterResult result; @@ -1587,7 +1587,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseCharset(const QString& charset) + OutputFilterResult OutputFilter::parseCharset(const TQString& charset) { OutputFilterResult result; @@ -1598,7 +1598,7 @@ namespace Konversation return result; } - QString shortName = Konversation::IRCCharsets::self()->ambiguousNameToShortName(charset); + TQString shortName = Konversation::IRCCharsets::self()->ambiguousNameToShortName(charset); if(!shortName.isEmpty()) { @@ -1614,10 +1614,10 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseSetKey(const QString& parameter) + OutputFilterResult OutputFilter::parseSetKey(const TQString& parameter) { - QStringList parms = QStringList::split(" ", parameter); + TQStringList parms = TQStringList::split(" ", parameter); if (parms.count() == (0 >> parms.count() > 2)) return usage(i18n("Usage: %1setkey [<nick|channel>] <key> sets the encryption key for nick or channel. %2setkey <key> when in a channel or query tab to set the key for it.").arg(commandChar).arg(commandChar) ); @@ -1634,9 +1634,9 @@ namespace Konversation return info(i18n("The key for %1 has been set.").arg(parms[0])); } - OutputFilterResult OutputFilter::parseDelKey(const QString& prametr) + OutputFilterResult OutputFilter::parseDelKey(const TQString& prametr) { - QString parameter(prametr.isEmpty()?destination:prametr); + TQString parameter(prametr.isEmpty()?destination:prametr); if(parameter.isEmpty() || parameter.contains(' ')) return usage(i18n("Usage: %1delkey <nick> or <channel> deletes the encryption key for nick or channel").arg(commandChar)); @@ -1651,11 +1651,11 @@ namespace Konversation return info(i18n("The key for %1 has been deleted.").arg(parameter)); } - OutputFilterResult OutputFilter::parseShowKey(const QString& prametr) + OutputFilterResult OutputFilter::parseShowKey(const TQString& prametr) { - QString parameter(prametr.isEmpty()?destination:prametr); - QString key(m_server->getKeyForRecipient(parameter)); - QWidget *mw=KonversationApplication::instance()->getMainWindow(); + TQString parameter(prametr.isEmpty()?destination:prametr); + TQString key(m_server->getKeyForRecipient(parameter)); + TQWidget *mw=KonversationApplication::instance()->getMainWindow(); if (!key.isEmpty()) KMessageBox::information(mw, i18n("The key for %1 is \"%2\".").arg(parameter).arg(key), i18n("Blowfish")); else @@ -1664,7 +1664,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseList(const QString& parameter) + OutputFilterResult OutputFilter::parseList(const TQString& parameter) { OutputFilterResult result; @@ -1673,7 +1673,7 @@ namespace Konversation return result; } - OutputFilterResult OutputFilter::parseDNS(const QString& parameter) + OutputFilterResult OutputFilter::parseDNS(const TQString& parameter) { OutputFilterResult result; @@ -1683,8 +1683,8 @@ namespace Konversation } else { - QStringList splitted = QStringList::split(" ", parameter); - QString target = splitted[0]; + TQStringList splitted = TQStringList::split(" ", parameter); + TQString target = splitted[0]; KIpAddress address(target); @@ -1696,8 +1696,8 @@ namespace Konversation // coping with it. #if KDE_IS_VERSION(3,5,1) KNetwork:: KInetSocketAddress socketAddress(address,0); - QString resolvedTarget; - QString serv; // We don't need this, but KReverseResolver::resolve does. + TQString resolvedTarget; + TQString serv; // We don't need this, but KReverseResolver::resolve does. if (KNetwork::KReverseResolver::resolve(socketAddress,resolvedTarget,serv)) { @@ -1722,7 +1722,7 @@ namespace Konversation KNetwork::KResolverResults resolved = KNetwork::KResolver::resolve(target,""); if(resolved.error() == KResolver::NoError && resolved.size() > 0) { - QString resolvedTarget = resolved.first().address().nodeName(); + TQString resolvedTarget = resolved.first().address().nodeName(); result.typeString = i18n("DNS"); result.output = i18n("Resolved %1 to: %2").arg(target).arg(resolvedTarget); result.type = Program; @@ -1744,10 +1744,10 @@ namespace Konversation } - QString OutputFilter::addNickToEmptyNickList(const QString& nick, const QString& parameter) + TQString OutputFilter::addNickToEmptyNickList(const TQString& nick, const TQString& parameter) { - QStringList nickList = QStringList::split(' ', parameter); - QString newNickList; + TQStringList nickList = TQStringList::split(' ', parameter); + TQString newNickList; if (nickList.count() == 0) { @@ -1767,7 +1767,7 @@ namespace Konversation return newNickList; } - OutputFilterResult OutputFilter::parseKill(const QString& parameter) + OutputFilterResult OutputFilter::parseKill(const TQString& parameter) { OutputFilterResult result; @@ -1777,7 +1777,7 @@ namespace Konversation } else { - QString victim = parameter.section(' ', 0, 0); + TQString victim = parameter.section(' ', 0, 0); result.toServer = "KILL " + victim + " :" + parameter.mid(victim.length() + 1); } |