diff options
Diffstat (limited to 'konversation/src/ircview.cpp')
-rw-r--r-- | konversation/src/ircview.cpp | 398 |
1 files changed, 199 insertions, 199 deletions
diff --git a/konversation/src/ircview.cpp b/konversation/src/ircview.cpp index 3b4108a..35611f0 100644 --- a/konversation/src/ircview.cpp +++ b/konversation/src/ircview.cpp @@ -28,20 +28,20 @@ #include "notificationhandler.h" #include <private/qrichtext_p.h> -#include <qstylesheet.h> -#include <qstringlist.h> -#include <qregexp.h> -#include <qtextbrowser.h> -#include <qclipboard.h> -#include <qbrush.h> -#include <qevent.h> -#include <qdragobject.h> -#include <qpopupmenu.h> -#include <qwhatsthis.h> -#include <qmap.h> -#include <qcolor.h> -#include <qscrollbar.h> -#include <qcursor.h> +#include <tqstylesheet.h> +#include <tqstringlist.h> +#include <tqregexp.h> +#include <tqtextbrowser.h> +#include <tqclipboard.h> +#include <tqbrush.h> +#include <tqevent.h> +#include <tqdragobject.h> +#include <tqpopupmenu.h> +#include <tqwhatsthis.h> +#include <tqmap.h> +#include <tqcolor.h> +#include <tqscrollbar.h> +#include <tqcursor.h> #include <dcopref.h> #include <dcopclient.h> @@ -68,7 +68,7 @@ #include <kglobal.h> -IRCView::IRCView(QWidget* parent, Server* newServer) : KTextBrowser(parent) +IRCView::IRCView(TQWidget* parent, Server* newServer) : KTextBrowser(parent) { m_copyUrlMenu = false; m_resetScrollbar = true; @@ -88,21 +88,21 @@ IRCView::IRCView(QWidget* parent, Server* newServer) : KTextBrowser(parent) m_disableEnsureCursorVisible = false; m_wasPainted = false; - setAutoFormatting(QTextEdit::AutoNone); + setAutoFormatting(TQTextEdit::AutoNone); setUndoRedoEnabled(0); setLinkUnderline(false); setVScrollBarMode(AlwaysOn); setHScrollBarMode(AlwaysOff); - setWrapPolicy(QTextEdit::AtWordOrDocumentBoundary); + setWrapPolicy(TQTextEdit::AtWordOrDocumentBoundary); setNotifyClick(true); - setFocusPolicy(QWidget::ClickFocus); + setFocusPolicy(TQWidget::ClickFocus); // set basic style sheet for <p> to make paragraph spacing possible - QStyleSheet* sheet=new QStyleSheet(this,"ircview_style_sheet"); - new QStyleSheetItem(sheet,"p"); + TQStyleSheet* sheet=new TQStyleSheet(this,"ircview_style_sheet"); + new TQStyleSheetItem(sheet,"p"); setStyleSheet(sheet); - m_popup = new QPopupMenu(this,"ircview_context_menu"); + m_popup = new TQPopupMenu(this,"ircview_context_menu"); toggleMenuBarSeparator = m_popup->insertSeparator(); m_popup->setItemVisible(toggleMenuBarSeparator, false); copyUrlMenuSeparator = m_popup->insertSeparator(); @@ -113,7 +113,7 @@ IRCView::IRCView(QWidget* parent, Server* newServer) : KTextBrowser(parent) setServer(newServer); - setViewBackground(Preferences::color(Preferences::TextViewBackground),QString()); + setViewBackground(Preferences::color(Preferences::TextViewBackground),TQString()); if (Preferences::customTextFont()) setFont(Preferences::textFont()); @@ -122,7 +122,7 @@ IRCView::IRCView(QWidget* parent, Server* newServer) : KTextBrowser(parent) if (Preferences::useParagraphSpacing()) enableParagraphSpacing(); - connect(this, SIGNAL(highlighted(const QString&)), this, SLOT(highlightedSlot(const QString&))); + connect(this, TQT_SIGNAL(highlighted(const TQString&)), this, TQT_SLOT(highlightedSlot(const TQString&))); } IRCView::~IRCView() @@ -133,11 +133,11 @@ IRCView::~IRCView() void IRCView::enableParagraphSpacing() { // Set style sheet for <p> to define paragraph spacing. - QStyleSheet* sheet = styleSheet(); + TQStyleSheet* sheet = styleSheet(); if (!sheet) return; - QStyleSheetItem* style = sheet->item("p"); + TQStyleSheetItem* style = sheet->item("p"); if (!style) { @@ -146,14 +146,14 @@ void IRCView::enableParagraphSpacing() return; } - style->setDisplayMode(QStyleSheetItem::DisplayBlock); - style->setMargin(QStyleSheetItem::MarginVertical, Preferences::paragraphSpacing()); + style->setDisplayMode(TQStyleSheetItem::DisplayBlock); + style->setMargin(TQStyleSheetItem::MarginVertical, Preferences::paragraphSpacing()); style->setSelfNesting(false); } -void IRCView::setViewBackground(const QColor& backgroundColor, const QString& pixmapName) +void IRCView::setViewBackground(const TQColor& backgroundColor, const TQString& pixmapName) { - QPixmap backgroundPixmap; + TQPixmap backgroundPixmap; backgroundPixmap.load(pixmapName); if(backgroundPixmap.isNull()) @@ -162,7 +162,7 @@ void IRCView::setViewBackground(const QColor& backgroundColor, const QString& pi } else { - QBrush backgroundBrush; + TQBrush backgroundBrush; backgroundBrush.setColor(backgroundColor); backgroundBrush.setPixmap(backgroundPixmap); setPaper(backgroundBrush); @@ -184,26 +184,26 @@ void IRCView::setServer(Server* newServer) } -const QString& IRCView::getContextNick() const +const TQString& IRCView::getContextNick() const { return m_currentNick; } void IRCView::clearContextNick() { - m_currentNick = QString(); + m_currentNick = TQString(); } void IRCView::clear() { - m_buffer = QString(); + m_buffer = TQString(); KTextBrowser::setText(""); wipeLineParagraphs(); } -void IRCView::highlightedSlot(const QString& _link) +void IRCView::highlightedSlot(const TQString& _link) { - QString link = _link; + TQString link = _link; // HACK Replace % with \x03 in the url to keep Qt from doing stupid things link = link.replace ('\x03', "%"); //Hack to handle the fact that we get a decoded url @@ -227,7 +227,7 @@ void IRCView::highlightedSlot(const QString& _link) if (!m_lastStatusText.isEmpty()) { emit clearStatusBarTempText(); - m_lastStatusText = QString(); + m_lastStatusText = TQString(); } } else { @@ -274,7 +274,7 @@ void IRCView::highlightedSlot(const QString& _link) // link.startsWith("##") m_currentChannel = link.mid(1); - QString prettyId = m_currentChannel; + TQString prettyId = m_currentChannel; if (prettyId.length()>15) { @@ -288,7 +288,7 @@ void IRCView::highlightedSlot(const QString& _link) } } -void IRCView::openLink(const QString& url, bool newTab) +void IRCView::openLink(const TQString& url, bool newTab) { if (!url.isEmpty() && !url.startsWith("#")) { @@ -301,9 +301,9 @@ void IRCView::openLink(const QString& url, bool newTab) { if(newTab && !url.startsWith("mailto:")) { - QCString foundApp, foundObj; - QByteArray data; - QDataStream str(data, IO_WriteOnly); + TQCString foundApp, foundObj; + TQByteArray data; + TQDataStream str(data, IO_WriteOnly); if( KApplication::dcopClient()->findObject("konqueror*", "konqueror-mainwindow*", "windowCanBeUsedForTab()", data, foundApp, foundObj, false, 3000)) { @@ -316,10 +316,10 @@ void IRCView::openLink(const QString& url, bool newTab) } else { - QString cmd = Preferences::webBrowserCmd(); + TQString cmd = Preferences::webBrowserCmd(); cmd.replace("%u", url); KProcess *proc = new KProcess; - QStringList cmdAndArgs = KShell::splitArgs(cmd); + TQStringList cmdAndArgs = KShell::splitArgs(cmd); *proc << cmdAndArgs; // This code will also work, but starts an extra shell process. // kdDebug() << "IRCView::urlClickSlot(): cmd = " << cmd << endl; @@ -332,36 +332,36 @@ void IRCView::openLink(const QString& url, bool newTab) //FIXME: Don't do channel links in DCC Chats to begin with since they don't have a server. else if (url.startsWith("##") && m_server && m_server->isConnected()) { - QString channel(url); + TQString channel(url); channel.replace("##", "#"); m_server->sendJoinCommand(channel); } //FIXME: Don't do user links in DCC Chats to begin with since they don't have a server. else if (url.startsWith("#") && m_server && m_server->isConnected()) { - QString recipient(url); + TQString recipient(url); recipient.remove("#"); NickInfoPtr nickInfo = m_server->obtainNickInfo(recipient); m_server->addQuery(nickInfo, true /*we initiated*/); } } -void IRCView::replaceDecoration(QString& line, char decoration, char replacement) +void IRCView::replaceDecoration(TQString& line, char decoration, char replacement) { int pos; bool decorated = false; while((pos=line.find(decoration))!=-1) { - line.replace(pos,1,(decorated) ? QString("</%1>").arg(replacement) : QString("<%1>").arg(replacement)); + line.replace(pos,1,(decorated) ? TQString("</%1>").arg(replacement) : TQString("<%1>").arg(replacement)); decorated = !decorated; } } -QString IRCView::filter(const QString& line, const QString& defaultColor, const QString& whoSent, +TQString IRCView::filter(const TQString& line, const TQString& defaultColor, const TQString& whoSent, bool doHighlight, bool parseURL, bool self) { - QString filteredLine(line); + TQString filteredLine(line); KonversationApplication* konvApp = static_cast<KonversationApplication*>(kapp); //Since we can't turn off whitespace simplification withouteliminating text wrapping, @@ -371,7 +371,7 @@ bool doHighlight, bool parseURL, bool self) if (filteredLine[0]==' ') filteredLine[0]='\xA0'; - // TODO: Use QStyleSheet::escape() here + // TODO: Use TQStyleSheet::escape() here // Replace all < with < filteredLine.replace("<","\x0blt;"); // Replace all > with > @@ -380,10 +380,10 @@ bool doHighlight, bool parseURL, bool self) #if 0 if(!Preferences::disableExpansion()) { - QRegExp boldRe("\\*\\*([a-zA-Z0-9]+)\\*\\*"); - QRegExp underRe("\\_\\_([a-zA-Z0-9]+)\\_\\_"); + TQRegExp boldRe("\\*\\*([a-zA-Z0-9]+)\\*\\*"); + TQRegExp underRe("\\_\\_([a-zA-Z0-9]+)\\_\\_"); int position = 0; - QString replacement; + TQString replacement; while( position >= 0) { @@ -422,22 +422,22 @@ bool doHighlight, bool parseURL, bool self) // replace \003 and \017 codes with rich text color codes // captures 1 2 23 4 4 3 1 - QRegExp colorRegExp("(\003([0-9]|0[0-9]|1[0-5]|)(,([0-9]|0[0-9]|1[0-5])|,|)|\017)"); + TQRegExp colorRegExp("(\003([0-9]|0[0-9]|1[0-5]|)(,([0-9]|0[0-9]|1[0-5])|,|)|\017)"); int pos; bool allowColors = Preferences::allowColorCodes(); bool firstColor = true; - QString colorString; + TQString colorString; while((pos=colorRegExp.search(filteredLine))!=-1) { if(!allowColors) { - colorString = QString(); + colorString = TQString(); } else { - colorString = (firstColor) ? QString::null : QString("</font>"); + colorString = (firstColor) ? TQString::null : TQString("</font>"); // reset colors on \017 to default value if(colorRegExp.cap(1) == "\017") @@ -487,7 +487,7 @@ bool doHighlight, bool parseURL, bool self) filteredLine = Konversation::EmotIcon::filter(filteredLine, fontMetrics()); // Highlight - QString ownNick; + TQString ownNick; if (m_server) { @@ -500,11 +500,11 @@ bool doHighlight, bool parseURL, bool self) if(doHighlight && (whoSent != ownNick) && !self) { - QString highlightColor; + TQString highlightColor; if(Preferences::highlightNick() && - filteredLine.lower().find(QRegExp("(^|[^\\d\\w])" + - QRegExp::escape(ownNick.lower()) + + filteredLine.lower().find(TQRegExp("(^|[^\\d\\w])" + + TQRegExp::escape(ownNick.lower()) + "([^\\d\\w]|$)")) != -1) { // highlight current nickname @@ -513,18 +513,18 @@ bool doHighlight, bool parseURL, bool self) } else { - QPtrList<Highlight> highlightList = Preferences::highlightList(); - QPtrListIterator<Highlight> it(highlightList); + TQPtrList<Highlight> highlightList = Preferences::highlightList(); + TQPtrListIterator<Highlight> it(highlightList); Highlight* highlight = it.current(); bool patternFound = false; int index = 0; - QStringList captures; + TQStringList captures; while(highlight) { if(highlight->getRegExp()) { - QRegExp needleReg=highlight->getPattern(); + TQRegExp needleReg=highlight->getPattern(); needleReg.setCaseSensitive(false); // highlight regexp in text patternFound = ((filteredLine.find(needleReg) != -1) || @@ -537,7 +537,7 @@ bool doHighlight, bool parseURL, bool self) } else { - QString needle=highlight->getPattern(); + TQString needle=highlight->getPattern(); // highlight patterns in text patternFound = ((filteredLine.find(needle, 0, false) != -1) || // highlight patterns in nickname @@ -573,9 +573,9 @@ bool doHighlight, bool parseURL, bool self) // replace %0 - %9 in regex groups for(unsigned int capture=0;capture<captures.count();capture++) { - m_autoTextToSend.replace(QString("%%1").arg(capture),captures[capture]); + m_autoTextToSend.replace(TQString("%%1").arg(capture),captures[capture]); } - m_autoTextToSend.replace(QRegExp("%[0-9]"),QString()); + m_autoTextToSend.replace(TQRegExp("%[0-9]"),TQString()); } } @@ -597,14 +597,14 @@ bool doHighlight, bool parseURL, bool self) return filteredLine; } -QString IRCView::createNickLine(const QString& nick, bool encapsulateNick, bool privMsg) +TQString IRCView::createNickLine(const TQString& nick, bool encapsulateNick, bool privMsg) { - QString nickLine = "%2"; + TQString nickLine = "%2"; if(Preferences::useClickableNicks()) { // HACK:Use space as a placeholder for \ as Qt tries to be clever and does a replace to / in urls in QTextEdit - nickLine = "<a href=\"#" + QString(nick).replace('\\', " ") + "\">%2</a>"; + nickLine = "<a href=\"#" + TQString(nick).replace('\\', " ") + "\">%2</a>"; } if(privMsg) @@ -617,7 +617,7 @@ QString IRCView::createNickLine(const QString& nick, bool encapsulateNick, bool if(Preferences::useColoredNicks() && m_server) { - QString nickColor; + TQString nickColor; if (nick != m_server->getNickname()) nickColor = Preferences::nickColor(m_server->obtainNickInfo(nick)->getNickColor()).name(); @@ -636,8 +636,8 @@ QString IRCView::createNickLine(const QString& nick, bool encapsulateNick, bool // have a server. else if (Preferences::useColoredNicks() && m_chatWin->getType() == ChatWindow::DccChat) { - QString ownNick = static_cast<DccChat*>(m_chatWin)->getOwnNick(); - QString nickColor; + TQString ownNick = static_cast<DccChat*>(m_chatWin)->getOwnNick(); + TQString nickColor; if (nick != ownNick) { @@ -667,21 +667,21 @@ QString IRCView::createNickLine(const QString& nick, bool encapsulateNick, bool return nickLine; } -void IRCView::append(const QString& nick,const QString& message) +void IRCView::append(const TQString& nick,const TQString& message) { - QString channelColor = Preferences::color(Preferences::ChannelMessage).name(); + TQString channelColor = Preferences::color(Preferences::ChannelMessage).name(); if(channelColor == "#000000") { channelColor = "#000001"; // HACK Working around QTextBrowser's auto link coloring } - QString line; + TQString line; m_tabNotification = Konversation::tnfNormal; - QString nickLine = createNickLine(nick); + TQString nickLine = createNickLine(nick); - if(basicDirection(message) == QChar::DirR) + if(basicDirection(message) == TQChar::DirR) { line = RLE; line += LRE; @@ -694,7 +694,7 @@ void IRCView::append(const QString& nick,const QString& message) line = line.arg(timeStamp(), nick, filter(message, channelColor, nick, true)); - emit textToLog(QString("<%1>\t%2").arg(nick).arg(message)); + emit textToLog(TQString("<%1>\t%2").arg(nick).arg(message)); doAppend(line); } @@ -723,8 +723,8 @@ void IRCView::appendRememberLine() { removeParagraph(m_rememberLineParagraph); - QValueList<int> newList; - QValueList<int>::ConstIterator it; + TQValueList<int> newList; + TQValueList<int>::ConstIterator it; for (it = m_markerLineParagraphs.begin(); it != m_markerLineParagraphs.end(); ++it) { @@ -761,11 +761,11 @@ void IRCView::insertMarkerLine() m_markerLineParagraphs.append(paragraphs() - 1); } -void IRCView::appendLine(const QString& color) +void IRCView::appendLine(const TQString& color) { - QColor channelColor = Preferences::color(Preferences::ChannelMessage); + TQColor channelColor = Preferences::color(Preferences::ChannelMessage); - QString line = "<p><font style=\"font-size:1pt;\"><br><br><hr color=\""+color+"\" noshade></font></p>\n"; + TQString line = "<p><font style=\"font-size:1pt;\"><br><br><hr color=\""+color+"\" noshade></font></p>\n"; doAppend(line, true); } @@ -779,7 +779,7 @@ void IRCView::clearLines() { qHeapSort(m_markerLineParagraphs); - QValueList<int>::ConstIterator it; + TQValueList<int>::ConstIterator it; int removeCounter = 0; for (it = m_markerLineParagraphs.begin(); it != m_markerLineParagraphs.end(); ++it) @@ -811,9 +811,9 @@ void IRCView::updateLineParagraphs(int numRemoved) if (!m_markerLineParagraphs.isEmpty()) { - QValueList<int> newMarkerLineParagraphs; + TQValueList<int> newMarkerLineParagraphs; - QValueList<int>::const_iterator it; + TQValueList<int>::const_iterator it; for (it = m_markerLineParagraphs.begin(); it != m_markerLineParagraphs.end(); ++it) { @@ -831,39 +831,39 @@ void IRCView::wipeLineParagraphs() m_rememberLineParagraph = -1; } -void IRCView::appendRaw(const QString& message, bool suppressTimestamps, bool self) +void IRCView::appendRaw(const TQString& message, bool suppressTimestamps, bool self) { - QColor channelColor=Preferences::color(Preferences::ChannelMessage); - QString line; + TQColor channelColor=Preferences::color(Preferences::ChannelMessage); + TQString line; m_tabNotification = Konversation::tnfNone; if(suppressTimestamps) { - line = QString("<p><font color=\"" + channelColor.name() + "\">" + message + "</font></p>\n"); + line = TQString("<p><font color=\"" + channelColor.name() + "\">" + message + "</font></p>\n"); } else { - line = QString("<p>" + timeStamp() + " <font color=\"" + channelColor.name() + "\">" + message + "</font></p>\n"); + line = TQString("<p>" + timeStamp() + " <font color=\"" + channelColor.name() + "\">" + message + "</font></p>\n"); } doAppend(line, self); } -void IRCView::appendQuery(const QString& nick, const QString& message, bool inChannel) +void IRCView::appendQuery(const TQString& nick, const TQString& message, bool inChannel) { - QString queryColor=Preferences::color(Preferences::QueryMessage).name(); + TQString queryColor=Preferences::color(Preferences::QueryMessage).name(); if(queryColor == "#000000") { queryColor = "#000001"; // HACK Working around QTextBrowser's auto link coloring } - QString line; + TQString line; m_tabNotification = Konversation::tnfPrivate; - QString nickLine = createNickLine(nick, true, inChannel); + TQString nickLine = createNickLine(nick, true, inChannel); - if(basicDirection(message) == QChar::DirR) + if(basicDirection(message) == TQChar::DirR) { line = RLE; line += LRE; @@ -876,12 +876,12 @@ void IRCView::appendQuery(const QString& nick, const QString& message, bool inCh line = line.arg(timeStamp(), nick, filter(message, queryColor, nick, true)); - emit textToLog(QString("<%1>\t%2").arg(nick).arg(message)); + emit textToLog(TQString("<%1>\t%2").arg(nick).arg(message)); doAppend(line); } -void IRCView::appendChannelAction(const QString& nick,const QString& message) +void IRCView::appendChannelAction(const TQString& nick,const TQString& message) { m_tabNotification = Konversation::tnfNormal; @@ -889,24 +889,24 @@ void IRCView::appendChannelAction(const QString& nick,const QString& message) } -void IRCView::appendQueryAction(const QString& nick,const QString& message) +void IRCView::appendQueryAction(const TQString& nick,const TQString& message) { m_tabNotification = Konversation::tnfPrivate; appendAction(nick, message); } -void IRCView::appendAction(const QString& nick,const QString& message) +void IRCView::appendAction(const TQString& nick,const TQString& message) { - QString actionColor=Preferences::color(Preferences::ActionMessage).name(); + TQString actionColor=Preferences::color(Preferences::ActionMessage).name(); // HACK Working around QTextBrowser's auto link coloring if (actionColor == "#000000") actionColor = "#000001"; - QString line; - QString nickLine = createNickLine(nick, false); + TQString line; + TQString nickLine = createNickLine(nick, false); - if (basicDirection(message) == QChar::DirR) + if (basicDirection(message) == TQChar::DirR) { line = RLE; line += LRE; @@ -919,27 +919,27 @@ void IRCView::appendAction(const QString& nick,const QString& message) line = line.arg(timeStamp(), nick, filter(message, actionColor, nick, true)); - emit textToLog(QString("\t * %1 %2").arg(nick).arg(message)); + emit textToLog(TQString("\t * %1 %2").arg(nick).arg(message)); doAppend(line); } -void IRCView::appendServerMessage(const QString& type, const QString& message, bool parseURL) +void IRCView::appendServerMessage(const TQString& type, const TQString& message, bool parseURL) { - QString serverColor = Preferences::color(Preferences::ServerMessage).name(); + TQString serverColor = Preferences::color(Preferences::ServerMessage).name(); m_tabNotification = Konversation::tnfControl; // Fixed width font option for MOTD - QString fixed; + TQString fixed; if(Preferences::fixedMOTD() && !m_fontDataBase.isFixedPitch(font().family())) { if(type == i18n("MOTD")) fixed=" face=\"" + KGlobalSettings::fixedFont().family() + "\""; } - QString line; + TQString line; - if(basicDirection(message) == QChar::DirR) + if(basicDirection(message) == TQChar::DirR) { line = RLE; line += LRE; @@ -955,19 +955,19 @@ void IRCView::appendServerMessage(const QString& type, const QString& message, b else line = "<font color=\"" + serverColor + "\">"+line.arg(timeStamp(), type, message)+"</font>"; - emit textToLog(QString("%1\t%2").arg(type).arg(message)); + emit textToLog(TQString("%1\t%2").arg(type).arg(message)); doAppend(line); } -void IRCView::appendCommandMessage(const QString& type,const QString& message, bool important, bool parseURL, bool self) +void IRCView::appendCommandMessage(const TQString& type,const TQString& message, bool important, bool parseURL, bool self) { if (Preferences::hideUnimportantEvents() && !important) return; - QString commandColor = Preferences::color(Preferences::CommandMessage).name(); - QString line; - QString prefix="***"; + TQString commandColor = Preferences::color(Preferences::CommandMessage).name(); + TQString line; + TQString prefix="***"; m_tabNotification = Konversation::tnfControl; if(type == i18n("Join")) @@ -980,9 +980,9 @@ void IRCView::appendCommandMessage(const QString& type,const QString& message, b prefix="<--"; } - prefix=QStyleSheet::escape(prefix); + prefix=TQStyleSheet::escape(prefix); - if(basicDirection(message) == QChar::DirR) + if(basicDirection(message) == TQChar::DirR) { line = RLE; line += LRE; @@ -995,17 +995,17 @@ void IRCView::appendCommandMessage(const QString& type,const QString& message, b line = line.arg(timeStamp(), prefix, filter(message, commandColor, 0, true, parseURL, self)); - emit textToLog(QString("%1\t%2").arg(type).arg(message)); + emit textToLog(TQString("%1\t%2").arg(type).arg(message)); doAppend(line, self); } -void IRCView::appendBacklogMessage(const QString& firstColumn,const QString& rawMessage) +void IRCView::appendBacklogMessage(const TQString& firstColumn,const TQString& rawMessage) { - QString time; - QString message = rawMessage; - QString nick = firstColumn; - QString backlogColor = Preferences::color(Preferences::BacklogMessage).name(); + TQString time; + TQString message = rawMessage; + TQString nick = firstColumn; + TQString backlogColor = Preferences::color(Preferences::BacklogMessage).name(); m_tabNotification = Konversation::tnfNone; time = nick.section(' ', 0, 4); @@ -1020,9 +1020,9 @@ void IRCView::appendBacklogMessage(const QString& firstColumn,const QString& raw nick.replace("<","<"); nick.replace(">",">"); - QString line; + TQString line; - if(basicDirection(message) == QChar::DirR) + if(basicDirection(message) == TQChar::DirR) { line = "<p><font color=\"" + backlogColor + "\">%2 %1 %3</font></p>\n"; } @@ -1049,29 +1049,29 @@ void IRCView::removeSelectedText( int selNum ) } // ...snip... - doc->removeSelectedText( selNum, QTextEdit::textCursor() ); + doc->removeSelectedText( selNum, TQTextEdit::textCursor() ); // ...snip... } void IRCView::scrollToBottom() { - // QTextEdit::scrollToBottom does sync() too, but we don't want it because its slow + // TQTextEdit::scrollToBottom does sync() too, but we don't want it because its slow setContentsPos( contentsX(), contentsHeight() - visibleHeight() ); } void IRCView::ensureCursorVisible() { if (!m_disableEnsureCursorVisible) - QTextEdit::ensureCursorVisible(); + TQTextEdit::ensureCursorVisible(); } -void IRCView::doAppend(const QString& newLine, bool self) +void IRCView::doAppend(const TQString& newLine, bool self) { if (m_rememberLineDirtyBit) appendRememberLine(); // Add line to buffer - QString line(newLine); + TQString line(newLine); if (!self && m_chatWin) m_chatWin->activateTabNotification(m_tabNotification); @@ -1142,28 +1142,28 @@ void IRCView::doAppend(const QString& newLine, bool self) if (!m_autoTextToSend.isEmpty() && m_server) { // replace placeholders in autoText - QString sendText = m_server->parseWildcards(m_autoTextToSend,m_server->getNickname(), - QString(), QString(), QString(), QString()); + TQString sendText = m_server->parseWildcards(m_autoTextToSend,m_server->getNickname(), + TQString(), TQString(), TQString(), TQString()); // avoid recursion due to signalling - m_autoTextToSend = QString(); + m_autoTextToSend = TQString(); // send signal only now emit autoText(sendText); } else { - m_autoTextToSend = QString(); + m_autoTextToSend = TQString(); } if (!m_lastStatusText.isEmpty()) emit clearStatusBarTempText(); } // remember if scrollbar was positioned at the end of the text or not -void IRCView::hideEvent(QHideEvent* /* event */) { +void IRCView::hideEvent(TQHideEvent* /* event */) { m_resetScrollbar = ((contentsHeight()-visibleHeight()) == contentsY()); } // Workaround to scroll to the end of the TextView when it's shown -void IRCView::showEvent(QShowEvent* event) { +void IRCView::showEvent(TQShowEvent* event) { Q_UNUSED(event); // did the user scroll the view to the end of the text before hiding? if (m_resetScrollbar) @@ -1176,11 +1176,11 @@ void IRCView::showEvent(QShowEvent* event) { } } -void IRCView::paintEvent(QPaintEvent* event) +void IRCView::paintEvent(TQPaintEvent* event) { // HACK: if the widget is being painted for the first time, call // showEvent() which will reset scrollback position as needed. It seems - // that at the time this event is triggered, QTextEdit provides more + // that at the time this event is triggered, TQTextEdit provides more // accurate information than when showEvent() is triggered. if (!m_wasPainted) { @@ -1190,7 +1190,7 @@ void IRCView::paintEvent(QPaintEvent* event) KTextBrowser::paintEvent(event); } -void IRCView::contentsMouseReleaseEvent(QMouseEvent *ev) +void IRCView::contentsMouseReleaseEvent(TQMouseEvent *ev) { if (ev->button() == Qt::MidButton) { @@ -1206,7 +1206,7 @@ void IRCView::contentsMouseReleaseEvent(QMouseEvent *ev) } } - if (ev->button() == QMouseEvent::LeftButton) + if (ev->button() == TQMouseEvent::LeftButton) { if (m_mousePressed) { @@ -1223,9 +1223,9 @@ void IRCView::contentsMouseReleaseEvent(QMouseEvent *ev) KTextBrowser::contentsMouseReleaseEvent(ev); } -void IRCView::contentsMousePressEvent(QMouseEvent* ev) +void IRCView::contentsMousePressEvent(TQMouseEvent* ev) { - if (ev->button() == QMouseEvent::LeftButton) + if (ev->button() == TQMouseEvent::LeftButton) { m_urlToDrag = m_highlightedURL; @@ -1240,9 +1240,9 @@ void IRCView::contentsMousePressEvent(QMouseEvent* ev) KTextBrowser::contentsMousePressEvent(ev); } -void IRCView::contentsMouseMoveEvent(QMouseEvent* ev) +void IRCView::contentsMouseMoveEvent(TQMouseEvent* ev) { - if (m_mousePressed && (m_pressPosition - ev->pos()).manhattanLength() > QApplication::startDragDistance()) + if (m_mousePressed && (m_pressPosition - ev->pos()).manhattanLength() > TQApplication::startDragDistance()) { m_mousePressed = false; removeSelection(); @@ -1251,7 +1251,7 @@ void IRCView::contentsMouseMoveEvent(QMouseEvent* ev) if (m_server && m_urlToDrag.startsWith("##")) { //FIXME consistent IRC URL serialization - ux = QString("irc://%1:%2/%3").arg(m_server->getServerName()).arg(m_server->getPort()).arg(m_urlToDrag.mid(2)); + ux = TQString("irc://%1:%2/%3").arg(m_server->getServerName()).arg(m_server->getPort()).arg(m_urlToDrag.mid(2)); } else if (m_urlToDrag.startsWith("#")) { @@ -1266,12 +1266,12 @@ void IRCView::contentsMouseMoveEvent(QMouseEvent* ev) KTextBrowser::contentsMouseMoveEvent(ev); } -void IRCView::contentsContextMenuEvent(QContextMenuEvent* ev) +void IRCView::contentsContextMenuEvent(TQContextMenuEvent* ev) { bool block = contextMenu(ev); // HACK Replace % with \x03 in the url to keep Qt from doing stupid things - m_highlightedURL = anchorAt(viewportToContents(mapFromGlobal(QCursor::pos()))); + m_highlightedURL = anchorAt(viewportToContents(mapFromGlobal(TQCursor::pos()))); m_highlightedURL = m_highlightedURL.replace('\x03', "%"); // Hack to counter the fact that we're given an decoded url m_highlightedURL = KURL::fromPathOrURL(m_highlightedURL).url(); @@ -1288,7 +1288,7 @@ void IRCView::contentsContextMenuEvent(QContextMenuEvent* ev) KTextBrowser::contentsContextMenuEvent(ev); } -bool IRCView::contextMenu(QContextMenuEvent* ce) +bool IRCView::contextMenu(TQContextMenuEvent* ce) { if (m_server && m_isOnNick && m_nickPopup->isEnabled()) { @@ -1361,7 +1361,7 @@ bool IRCView::contextMenu(QContextMenuEvent* ce) case Bookmark: { KBookmarkManager* bm = KBookmarkManager::userBookmarksManager(); - KBookmarkGroup bg = bm->addBookmarkDialog(m_urlToCopy, QString()); + KBookmarkGroup bg = bm->addBookmarkDialog(m_urlToCopy, TQString()); bm->save(); bm->emitChanged(bg); break; @@ -1434,12 +1434,12 @@ void IRCView::setupNickPopupMenu() m_nickPopup->insertItem(i18n("Add to Watched Nicks"), Konversation::AddNotify); - connect(m_nickPopup, SIGNAL(activated(int)), this, SIGNAL(popupCommand(int))); - connect(m_modes, SIGNAL(activated(int)), this, SIGNAL(popupCommand(int))); - connect(m_kickban, SIGNAL(activated(int)), this, SIGNAL(popupCommand(int))); + connect(m_nickPopup, TQT_SIGNAL(activated(int)), this, TQT_SIGNAL(popupCommand(int))); + connect(m_modes, TQT_SIGNAL(activated(int)), this, TQT_SIGNAL(popupCommand(int))); + connect(m_kickban, TQT_SIGNAL(activated(int)), this, TQT_SIGNAL(popupCommand(int))); } -void IRCView::updateNickMenuEntries(QPopupMenu* popup, const QString& nickname) +void IRCView::updateNickMenuEntries(TQPopupMenu* popup, const TQString& nickname) { if (popup) { @@ -1486,7 +1486,7 @@ void IRCView::setupQueryPopupMenu() m_nickPopup->insertItem(i18n("Add to Watched Nicks"), Konversation::AddNotify); - connect(m_nickPopup, SIGNAL(activated(int)), this, SIGNAL(popupCommand(int))); + connect(m_nickPopup, TQT_SIGNAL(activated(int)), this, TQT_SIGNAL(popupCommand(int))); } void IRCView::setupChannelPopupMenu() @@ -1497,7 +1497,7 @@ void IRCView::setupChannelPopupMenu() m_channelPopup->insertItem(i18n("Get &user list"),Konversation::Names); m_channelPopup->insertItem(i18n("Get &topic"),Konversation::Topic); - connect(m_channelPopup, SIGNAL(activated(int)), this, SIGNAL(popupCommand(int))); + connect(m_channelPopup, TQT_SIGNAL(activated(int)), this, TQT_SIGNAL(popupCommand(int))); } void IRCView::setNickAndChannelContextMenusEnabled(bool enable) @@ -1551,7 +1551,7 @@ void IRCView::searchAgain() } } -bool IRCView::search(const QString& pattern, bool caseSensitive, +bool IRCView::search(const TQString& pattern, bool caseSensitive, bool wholeWords, bool forward, bool fromCursor) { m_pattern = pattern; @@ -1615,7 +1615,7 @@ bool IRCView::searchNext(bool reversed) } // other windows can link own menu entries here -QPopupMenu* IRCView::getPopup() const +TQPopupMenu* IRCView::getPopup() const { return m_popup; } @@ -1623,15 +1623,15 @@ QPopupMenu* IRCView::getPopup() const // for more information about these RTFM // http://www.unicode.org/reports/tr9/ // http://www.w3.org/TR/unicode-xml/ -QChar IRCView::LRM = (ushort)0x200e; // Right-to-Left Mark -QChar IRCView::RLM = (ushort)0x200f; // Left-to-Right Mark -QChar IRCView::LRE = (ushort)0x202a; // Left-to-Right Embedding -QChar IRCView::RLE = (ushort)0x202b; // Right-to-Left Embedding -QChar IRCView::RLO = (ushort)0x202e; // Right-to-Left Override -QChar IRCView::LRO = (ushort)0x202d; // Left-to-Right Override -QChar IRCView::PDF = (ushort)0x202c; // Previously Defined Format - -QChar::Direction IRCView::basicDirection(const QString &string) +TQChar IRCView::LRM = (ushort)0x200e; // Right-to-Left Mark +TQChar IRCView::RLM = (ushort)0x200f; // Left-to-Right Mark +TQChar IRCView::LRE = (ushort)0x202a; // Left-to-Right Embedding +TQChar IRCView::RLE = (ushort)0x202b; // Right-to-Left Embedding +TQChar IRCView::RLO = (ushort)0x202e; // Right-to-Left Override +TQChar IRCView::LRO = (ushort)0x202d; // Left-to-Right Override +TQChar IRCView::PDF = (ushort)0x202c; // Previously Defined Format + +TQChar::Direction IRCView::basicDirection(const TQString &string) { // The following code decides between LTR or RTL direction for // a line based on the amount of each type of characters pre- @@ -1653,15 +1653,15 @@ QChar::Direction IRCView::basicDirection(const QString &string) { switch(string[pos].direction()) { - case QChar::DirL: - case QChar::DirLRO: - case QChar::DirLRE: + case TQChar::DirL: + case TQChar::DirLRO: + case TQChar::DirLRE: ltr_chars++; break; - case QChar::DirR: - case QChar::DirAL: - case QChar::DirRLO: - case QChar::DirRLE: + case TQChar::DirR: + case TQChar::DirAL: + case TQChar::DirRLO: + case TQChar::DirRLE: rtl_chars++; break; default: @@ -1670,47 +1670,47 @@ QChar::Direction IRCView::basicDirection(const QString &string) } if (ltr_chars > str_half_len) - return QChar::DirL; + return TQChar::DirL; else if (rtl_chars > str_half_len) - return QChar::DirR; + return TQChar::DirR; } if (rtl_chars > ltr_chars) - return QChar::DirR; + return TQChar::DirR; else - return QChar::DirL; + return TQChar::DirL; } -void IRCView::contentsDragMoveEvent(QDragMoveEvent *e) +void IRCView::contentsDragMoveEvent(TQDragMoveEvent *e) { - if(acceptDrops() && QUriDrag::canDecode(e)) + if(acceptDrops() && TQUriDrag::canDecode(e)) e->accept(); } -void IRCView::contentsDropEvent(QDropEvent *e) +void IRCView::contentsDropEvent(TQDropEvent *e) { - QStrList s; - if(QUriDrag::decode(e,s)) + TQStrList s; + if(TQUriDrag::decode(e,s)) emit filesDropped(s); } -QString IRCView::timeStamp() +TQString IRCView::timeStamp() { if(Preferences::timestamping()) { - QTime time = QTime::currentTime(); - QString timeColor = Preferences::color(Preferences::Time).name(); - QString timeFormat = Preferences::timestampFormat(); - QString timeString; + TQTime time = TQTime::currentTime(); + TQString timeColor = Preferences::color(Preferences::Time).name(); + TQString timeFormat = Preferences::timestampFormat(); + TQString timeString; if(!Preferences::showDate()) { - timeString = QString("<font color=\"" + timeColor + "\">[%1]</font> ").arg(time.toString(timeFormat)); + timeString = TQString("<font color=\"" + timeColor + "\">[%1]</font> ").arg(time.toString(timeFormat)); } else { - QDate date = QDate::currentDate(); - timeString = QString("<font color=\"" + + TQDate date = TQDate::currentDate(); + timeString = TQString("<font color=\"" + timeColor + "\">[%1 %2]</font> ") .arg(KGlobal::locale()->formatDate(date, true /*short format*/), time.toString(timeFormat)); @@ -1719,7 +1719,7 @@ QString IRCView::timeStamp() return timeString; } - return QString(); + return TQString(); } void IRCView::setChatWin(ChatWindow* chatWin) @@ -1734,7 +1734,7 @@ void IRCView::setChatWin(ChatWindow* chatWin) setupChannelPopupMenu(); } -void IRCView::keyPressEvent(QKeyEvent* e) +void IRCView::keyPressEvent(TQKeyEvent* e) { KKey key(e); @@ -1754,14 +1754,14 @@ void IRCView::keyPressEvent(QKeyEvent* e) KTextBrowser::keyPressEvent(e); } -void IRCView::resizeEvent(QResizeEvent* e) +void IRCView::resizeEvent(TQResizeEvent* e) { bool doScroll = ( KTextBrowser::verticalScrollBar()->value() == KTextBrowser::verticalScrollBar()->maxValue()); KTextBrowser::resizeEvent(e); if(doScroll) { - QTimer::singleShot(0, this, SLOT(updateScrollBarPos())); + TQTimer::singleShot(0, this, TQT_SLOT(updateScrollBarPos())); } } @@ -1771,14 +1771,14 @@ void IRCView::updateScrollBarPos() repaintContents(false); } -void IRCView::saveLinkAs(const QString& url) +void IRCView::saveLinkAs(const TQString& url) { KURL source(url); - KFileDialog dialog(":SaveLinkAs", QString (), this, "savelinkdia", true); + KFileDialog dialog(":SaveLinkAs", TQString (), this, "savelinkdia", true); dialog.setCaption(i18n("Save Link As")); dialog.setSelection(source.fileName()); - if(dialog.exec() == QDialog::Rejected) + if(dialog.exec() == TQDialog::Rejected) return; KURL destination = dialog.selectedURL(); |