diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /ksirc/chanparser.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksirc/chanparser.cpp')
-rw-r--r-- | ksirc/chanparser.cpp | 226 |
1 files changed, 113 insertions, 113 deletions
diff --git a/ksirc/chanparser.cpp b/ksirc/chanparser.cpp index 8429a6f5..f3015019 100644 --- a/ksirc/chanparser.cpp +++ b/ksirc/chanparser.cpp @@ -13,15 +13,15 @@ #include <stdio.h> -#include <qregexp.h> -#include <qapplication.h> +#include <tqregexp.h> +#include <tqapplication.h> #include <klocale.h> #include <kmessagebox.h> #include <kdebug.h> -#include <qptrlist.h> +#include <tqptrlist.h> // Static parser table is "initialized" -QDict<parseFunc> ChannelParser::parserTable; +TQDict<parseFunc> ChannelParser::parserTable; ChannelParser::ChannelParser(KSircTopLevel *_top) @@ -64,13 +64,13 @@ ChannelParser::ChannelParser(KSircTopLevel *_top) } -parseResult *ChannelParser::parse(QString string) +parseResult *ChannelParser::parse(TQString string) { // for older Qts parseFunc *pf; if(string.length() < 3){ - return new parseError(string, QString("Dumb string, too short")); + return new parseError(string, TQString("Dumb string, too short")); } /** @@ -85,8 +85,8 @@ parseResult *ChannelParser::parse(QString string) if ((string[0] == '`') & (string.length() > 7)) { - QString prefix = "`"+string[7]+"`"; - string = prefix + QString(" ") + string.mid(8).stripWhiteSpace(); + TQString prefix = "`"+string[7]+"`"; + string = prefix + TQString(" ") + string.mid(8).stripWhiteSpace(); } else if((string[0] == '*') && (string[1] == ' ')) { string.insert(1, ' '); @@ -114,31 +114,31 @@ parseResult *ChannelParser::parse(QString string) return 0; } -parseResult * ChannelParser::parseSSFEClear(QString string) +parseResult * ChannelParser::parseSSFEClear(TQString string) { // top->mainw->clear(); top->clearWindow(); // top->mainw->repaint(TRUE); string.truncate(0); - return new parseSucc(QString::null); // Null string, don't display anything + return new parseSucc(TQString::null); // Null string, don't display anything } -parseResult * ChannelParser::parseSSFEStatus(QString string) +parseResult * ChannelParser::parseSSFEStatus(TQString string) { string.remove(0, 12); // strip off the first 12 characters "<junk> [sirc] " if(string.length() == 0) return new parseError("", i18n("Unable to parse status string")); //kdDebug(5008) << "String: " << string << endl; - QRegExp rx("(\\S+).*\\(*([+-]*[+-\\w\\d]*)\\)*.*on (\\S+) \\((\\S+)\\)"); + TQRegExp rx("(\\S+).*\\(*([+-]*[+-\\w\\d]*)\\)*.*on (\\S+) \\((\\S+)\\)"); if(rx.search(string) == -1){ return new parseError("", i18n("Unable to parse status (no known format) string")); } - QString nick = rx.cap(1); - QString modes = rx.cap(2); - QString chan = rx.cap(3); - QString chanmode = rx.cap(4); + TQString nick = rx.cap(1); + TQString modes = rx.cap(2); + TQString chan = rx.cap(3); + TQString chanmode = rx.cap(4); /* * fix up modes which may have gotten the (away) part @@ -191,24 +191,24 @@ parseResult * ChannelParser::parseSSFEStatus(QString string) top->channelButtons->setMenuItemMode(6, true); else top->channelButtons->setMenuItemMode(6, false); - QString status_line = QString("%1 (%2) %3 (%4) ").arg(chan).arg(chanmode).arg(nick).arg(modes); + TQString status_line = TQString("%1 (%2) %3 (%4) ").arg(chan).arg(chanmode).arg(nick).arg(modes); /* * Go srearching for key and limit messages */ - QRegExp rxKey("<key: (\\S+)>"); + TQRegExp rxKey("<key: (\\S+)>"); if(rxKey.search(string) >= 0){ top->channelButtons->setMenuItemMode(2, true); - status_line += QString("<key: %1>").arg(rxKey.cap(1)); + status_line += TQString("<key: %1>").arg(rxKey.cap(1)); } else { top->channelButtons->setMenuItemMode(2, false); } - QRegExp rxLimit("<limit: (\\S+)>"); + TQRegExp rxLimit("<limit: (\\S+)>"); if(rxLimit.search(string) >= 0){ top->channelButtons->setMenuItemMode(1, true); - status_line += QString("<limit: %1>").arg(rxLimit.cap(1)); + status_line += TQString("<limit: %1>").arg(rxLimit.cap(1)); } else { top->channelButtons->setMenuItemMode(1, false); @@ -241,38 +241,38 @@ parseResult * ChannelParser::parseSSFEStatus(QString string) top->caption = status_line; // Make copy so we're not // constantly changing the title bar } - return new parseSucc(QString::null); // Null string, don't display anything + return new parseSucc(TQString::null); // Null string, don't display anything } -parseResult * ChannelParser::parseSSFEInit(QString) +parseResult * ChannelParser::parseSSFEInit(TQString) { - return new parseSucc(QString::null); // Null string, don't display anything + return new parseSucc(TQString::null); // Null string, don't display anything } -parseResult * ChannelParser::parseSSFEOut(QString) +parseResult * ChannelParser::parseSSFEOut(TQString) { - return new parseSucc(QString::null); // Null string, don't display anything + return new parseSucc(TQString::null); // Null string, don't display anything } -parseResult * ChannelParser::parseSSFEMsg(QString string) +parseResult * ChannelParser::parseSSFEMsg(TQString string) { if(string.length() > 100) - return new parseError(QString::null, i18n("String length for nick is greater than 100 characters. This is unacceptably long.")); + return new parseError(TQString::null, i18n("String length for nick is greater than 100 characters. This is unacceptably long.")); int l = string.length(); if (l <= 0) return new parseError(string, i18n("String not long enough")); - return new parseSucc(QString::null); // Null string, don't display anything + return new parseSucc(TQString::null); // Null string, don't display anything } -parseResult * ChannelParser::parseSSFEPrompt(QString string) +parseResult * ChannelParser::parseSSFEPrompt(TQString string) { if(prompt_active == FALSE){ - QString prompt, caption; + TQString prompt, caption; ssfePrompt *sp; // Flush the screen. @@ -280,7 +280,7 @@ parseResult * ChannelParser::parseSSFEPrompt(QString string) // (it's garunteed to be the first one) top->LineBuffer.remove( *top->LineBuffer.begin() ); top->Buffer = FALSE; - top->sirc_receive(QString("")); + top->sirc_receive(TQString("")); // "'[pP]' " gives 4 spaces if(string.length() < 5) @@ -293,7 +293,7 @@ parseResult * ChannelParser::parseSSFEPrompt(QString string) // if we haven't popped up on the remote display yet. KSirc::TextParagIterator it = top->mainw->firstParag(); - QString last; + TQString last; while(it.atEnd() == FALSE) { last = it.plainText(); ++it; @@ -319,39 +319,39 @@ parseResult * ChannelParser::parseSSFEPrompt(QString string) prompt_active = FALSE; } - return new parseSucc(QString::null); // Null string, don't display anything + return new parseSucc(TQString::null); // Null string, don't display anything } -parseResult * ChannelParser::parseSSFEReconnect(QString) +parseResult * ChannelParser::parseSSFEReconnect(TQString) { if(top->channelInfo().channel()[0] == '#' || top->channelInfo().channel()[0] == '&'){ - QString str = "/join " + QString(top->channelInfo().channel()) + "\n"; + TQString str = "/join " + TQString(top->channelInfo().channel()) + "\n"; emit top->outputUnicodeLine(str); } - return new parseSucc(QString::null); // Null string, don't display anything + return new parseSucc(TQString::null); // Null string, don't display anything } -parseResult * ChannelParser::parseINFOInfo(QString string) +parseResult * ChannelParser::parseINFOInfo(TQString string) { string.remove(0, 3); // takes off the junk return new parseSucc(string, ksopts->infoColor, "user|servinfo"); // Null string, don't display anything } -parseResult * ChannelParser::parseINFOError(QString string) +parseResult * ChannelParser::parseINFOError(TQString string) { string.remove(0, 3); // strip the junk return new parseSucc(string,ksopts->errorColor, "user|error"); // Null string, don't display anything } -parseResult * ChannelParser::parseINFONicks(QString in_string) +parseResult * ChannelParser::parseINFONicks(TQString in_string) { - QString string = in_string; - QString channel_name; + TQString string = in_string; + TQString channel_name; bool clear_box = FALSE; // Check to see if it's a continued line @@ -368,12 +368,12 @@ parseResult * ChannelParser::parseINFONicks(QString in_string) top->nicks->setCurrentItem(current_item); top->nicks->setTopItem(top_item); top->nicks->repaint(TRUE); - return new parseSucc(QString::null); // Parsing ok, don't print anything though + return new parseSucc(TQString::null); // Parsing ok, don't print anything though } else if(string[1] == '$'){ top->nicks->clearAdvOps(); //kdDebug(5008) << "Turning off advanced ops" << endl; - return new parseSucc(QString::null); // Parsing ok, don't print anything though + return new parseSucc(TQString::null); // Parsing ok, don't print anything though } @@ -381,7 +381,7 @@ parseResult * ChannelParser::parseINFONicks(QString in_string) // Search for the first space, since : can be embeded into channel names. //count = sscanf(string, "*!* Users on %100[^ ]", channelInfo().channel()); // *!* Users on #TEST: boren asj asj_ - QRegExp rx("\\*\\S\\* Users on (\\S+): (.+)"); + TQRegExp rx("\\*\\S\\* Users on (\\S+): (.+)"); if(rx.search(string) == -1){ return new parseError(string, i18n("Could not find channel name")); } @@ -407,10 +407,10 @@ parseResult * ChannelParser::parseINFONicks(QString in_string) //strcpy(place_holder, string.ascii()+start+2); //nick = strtok(place_holder, " "); // while(nick != 0x0){ // While there's nick to go... - QStringList nicks = QStringList::split(QRegExp("\\s+"), rx.cap(2)); + TQStringList nicks = TQStringList::split(TQRegExp("\\s+"), rx.cap(2)); - for ( QStringList::Iterator it = nicks.begin(); it != nicks.end(); ++it ) { - QString nick = *it; + for ( TQStringList::Iterator it = nicks.begin(); it != nicks.end(); ++it ) { + TQString nick = *it; nickListItem *irc = new nickListItem(); bool done = FALSE; @@ -448,17 +448,17 @@ parseResult * ChannelParser::parseINFONicks(QString in_string) top->nicks->inSort(irc); } - return new parseSucc(QString::null); // Parsing ok, don't print anything though + return new parseSucc(TQString::null); // Parsing ok, don't print anything though } -parseResult * ChannelParser::parseINFOJoin(QString string) +parseResult * ChannelParser::parseINFOJoin(TQString string) { string.remove(0, 4); // strip *>* to save a few compares // You have joined channel #Linux - QRegExp rx("You have joined channel (\\S+)"); + TQRegExp rx("You have joined channel (\\S+)"); if(rx.search(string) != -1){ - //QString channel = rx.cap(1).lower(); - QString channel = rx.cap(1); + //TQString channel = rx.cap(1).lower(); + TQString channel = rx.cap(1); //kdDebug(5008) << "Channel: " << channel << endl; if(top->channelInfo().channel() != channel) { @@ -474,8 +474,8 @@ parseResult * ChannelParser::parseINFOJoin(QString string) // reef-diddy (nenernener@xnet-3B34A9E2.snet.net) has joined channel #aquaria rx.setPattern("(\\S+) .+ has joined channel (\\S+)"); if(rx.search(string) != -1){ - QString nick = rx.cap(1); - QString channel = rx.cap(2).lower(); + TQString nick = rx.cap(1); + TQString channel = rx.cap(2).lower(); //kdDebug(5008) << "Channel: " << channel << " nick: " << nick << endl; if(top->channelInfo().channel().lower() != channel){ return new parseWrongChannel(" " + string, ksopts->errorColor, "user|join"); @@ -490,12 +490,12 @@ parseResult * ChannelParser::parseINFOJoin(QString string) return 0; // ?? } -parseResult * ChannelParser::parseINFOPart(QString string) +parseResult * ChannelParser::parseINFOPart(TQString string) { bool foundNick = false; - QString pixname = "user|kick"; - QString nick(""); + TQString pixname = "user|kick"; + TQString nick(""); string.remove(0, 4); // clear junk @@ -507,7 +507,7 @@ parseResult * ChannelParser::parseINFOPart(QString string) // 3. /kick, kicked off the channel, nick after "kicked off \w+$" // // Signoff: looser - QRegExp rx("Signoff: (\\S+)"); + TQRegExp rx("Signoff: (\\S+)"); if(rx.search(string) != -1) { nick = rx.cap(1); foundNick = true; @@ -521,11 +521,11 @@ parseResult * ChannelParser::parseINFOPart(QString string) */ rx.setPattern("You have left channel (\\S+)"); if((foundNick == false) && (rx.search(string) != -1)) { - QString channel = rx.cap(1); + TQString channel = rx.cap(1); if(top->channelInfo().channel().lower() == channel.lower()) { - QApplication::postEvent(top, new QCloseEvent()); + TQApplication::postEvent(top, new TQCloseEvent()); // WE'RE DEAD - return new parseSucc(QString::null); + return new parseSucc(TQString::null); } pixname = "user|part"; } @@ -535,12 +535,12 @@ parseResult * ChannelParser::parseINFOPart(QString string) */ rx.setPattern("You have been kicked off channel (\\S+)"); if((foundNick == false) && (rx.search(string) != -1)) { - QString channel = rx.cap(1); + TQString channel = rx.cap(1); if(top->channelInfo().channel().lower() != channel.lower()) return new parseWrongChannel(string, ksopts->errorColor, "user|kick"); if (ksopts->autoRejoin == TRUE) { - QString str = QString("/join %1\n").arg(top->channelInfo().channel()); + TQString str = TQString("/join %1\n").arg(top->channelInfo().channel()); emit top->outputUnicodeLine(str); /* if(top->ticker) top->ticker->show(); @@ -555,7 +555,7 @@ parseResult * ChannelParser::parseINFOPart(QString string) int result = KMessageBox::questionYesNo(top, string, i18n("You Have Been Kicked"), i18n("Rejoin"), i18n("Leave")); if (result == KMessageBox::Yes) { - QString str = QString("/join %1\n").arg(top->channelInfo().channel()); + TQString str = TQString("/join %1\n").arg(top->channelInfo().channel()); emit top->outputUnicodeLine(str); /* if(top->ticker) * top->ticker->show(); @@ -566,7 +566,7 @@ parseResult * ChannelParser::parseINFOPart(QString string) else { // WE'RE DEAD - QApplication::postEvent(top, new QCloseEvent()); + TQApplication::postEvent(top, new TQCloseEvent()); top->KickWinOpen = false; } } @@ -578,13 +578,13 @@ parseResult * ChannelParser::parseINFOPart(QString string) rx.setPattern("(\\S+) has left channel (\\S+)"); if((foundNick == false) && (rx.search(string) != -1)) { nick = rx.cap(1); - QString channel = rx.cap(2); + TQString channel = rx.cap(2); // kdDebug(5008) << "Nick: " << nick << " Channel: " << channel << " top: " << top->channelInfo().channel() << endl; if(top->channelInfo().channel().lower() == channel.lower()) { foundNick = true; } else{ - return new parseWrongChannel(QString::null); + return new parseWrongChannel(TQString::null); } pixname = "user|part"; highlightNick(string, nick); @@ -595,11 +595,11 @@ parseResult * ChannelParser::parseINFOPart(QString string) rx.setPattern("(\\S+) has been kicked off channel (\\S+)"); if((foundNick == false) && (rx.search(string) != -1)) { nick = rx.cap(1); - QString channel = rx.cap(2); + TQString channel = rx.cap(2); if(top->channelInfo().channel().lower() == channel.lower()) { foundNick = true; } else { - return new parseWrongChannel(QString::null); + return new parseWrongChannel(TQString::null); } highlightNick(string, nick); pixname = "user|kick"; @@ -615,7 +615,7 @@ parseResult * ChannelParser::parseINFOPart(QString string) return new parseJoinPart(" " + string, ksopts->channelColor, pixname); } else { - return new parseJoinPart(QString::null); + return new parseJoinPart(TQString::null); } } else { @@ -625,10 +625,10 @@ parseResult * ChannelParser::parseINFOPart(QString string) return 0; } -parseResult * ChannelParser::parseINFOChangeNick(QString string) +parseResult * ChannelParser::parseINFOChangeNick(TQString string) { //char old_nick[101], new_nick[101]; - QString old_nick, new_nick; + TQString old_nick, new_nick; string.remove(0, 4); // Remove the leading *N* and space @@ -636,7 +636,7 @@ parseResult * ChannelParser::parseINFOChangeNick(QString string) * *N* asj_ is now known as bleh */ //kdDebug(5008) << "Nick change: " << string << endl; - QRegExp rx("(\\S+) is now known as (\\S+)"); + TQRegExp rx("(\\S+) is now known as (\\S+)"); if(rx.search(string) == -1){ if(string.contains("already taken")){ return new parseSucc(" " + string, ksopts->errorColor, "user|error"); @@ -687,29 +687,29 @@ parseResult * ChannelParser::parseINFOChangeNick(QString string) top->channelInfo().channel() == old_nick) return new parseSucc(" " + string, ksopts->channelColor, "user|elipsis"); else - return new parseSucc(QString::null); + return new parseSucc(TQString::null); } // warning("Toplevel-N: nick change search failed on %s", s3.data()); - // return new parseSucc(QString::null); + // return new parseSucc(TQString::null); } class mode_info { public: - mode_info(bool op, QChar mode, QString arg); + mode_info(bool op, TQChar mode, TQString arg); bool op() const; - QChar mode() const; - QString arg() const; + TQChar mode() const; + TQString arg() const; private: const bool m_op; - const QChar m_mode; - const QString m_arg; + const TQChar m_mode; + const TQString m_arg; }; -mode_info::mode_info(bool op, QChar mode, QString arg) : +mode_info::mode_info(bool op, TQChar mode, TQString arg) : m_op(op), m_mode(mode), m_arg(arg) @@ -720,16 +720,16 @@ bool mode_info::op() const { return m_op; } -QChar mode_info::mode() const { +TQChar mode_info::mode() const { return m_mode; } -QString mode_info::arg() const { +TQString mode_info::arg() const { return m_arg; } -parseResult * ChannelParser::parseINFOMode(QString string) +parseResult * ChannelParser::parseINFOMode(TQString string) { // Basic idea here is simple, go through the mode change and // assign each mode a + or a - and an argument or "" if there is @@ -744,7 +744,7 @@ parseResult * ChannelParser::parseINFOMode(QString string) /* * 1k is pretty safe since KProcess returns 1 k blocks, and lines don't get split between reads. This is emprical */ - QString modes, args, channel; + TQString modes, args, channel; int found = 0; if(string.find("for user") >= 0) @@ -753,7 +753,7 @@ parseResult * ChannelParser::parseINFOMode(QString string) /* * We need to 2 scanf's, one for the case of arguments, and one for no args. */ - QRegExp rx("Mode change \"(\\S+) *([^\"]*)\" on channel (\\S+)"); + TQRegExp rx("Mode change \"(\\S+) *([^\"]*)\" on channel (\\S+)"); if(rx.search(string) >= 0){ modes = rx.cap(1); args = rx.cap(2); @@ -780,7 +780,7 @@ parseResult * ChannelParser::parseINFOMode(QString string) if(found == 0) - return new parseError(" Failed to parse mode change: " + string, QString::null); + return new parseError(" Failed to parse mode change: " + string, TQString::null); /* * op specifie if it's a + or -. tru is + false is - @@ -791,13 +791,13 @@ parseResult * ChannelParser::parseINFOMode(QString string) * we use the itirator to tstep through the list * as need be */ - QStringList arglist = QStringList::split(" ", args); - QStringList::Iterator ai = arglist.begin(); + TQStringList arglist = TQStringList::split(" ", args); + TQStringList::Iterator ai = arglist.begin(); /* * the ptr list structure contains the parsed contents */ - QPtrList<const mode_info> pmList; + TQPtrList<const mode_info> pmList; pmList.setAutoDelete(true); for(uint pos = 0; pos < modes.length(); pos++){ @@ -814,7 +814,7 @@ parseResult * ChannelParser::parseINFOMode(QString string) * +l otoh does, so read the argument */ if(op == false){ - pmList.append(new mode_info(op, 'l', QString::null)); + pmList.append(new mode_info(op, 'l', TQString::null)); break; } case 'o': // Op, arg is the nick @@ -822,7 +822,7 @@ parseResult * ChannelParser::parseINFOMode(QString string) case 'b': // Ban, arg is mask banned case 'k': // kcik, arg is nick if(ai == NULL) - return new parseError(i18n("Unable to parse mode change: %1").arg(string), QString::null); + return new parseError(i18n("Unable to parse mode change: %1").arg(string), TQString::null); pmList.append(new mode_info(op, modes.at(pos), *ai)); ai++; break; @@ -837,11 +837,11 @@ parseResult * ChannelParser::parseINFOMode(QString string) /* * Mode changes which don't take args */ - pmList.append(new mode_info(op, modes.at(pos), QString::null)); + pmList.append(new mode_info(op, modes.at(pos), TQString::null)); break; default: kdDebug(5008) << "Unknown mode change: " << modes.mid(pos, 1) << " Assume no args" << endl; - pmList.append(new mode_info(op, modes.at(pos), QString::null)); + pmList.append(new mode_info(op, modes.at(pos), TQString::null)); } } // We have the modes set in mode and arg, now we go though @@ -851,7 +851,7 @@ parseResult * ChannelParser::parseINFOMode(QString string) bool mode_b_plus = false; bool mode_b_minus = false; - QPtrListIterator<const mode_info> it(pmList); + TQPtrListIterator<const mode_info> it(pmList); const mode_info *mi; while ( (mi = it.current()) != 0 ) { ++it; @@ -944,9 +944,9 @@ parseResult * ChannelParser::parseINFOMode(QString string) } } else{ - QChar c(mi->mode()); - QString m(&c, 1); - QString o; + TQChar c(mi->mode()); + TQString m(&c, 1); + TQString o; if(mi->op()) o = "+"; else @@ -957,7 +957,7 @@ parseResult * ChannelParser::parseINFOMode(QString string) /* * We're all done, so output the message and be done with it */ - QString pixname = "user|mode"; + TQString pixname = "user|mode"; if(mode_o_plus) pixname = "user|oplus"; @@ -971,7 +971,7 @@ parseResult * ChannelParser::parseINFOMode(QString string) return new parseSucc(" " + string, ksopts->infoColor, pixname); } -parseResult * ChannelParser::parseCTCPAction(QString string) +parseResult * ChannelParser::parseCTCPAction(TQString string) { string.remove(0, 2); // * <something> use fancy * pixmap. Remove 2, leave one for space after te * @@ -979,7 +979,7 @@ parseResult * ChannelParser::parseCTCPAction(QString string) return new parseSucc(string, ksopts->textColor, "user|action"); } -parseResult * ChannelParser::parseINFOTopic(QString string) +parseResult * ChannelParser::parseINFOTopic(TQString string) { int found = 0; @@ -989,11 +989,11 @@ parseResult * ChannelParser::parseINFOTopic(QString string) //kdDebug(5008) << "Topic parser: " << string << endl; // Topic for #boo: this is a nice test - QRegExp rx( "Topic for (\\S+): (.*)" ); + TQRegExp rx( "Topic for (\\S+): (.*)" ); if(rx.search( string ) != -1){ - QString channel = rx.cap(1); - QString topic = rx.cap(2); - topic.replace( QRegExp( "~~" ), "~" ); + TQString channel = rx.cap(1); + TQString topic = rx.cap(2); + topic.replace( TQRegExp( "~~" ), "~" ); /* * check where it's going. @@ -1019,18 +1019,18 @@ parseResult * ChannelParser::parseINFOTopic(QString string) rx.setPattern("(\\S+) has changed the topic on channel (\\S+) to (.+)"); if(found == 0 && rx.search(string) != -1){ - QString nick = rx.cap(1); - QString channel = rx.cap(2); + TQString nick = rx.cap(1); + TQString channel = rx.cap(2); //kdDebug(5008) << "Channel: " << channel << endl; if(top->channelInfo().channel().lower() == channel.lower()){ - QString topic = rx.cap(3); + TQString topic = rx.cap(3); //kdDebug(5008) << "Topic: " << topic << endl; - topic.replace(QRegExp("~~"), "~"); + topic.replace(TQRegExp("~~"), "~"); /* * topic is in double quotes, so remove them */ top->setTopic( topic.mid(1, topic.length()-2) ); - QString cmd = "/eval &dostatus();\n"; + TQString cmd = "/eval &dostatus();\n"; top->sirc_write(cmd); } highlightNick(string, nick); @@ -1039,9 +1039,9 @@ parseResult * ChannelParser::parseINFOTopic(QString string) } -void ChannelParser::highlightNick(QString &string, QString &nick) +void ChannelParser::highlightNick(TQString &string, TQString &nick) { - QRegExp rx(QString("(^|\\s+)%1(\\s+|$)").arg(QRegExp::escape(nick))); + TQRegExp rx(TQString("(^|\\s+)%1(\\s+|$)").arg(TQRegExp::escape(nick))); string.replace(rx, "\\1~n" + nick + "~n\\2"); } |