summaryrefslogtreecommitdiffstats
path: root/src/kvirc/ui/kvi_channel.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
commit0a80cfd57d271dd44221467efb426675fa470356 (patch)
tree6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/kvirc/ui/kvi_channel.cpp
parent3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff)
downloadkvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz
kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kvirc/ui/kvi_channel.cpp')
-rw-r--r--src/kvirc/ui/kvi_channel.cpp312
1 files changed, 156 insertions, 156 deletions
diff --git a/src/kvirc/ui/kvi_channel.cpp b/src/kvirc/ui/kvi_channel.cpp
index a06ab14..8ad6ffb 100644
--- a/src/kvirc/ui/kvi_channel.cpp
+++ b/src/kvirc/ui/kvi_channel.cpp
@@ -69,15 +69,15 @@
#include <time.h>
-#include <qsplitter.h>
-#include <qtoolbutton.h>
-#include <qlabel.h>
-#include <qevent.h>
+#include <tqsplitter.h>
+#include <tqtoolbutton.h>
+#include <tqlabel.h>
+#include <tqevent.h>
-#include <qpalette.h>
+#include <tqpalette.h>
#include "kvi_tal_popupmenu.h"
#include "kvi_pointerhashtable.h"
-#include <qmessagebox.h>
+#include <tqmessagebox.h>
#include "kvi_tal_widgetstack.h"
#ifndef AVERAGE_CHANNEL_USERS
@@ -107,16 +107,16 @@ KviChannel::KviChannel(KviFrame * lpFrm,KviConsole * lpConsole,const char * name
m_pActionHistory->setAutoDelete(true);
m_uActionHistoryHotActionCount = 0;
- m_pTmpHighLighted = new KviPointerHashTable<const char *,QString>();
+ m_pTmpHighLighted = new KviPointerHashTable<const char *,TQString>();
m_pTmpHighLighted->setAutoDelete(true);
// Register ourselves
connection()->registerChannel(this);
- // And create the widgets layout
+ // And create the widgets tqlayout
// Button box
m_pButtonBox = new KviTalHBox(this);
- m_pTopSplitter = new QSplitter(Qt::Horizontal,m_pButtonBox);
+ m_pTopSplitter = new TQSplitter(Qt::Horizontal,m_pButtonBox);
m_pButtonBox->setStretchFactor(m_pTopSplitter,1);
@@ -125,8 +125,8 @@ KviChannel::KviChannel(KviFrame * lpFrm,KviConsole * lpConsole,const char * name
// Topic widget on the left
m_pTopicWidget = new KviTopicWidget(m_pTopSplitter,"topic_widget");
- connect(m_pTopicWidget,SIGNAL(topicSelected(const QString &)),
- this,SLOT(topicSelected(const QString &)));
+ connect(m_pTopicWidget,TQT_SIGNAL(topicSelected(const TQString &)),
+ this,TQT_SLOT(topicSelected(const TQString &)));
// mode label follows the topic widget
m_pModeWidget = new KviModeWidget(m_pTopSplitter,this,"mode_");
KviTalToolTip::add(m_pModeWidget,__tr2qs("Channel mode"));
@@ -134,7 +134,7 @@ KviChannel::KviChannel(KviFrame * lpFrm,KviConsole * lpConsole,const char * name
createTextEncodingButton(m_pButtonContainer);
// Central splitter
- m_pSplitter = new QSplitter(Qt::Horizontal,this);
+ m_pSplitter = new TQSplitter(Qt::Horizontal,this);
#ifdef COMPILE_USE_QT4
m_pSplitter->setObjectName(name);
#else
@@ -142,7 +142,7 @@ KviChannel::KviChannel(KviFrame * lpFrm,KviConsole * lpConsole,const char * name
#endif
m_pSplitter->setOpaqueResize(false);
// Spitted vertially on the left
- m_pVertSplitter = new QSplitter(Qt::Vertical,m_pSplitter);
+ m_pVertSplitter = new TQSplitter(Qt::Vertical,m_pSplitter);
m_pVertSplitter->setOpaqueResize(false);
// With the IRC view over
m_pIrcView = new KviIrcView(m_pVertSplitter,lpFrm,this);
@@ -151,7 +151,7 @@ KviChannel::KviChannel(KviFrame * lpFrm,KviConsole * lpConsole,const char * name
#else
m_pIrcView->setName(name);
#endif
- connect(m_pIrcView,SIGNAL(rightClicked()),this,SLOT(textViewRightClicked()));
+ connect(m_pIrcView,TQT_SIGNAL(rightClicked()),this,TQT_SLOT(textViewRightClicked()));
// And the double view (that may be unused)
m_pMessageView = 0;
// The userlist on the right
@@ -160,29 +160,29 @@ KviChannel::KviChannel(KviFrame * lpFrm,KviConsole * lpConsole,const char * name
// and the related buttons
m_pDoubleViewButton = createToolButton(m_pButtonContainer,"double_view_button",KVI_SMALLICON_HIDEDOUBLEVIEW,KVI_SMALLICON_SHOWDOUBLEVIEW,__tr2qs("Split View"),false);
- connect(m_pDoubleViewButton,SIGNAL(clicked()),this,SLOT(toggleDoubleView()));
+ connect(m_pDoubleViewButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(toggleDoubleView()));
m_pListViewButton = new KviWindowToolPageButton(KVI_SMALLICON_HIDELISTVIEW,KVI_SMALLICON_SHOWLISTVIEW,__tr2qs("User List"),buttonContainer(),true,"list_view_button");
- connect(m_pListViewButton,SIGNAL(clicked()),this,SLOT(toggleListView()));
+ connect(m_pListViewButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(toggleListView()));
m_pBanEditorButton = new KviWindowToolPageButton(KVI_SMALLICON_UNBAN,KVI_SMALLICON_BAN,__tr2qs("Ban Editor"),buttonContainer(),false,"ban_editor_button");
- connect(m_pBanEditorButton,SIGNAL(clicked()),this,SLOT(toggleBanEditor()));
+ connect(m_pBanEditorButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(toggleBanEditor()));
- if(m_pConsole->connection()->serverInfo()->supportedListModes().contains('e'))
+ if(m_pConsole->connection()->serverInfo()->supportedListModes().tqcontains('e'))
{
m_pBanExceptionEditorButton =new KviWindowToolPageButton(KVI_SMALLICON_BANUNEXCEPT,KVI_SMALLICON_BANEXCEPT,__tr2qs("Ban Exception Editor"),buttonContainer(),false,"ban_exception_editor_button");
- connect(m_pBanExceptionEditorButton,SIGNAL(clicked()),this,SLOT(toggleBanExceptionEditor()));
+ connect(m_pBanExceptionEditorButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(toggleBanExceptionEditor()));
} else {
m_pBanExceptionEditorButton=0;
}
- if(m_pConsole->connection()->serverInfo()->supportedListModes().contains('I'))
+ if(m_pConsole->connection()->serverInfo()->supportedListModes().tqcontains('I'))
{
m_pInviteEditorButton =new KviWindowToolPageButton(KVI_SMALLICON_INVITEUNEXCEPT,KVI_SMALLICON_INVITEEXCEPT,__tr2qs("Invite Exception Editor"),buttonContainer(),false,"invite_exception_editor_button");
- connect(m_pInviteEditorButton,SIGNAL(clicked()),this,SLOT(toggleInviteEditor()));
+ connect(m_pInviteEditorButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(toggleInviteEditor()));
} else {
m_pInviteEditorButton = 0;
}
m_pModeEditorButton = new KviWindowToolPageButton(KVI_SMALLICON_CHANMODEHIDE,KVI_SMALLICON_CHANMODE,__tr2qs("Mode Editor"),buttonContainer(),false,"mode_editor_button");
- connect(m_pModeEditorButton,SIGNAL(clicked()),this,SLOT(toggleModeEditor()));
+ connect(m_pModeEditorButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(toggleModeEditor()));
m_pModeEditor = 0;
#ifdef COMPILE_CRYPT_SUPPORT
@@ -201,7 +201,7 @@ KviChannel::KviChannel(KviFrame * lpFrm,KviConsole * lpConsole,const char * name
if(g_pIconManager->getBigIcon("kvi_horizontal_left.png"))
m_pHideToolsButton->setPixmap(*(g_pIconManager->getBigIcon("kvi_horizontal_left.png")));
- connect(m_pHideToolsButton,SIGNAL(clicked()),this,SLOT(toggleToolButtons()));
+ connect(m_pHideToolsButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(toggleToolButtons()));
m_pUserListView = new KviUserListView(m_pSplitter,m_pListViewButton,connection()->userDataBase(),this,
AVERAGE_CHANNEL_USERS,__tr2qs("User List"),"user_list_view");
@@ -209,7 +209,7 @@ KviChannel::KviChannel(KviFrame * lpFrm,KviConsole * lpConsole,const char * name
// m_pEditorsContainer->raiseWidget(m_pUserListView);
// And finally the input line on the bottom
m_pInput = new KviInput(this,m_pUserListView);
- // no mask editors yet
+ // no tqmask editors yet
m_pBanEditor = 0;
m_pBanExceptionEditor = 0;
m_pInviteEditor = 0;
@@ -220,7 +220,7 @@ KviChannel::KviChannel(KviFrame * lpFrm,KviConsole * lpConsole,const char * name
if(KVI_OPTION_BOOL(KviOption_boolAutoLogChannels))m_pIrcView->startLogging();
applyOptions();
- m_joinTime = QDateTime::currentDateTime();
+ m_joinTime = TQDateTime::tqcurrentDateTime();
m_tLastReceivedWhoReply = (kvi_time_t)m_joinTime.toTime_t();
@@ -245,7 +245,7 @@ void KviChannel::toggleToolButtons()
{
if(!buttonContainer()) return;
toggleButtonContainer();
- QPixmap* pix= buttonContainer()->isVisible() ?
+ TQPixmap* pix= buttonContainer()->isVisible() ?
g_pIconManager->getBigIcon("kvi_horizontal_left.png") :
g_pIconManager->getBigIcon("kvi_horizontal_right.png");
if(pix)
@@ -262,10 +262,10 @@ void KviChannel::textViewRightClicked()
KVS_TRIGGER_EVENT_0(KviEvent_OnChannelPopupRequest,this);
}
-void KviChannel::getBaseLogFileName(QString &buffer)
+void KviChannel::getBaseLogFileName(TQString &buffer)
{
- QString szChan(windowName());
- szChan.replace(".","%2e");
+ TQString szChan(windowName());
+ szChan.tqreplace(".","%2e");
if (console()->connection())
{
buffer=szChan;
@@ -287,11 +287,11 @@ void KviChannel::applyOptions()
m_pModeWidget->applyOptions();
- // this applies options for IrcView and Input and forces the window to relayout
+ // this applies options for IrcView and Input and forces the window to retqlayout
KviWindow::applyOptions();
}
-void KviChannel::getConfigGroupName(QString &buf)
+void KviChannel::getConfigGroupName(TQString &buf)
{
buf = windowName();
}
@@ -302,9 +302,9 @@ void KviChannel::saveProperties(KviConfig *cfg)
cfg->writeEntry("TopSplitter",m_pTopSplitter->sizes());
cfg->writeEntry("Splitter",m_pSplitter->sizes());
#ifdef COMPILE_USE_QT4
- QList<int> tmp = m_pVertSplitter->sizes();
+ TQList<int> tmp = m_pVertSplitter->sizes();
KviValueList<int> tmp2;
- for(QList<int>::Iterator it = tmp.begin();it != tmp.end();++it)
+ for(TQList<int>::Iterator it = tmp.begin();it != tmp.end();++it)
tmp2.append(*it);
cfg->writeEntry("VertSplitter",m_pMessageView ? tmp2 : m_VertSplitterSizesList);
#else
@@ -378,7 +378,7 @@ void KviChannel::showDoubleView(bool bShow)
{
m_pMessageView->setPrivateBackgroundPixmap(*(m_privateBackground.pixmap()));
}
- connect(m_pMessageView,SIGNAL(rightClicked()),this,SLOT(textViewRightClicked()));
+ connect(m_pMessageView,TQT_SIGNAL(rightClicked()),this,TQT_SLOT(textViewRightClicked()));
m_pMessageView->setMasterView(m_pIrcView);
m_pIrcView->splitMessagesTo(m_pMessageView);
m_pMessageView->show();
@@ -414,10 +414,10 @@ void KviChannel::toggleModeEditor()
resizeEvent(0);
} else {
m_pModeEditor = new KviModeEditor(m_pSplitter,m_pModeEditorButton,"mode_editor",console(),m_szChannelMode,m_szChannelKey,m_szChannelLimit.ptr());
- connect(m_pModeEditor,SIGNAL(setMode(const char *)),this,SLOT(setMode(const char *)));
- connect(m_pModeEditor,SIGNAL(done()),this,SLOT(modeSelectorDone()));
+ connect(m_pModeEditor,TQT_SIGNAL(setMode(const char *)),this,TQT_SLOT(setMode(const char *)));
+ connect(m_pModeEditor,TQT_SIGNAL(done()),this,TQT_SLOT(modeSelectorDone()));
m_pModeEditor->show();
- //setFocusHandlerNoClass(m_pInput,m_pModeEditor,"QLineEdit");
+ //setFocusHandlerNoClass(m_pInput,m_pModeEditor,TQLINEEDIT_OBJECT_NAME_STRING);
if(!m_pModeEditorButton->isOn())m_pModeEditorButton->setOn(true);
}
}
@@ -430,7 +430,7 @@ void KviChannel::modeSelectorDone()
void KviChannel::setMode(const char * mode)
{
if(!connection())return;
- KviQCString tmp = connection()->encodeText(m_szName);
+ KviTQCString tmp = connection()->encodeText(m_szName);
connection()->sendFmtData("MODE %s %s",tmp.data(),mode);
}
@@ -490,14 +490,14 @@ void KviChannel::toggleEditor(KviMaskEditor ** ppEd,KviWindowToolPageButton ** p
{
if(connection())
{
- KviQCString szName = connection()->encodeText(m_szName);
+ KviTQCString szName = connection()->encodeText(m_szName);
connection()->sendFmtData("MODE %s %c",szName.data(),flag);
}
}
*ppEd = new KviMaskEditor(m_pSplitter,*ppBtn,l,flag,edName);
- connect(*ppEd,SIGNAL(removeMasks(KviMaskEditor *,KviPointerList<KviMaskEntry> *)),
- this,SLOT(removeMasks(KviMaskEditor *,KviPointerList<KviMaskEntry> *)));
+ connect(*ppEd,TQT_SIGNAL(removeMasks(KviMaskEditor *,KviPointerList<KviMaskEntry> *)),
+ this,TQT_SLOT(removeMasks(KviMaskEditor *,KviPointerList<KviMaskEntry> *)));
//setFocusHandler(m_pInput,*ppEd); //socket it!
(*ppEd)->show();
if(!(*ppBtn))return;
@@ -507,76 +507,76 @@ void KviChannel::toggleEditor(KviMaskEditor ** ppEd,KviWindowToolPageButton ** p
void KviChannel::removeMasks(KviMaskEditor *ed,KviPointerList<KviMaskEntry> *l)
{
- KviStr masks;
+ KviStr tqmasks;
KviStr flags;
unsigned int count = 0;
for(KviMaskEntry * e = l->first();e;e = l->next())
{
- if(masks.hasData())masks.append(' ');
- masks.append(e->szMask);
+ if(tqmasks.hasData())tqmasks.append(' ');
+ tqmasks.append(e->szMask);
flags.append(ed->flag());
count++;
if(count == connection()->serverInfo()->maxModeChanges())
{
if(connection())
{
- KviQCString szName = connection()->encodeText(m_szName);
- connection()->sendFmtData("MODE %s -%s %s",szName.data(),flags.ptr(),connection()->encodeText(QString(masks)).data());
+ KviTQCString szName = connection()->encodeText(m_szName);
+ connection()->sendFmtData("MODE %s -%s %s",szName.data(),flags.ptr(),connection()->encodeText(TQString(tqmasks)).data());
}
flags = "";
- masks = "";
+ tqmasks = "";
count = 0;
}
}
- if(masks.hasData())
+ if(tqmasks.hasData())
{
if(connection())
{
- KviQCString szName = connection()->encodeText(m_szName);
- connection()->sendFmtData("MODE %s -%s %s",szName.data(),flags.ptr(),connection()->encodeText(QString(masks)).data());
+ KviTQCString szName = connection()->encodeText(m_szName);
+ connection()->sendFmtData("MODE %s -%s %s",szName.data(),flags.ptr(),connection()->encodeText(TQString(tqmasks)).data());
}
}
}
-QPixmap * KviChannel::myIconPtr()
+TQPixmap * KviChannel::myIconPtr()
{
return g_pIconManager->getSmallIcon((m_iStateFlags & KVI_CHANNEL_STATE_DEADCHAN) ? KVI_SMALLICON_DEADCHANNEL : KVI_SMALLICON_CHANNEL);
}
-void KviChannel::resizeEvent(QResizeEvent *e)
+void KviChannel::resizeEvent(TQResizeEvent *e)
{
#ifdef COMPILE_USE_QT4
int hght = m_pInput->heightHint();
- int hght2 = m_pTopicWidget->sizeHint().height();
+ int hght2 = m_pTopicWidget->tqsizeHint().height();
m_pButtonBox->setGeometry(0,0,width(),hght2);
m_pSplitter->setGeometry(0,hght2,width(),height() - (hght + hght2));
m_pInput->setGeometry(0,height() - hght,width(),hght);
#else
int hght = m_pInput->heightHint();
- int hght2 = m_pButtonBox->sizeHint().height();
+ int hght2 = m_pButtonBox->tqsizeHint().height();
m_pButtonBox->setGeometry(0,0,width(),hght2);
m_pSplitter->setGeometry(0,hght2,width(),height() - (hght + hght2));
m_pInput->setGeometry(0,height() - hght,width(),hght);
#endif
}
-QSize KviChannel::sizeHint() const
+TQSize KviChannel::tqsizeHint() const
{
- QSize ret(m_pSplitter->sizeHint().width(),
- m_pIrcView->sizeHint().height() + m_pInput->heightHint() + m_pButtonBox->sizeHint().height());
+ TQSize ret(m_pSplitter->tqsizeHint().width(),
+ m_pIrcView->tqsizeHint().height() + m_pInput->heightHint() + m_pButtonBox->tqsizeHint().height());
return ret;
}
void KviChannel::setChannelMode(char mode,bool bAdd)
{
- if(!m_pConsole->connection()->serverInfo()->supportedListModes().contains(mode)){
+ if(!m_pConsole->connection()->serverInfo()->supportedListModes().tqcontains(mode)){
if(bAdd)
{
- if(!(m_szChannelMode.contains(mode)))m_szChannelMode.append(mode);
+ if(!(m_szChannelMode.tqcontains(mode)))m_szChannelMode.append(mode);
} else {
- if(m_szChannelMode.contains(mode))
+ if(m_szChannelMode.tqcontains(mode))
{
- m_szChannelMode.replace(mode,"");
+ m_szChannelMode.tqreplace(mode,"");
}
}
updateModeLabel();
@@ -602,7 +602,7 @@ void KviChannel::addHighlightedUser(const char * nick)
{
if(!m_pUserListView->findEntry(nick))return;
else
- m_pTmpHighLighted->replace(nick,new QString());
+ m_pTmpHighLighted->tqreplace(nick,new TQString());
}
void KviChannel::removeHighlightedUser(const char * nick)
@@ -610,7 +610,7 @@ void KviChannel::removeHighlightedUser(const char * nick)
m_pTmpHighLighted->remove(nick);
}
-void KviChannel::getChannelModeString(QString &buffer)
+void KviChannel::getChannelModeString(TQString &buffer)
{
buffer = m_szChannelMode;
if(!m_szChannelKey.isEmpty())buffer.append('k');
@@ -655,7 +655,7 @@ void KviChannel::setAliveChan()
m_iStateFlags = 0;
setType(KVI_WINDOW_TYPE_CHANNEL);
m_pUserListView->setUserDataBase(connection()->userDataBase());
- m_joinTime = QDateTime::currentDateTime();
+ m_joinTime = TQDateTime::tqcurrentDateTime();
context()->unregisterDeadChannel(this);
connection()->registerChannel(this);
// Update log file name
@@ -665,7 +665,7 @@ void KviChannel::setAliveChan()
m_pTopicWidget->reset(); // reset the topic (fixes bug #20 signaled by Klaus Weidenbach)
}
-void KviChannel::getTalkingUsersStats(QString &buffer,QStringList &l,bool bPast)
+void KviChannel::getTalkingUsersStats(TQString &buffer,TQStringList &l,bool bPast)
{
if(l.count() < 1)return;
@@ -704,29 +704,29 @@ void KviChannel::getTalkingUsersStats(QString &buffer,QStringList &l,bool bPast)
} else {
// (l.count() - 1) is > 1
buffer += "</b> ";
- buffer += __tr2qs("and other %1 users").arg(l.count() - 1);
+ buffer += __tr2qs("and other %1 users").tqarg(l.count() - 1);
}
buffer += " ";
buffer += bPast ? __tr2qs("were talking recently") : __tr2qs("are talking");
}
}
-void KviChannel::getTaskBarTipText(QString &buffer)
+void KviChannel::getTaskBarTipText(TQString &buffer)
{
- static QString html_bold("<b>");
- static QString html_tab("&nbsp;&nbsp;");
- static QString html_eofbold("</b> ");
- static QString p5(" (");
+ static TQString html_bold("<b>");
+ static TQString html_tab("&nbsp;&nbsp;");
+ static TQString html_eofbold("</b> ");
+ static TQString p5(" (");
// p6 == p4
- static QString p7(" (");
- static QString p8(": ");
- static QString p9(")");
- static QString p10("<br>");
+ static TQString p7(" (");
+ static TQString p8(": ");
+ static TQString p9(")");
+ static TQString p10("<br>");
- static QString end_of_doc = "</table></body></html>";
- static QString end_of_fontboldrow = END_TABLE_BOLD_ROW;
- static QString start_of_row = "<tr><td>";
- static QString end_of_row = "</td></tr>";
+ static TQString end_of_doc = "</table></body></html>";
+ static TQString end_of_fontboldrow = END_TABLE_BOLD_ROW;
+ static TQString start_of_row = "<tr><td>";
+ static TQString end_of_row = "</td></tr>";
buffer = "<html>" \
"<body>" \
@@ -750,15 +750,15 @@ void KviChannel::getTaskBarTipText(QString &buffer)
buffer += start_of_row;
- QString op = __tr2qs("operator");
- QString ops = __tr2qs("operators");
+ TQString op = __tr2qs("operator");
+ TQString ops = __tr2qs("operators");
//////////////////////
buffer += html_tab;
buffer += html_bold;
- QString num;
+ TQString num;
num.setNum(s.uActive);
buffer += num;
@@ -940,7 +940,7 @@ void KviChannel::getTaskBarTipText(QString &buffer)
if(cas.dActionsPerMinute >= 0.1)
{
- QString num;
+ TQString num;
num.sprintf(" [%u%% ",cas.uHotActionPercent);
buffer += num;
buffer += __tr2qs("human");
@@ -955,15 +955,15 @@ void KviChannel::getTaskBarTipText(QString &buffer)
void KviChannel::fillCaptionBuffers()
{
- static QString begin("<nobr><font color=\"");
- static QString boldbegin("\"><b>");
- static QString endofbold("</b></font> <font color=\"");
- static QString endoffont("\">");
- static QString end("</font></nobr>");
+ static TQString begin("<nobr><font color=\"");
+ static TQString boldbegin("\"><b>");
+ static TQString endofbold("</b></font> <font color=\"");
+ static TQString endoffont("\">");
+ static TQString end("</font></nobr>");
if(!connection())
{
- QString dead = __tr2qs("[Dead channel]");
+ TQString dead = __tr2qs("[Dead channel]");
m_szNameWithUserFlag = m_szName;
@@ -998,13 +998,13 @@ void KviChannel::fillCaptionBuffers()
if(uFlag)
{
- m_szNameWithUserFlag = QChar(uFlag);
+ m_szNameWithUserFlag = TQChar(uFlag);
m_szNameWithUserFlag += m_szName;
} else {
m_szNameWithUserFlag = m_szName;
}
- QString szChanMode;
+ TQString szChanMode;
getChannelModeString(szChanMode);
m_szPlainTextCaption = m_szNameWithUserFlag;
@@ -1012,16 +1012,16 @@ void KviChannel::fillCaptionBuffers()
{
m_szPlainTextCaption += " (+";
m_szPlainTextCaption += szChanMode;
- m_szPlainTextCaption += QChar(')');
+ m_szPlainTextCaption += TQChar(')');
}
- QString szNickOnServer = QChar('[');
+ TQString szNickOnServer = TQChar('[');
szNickOnServer += connection()->currentNickName();
szNickOnServer += __tr2qs(" on ");
szNickOnServer += connection()->currentServerName();
- szNickOnServer += QChar(']');
+ szNickOnServer += TQChar(']');
- m_szPlainTextCaption += QChar(' ');
+ m_szPlainTextCaption += TQChar(' ');
m_szPlainTextCaption += szNickOnServer;
m_szHtmlActiveCaption = begin;
@@ -1045,12 +1045,12 @@ void KviChannel::fillCaptionBuffers()
m_szHtmlInactiveCaption += end;
}
-void KviChannel::ownMessage(const QString &buffer)
+void KviChannel::ownMessage(const TQString &buffer)
{
if(!connection())return;
- KviQCString szName = connection()->encodeText(windowName());
- KviQCString szData = encodeText(buffer);
+ KviTQCString szName = connection()->encodeText(windowName());
+ KviTQCString szData = encodeText(buffer);
const char * d = szData.data();
if(!d)return;
@@ -1068,20 +1068,20 @@ void KviChannel::ownMessage(const QString &buffer)
case KviCryptEngine::Encrypted:
if(!connection()->sendFmtData("PRIVMSG %s :%s",szName.data(),encrypted.ptr()))return;
m_pConsole->outputPrivmsg(this,KVI_OUT_OWNPRIVMSGCRYPTED,
- QString::null,QString::null,QString::null,buffer,KviConsole::NoNotifications);
+ TQString(),TQString(),TQString(),buffer,KviConsole::NoNotifications);
break;
case KviCryptEngine::Encoded:
{
if(!connection()->sendFmtData("PRIVMSG %s :%s",szName.data(),encrypted.ptr()))return;
// ugly ,but we must redecode here
- QString szRedecoded = decodeText(encrypted.ptr());
+ TQString szRedecoded = decodeText(encrypted.ptr());
m_pConsole->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG,
- QString::null,QString::null,QString::null,szRedecoded,KviConsole::NoNotifications);
+ TQString(),TQString(),TQString(),szRedecoded,KviConsole::NoNotifications);
}
break;
default: // also case KviCryptEngine::EncryptError
{
- QString szEngineError = cryptSessionInfo()->pEngine->lastError();
+ TQString szEngineError = cryptSessionInfo()->pEngine->lastError();
output(KVI_OUT_SYSTEMERROR,
__tr2qs("The crypto engine was unable to encrypt the current message (%Q): %Q, no data sent to the server"),
&buffer,&szEngineError);
@@ -1092,9 +1092,9 @@ void KviChannel::ownMessage(const QString &buffer)
return;
} else {
d++; //eat the escape code
- QString tmp = buffer.right(buffer.length() - 1);
+ TQString tmp = buffer.right(buffer.length() - 1);
if(!connection()->sendFmtData("PRIVMSG %s :%s",szName.data(),d))return;
- m_pConsole->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG,QString::null,QString::null,QString::null,tmp,KviConsole::NoNotifications);
+ m_pConsole->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG,TQString(),TQString(),TQString(),tmp,KviConsole::NoNotifications);
userAction(connection()->currentNickName(),KVI_USERACTION_PRIVMSG);
return;
}
@@ -1104,21 +1104,21 @@ void KviChannel::ownMessage(const QString &buffer)
if(connection()->sendFmtData("PRIVMSG %s :%s",szName.data(),d))
{
- m_pConsole->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG,QString::null,QString::null,QString::null,buffer,KviConsole::NoNotifications);
+ m_pConsole->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG,TQString(),TQString(),TQString(),buffer,KviConsole::NoNotifications);
userAction(connection()->currentNickName(),KVI_USERACTION_PRIVMSG);
}
}
-void KviChannel::ownAction(const QString &buffer)
+void KviChannel::ownAction(const TQString &buffer)
{
if(!connection())return;
- KviQCString szName = connection()->encodeText(m_szName);
- KviQCString szData = encodeText(buffer);
+ KviTQCString szName = connection()->encodeText(m_szName);
+ KviTQCString szData = encodeText(buffer);
const char * d = szData.data();
if(!d)return;
if(!connection()->sendFmtData("PRIVMSG %s :%cACTION %s%c",szName.data(),0x01,d,0x01))return;
- if(KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnMeAction,this,QString(d)))return;
- QString szBuffer = "\r!nc\r";
+ if(KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnMeAction,this,TQString(d)))return;
+ TQString szBuffer = "\r!nc\r";
szBuffer += connection()->currentNickName();
szBuffer += "\r ";
szBuffer += buffer;
@@ -1126,14 +1126,14 @@ void KviChannel::ownAction(const QString &buffer)
userAction(connection()->currentNickName(),KVI_USERACTION_ACTION);
}
-bool KviChannel::nickChange(const QString &oldNick,const QString &newNick)
+bool KviChannel::nickChange(const TQString &oldNick,const TQString &newNick)
{
bool bWasHere = m_pUserListView->nickChange(oldNick,newNick);
if(bWasHere)channelAction(newNick,KVI_USERACTION_NICK,kvi_getUserActionTemperature(KVI_USERACTION_NICK));
return bWasHere;
}
-bool KviChannel::part(const QString &nick)
+bool KviChannel::part(const TQString &nick)
{
bool bWasHere = m_pUserListView->part(nick);
if(bWasHere)channelAction(nick,KVI_USERACTION_PART,kvi_getUserActionTemperature(KVI_USERACTION_PART));
@@ -1170,7 +1170,7 @@ bool KviChannel::activityMeter(unsigned int * puActivityValue,unsigned int * puA
if(m_pActionHistory->count() < KVI_CHANNEL_ACTION_HISTORY_MAX_COUNT)
{
- if(m_joinTime.secsTo(QDateTime::currentDateTime()) < KVI_CHANNEL_ACTION_HISTORY_MAX_TIMESPAN)
+ if(m_joinTime.secsTo(TQDateTime::tqcurrentDateTime()) < KVI_CHANNEL_ACTION_HISTORY_MAX_TIMESPAN)
{
// we can't exactly estimate
if(dSpan < 60.0)dSpan = 60.0;
@@ -1208,7 +1208,7 @@ bool KviChannel::activityMeter(unsigned int * puActivityValue,unsigned int * puA
}
-void KviChannel::channelAction(const QString &nick,unsigned int uActionType,int iTemperature)
+void KviChannel::channelAction(const TQString &nick,unsigned int uActionType,int iTemperature)
{
KviChannelAction * a = new KviChannelAction;
a->tTime = kvi_unixTime();
@@ -1281,7 +1281,7 @@ void KviChannel::getChannelActivityStats(KviChannelActivityStats * s)
if(s->uActionCount < KVI_CHANNEL_ACTION_HISTORY_MAX_COUNT)
{
- if(m_joinTime.secsTo(QDateTime::currentDateTime()) < KVI_CHANNEL_ACTION_HISTORY_MAX_TIMESPAN)
+ if(m_joinTime.secsTo(TQDateTime::tqcurrentDateTime()) < KVI_CHANNEL_ACTION_HISTORY_MAX_TIMESPAN)
{
// we can't exactly estimate
s->bStatsInaccurate = true;
@@ -1301,7 +1301,7 @@ void KviChannel::getChannelActivityStats(KviChannelActivityStats * s)
tTwoMinsAgo-= 120;
tNow -= 60;
- KviPointerHashTable<QString,int> userDict;
+ KviPointerHashTable<TQString,int> userDict;
userDict.setAutoDelete(false);
int fake;
@@ -1319,7 +1319,7 @@ void KviChannel::getChannelActivityStats(KviChannelActivityStats * s)
(a->uActionType == KVI_USERACTION_NOTICE) ||
(a->uActionType == KVI_USERACTION_ACTION))
{
- if(!userDict.find(a->szNick))
+ if(!userDict.tqfind(a->szNick))
{
if(isOn(a->szNick.ascii()))
{
@@ -1338,14 +1338,14 @@ void KviChannel::getChannelActivityStats(KviChannelActivityStats * s)
-void KviChannel::userAction(const QString &nick,const QString &user,const QString &host,unsigned int uActionType)
+void KviChannel::userAction(const TQString &nick,const TQString &user,const TQString &host,unsigned int uActionType)
{
int iTemperature = kvi_getUserActionTemperature(uActionType);
channelAction(nick,uActionType,iTemperature);
m_pUserListView->userAction(nick,user,host,iTemperature);
}
-void KviChannel::userAction(const QString &nick,unsigned int uActionType)
+void KviChannel::userAction(const TQString &nick,unsigned int uActionType)
{
int iTemperature = kvi_getUserActionTemperature(uActionType);
channelAction(nick,uActionType,iTemperature);
@@ -1359,15 +1359,15 @@ void KviChannel::userAction(KviIrcMask * user,unsigned int uActionType)
m_pUserListView->userAction(user,iTemperature);
}
-void KviChannel::topicSelected(const QString & topic)
+void KviChannel::topicSelected(const TQString & topic)
{
if(!connection())return;
- KviQCString szEncoded = encodeText(topic);
- KviQCString szName = connection()->encodeText(m_szName);
+ KviTQCString szEncoded = encodeText(topic);
+ KviTQCString szName = connection()->encodeText(m_szName);
connection()->sendFmtData("TOPIC %s :%s",szName.data(),szEncoded.length() ? szEncoded.data() : "");
}
-void KviChannel::closeEvent(QCloseEvent *e)
+void KviChannel::closeEvent(TQCloseEvent *e)
{
if((m_iStateFlags & KVI_CHANNEL_STATE_SENTPART) || (m_iStateFlags & KVI_CHANNEL_STATE_DEADCHAN) || !(m_pConsole->isConnected()))
{
@@ -1378,16 +1378,16 @@ void KviChannel::closeEvent(QCloseEvent *e)
// FIXME: #warning "THIS PART SHOULD BECOME A COMMAND /PART $option()..so the identifiers are parsed"
if(connection())
{
- QString tmp = KVI_OPTION_STRING(KviOption_stringPartMessage);
- tmp.replace(";","\\;");
- tmp.replace("\n"," ");
+ TQString tmp = KVI_OPTION_STRING(KviOption_stringPartMessage);
+ tmp.tqreplace(";","\\;");
+ tmp.tqreplace("\n"," ");
KviKvsVariant vRet;
if(KviKvsScript::evaluate(tmp,this,0,&vRet))vRet.asString(tmp);
- KviQCString dat = encodeText(tmp);
+ KviTQCString dat = encodeText(tmp);
partMessageSent();
- KviQCString szName = connection()->encodeText(m_szName);
+ KviTQCString szName = connection()->encodeText(m_szName);
connection()->sendFmtData("PART %s :%s",szName.data(),dat.data() ? dat.data() : "");
// be sure to not reference ourselves here.. we could be disconnected!
} else {
@@ -1424,7 +1424,7 @@ int KviChannel::myFlags()
}
-void KviChannel::setMask(char flag, const QString &mask,bool bAdd,const QString &setBy,unsigned int setAt)
+void KviChannel::setMask(char flag, const TQString &tqmask,bool bAdd,const TQString &setBy,unsigned int setAt)
{
if(!connection())return;
KviPointerList<KviMaskEntry> * list = m_pBanList;
@@ -1446,21 +1446,21 @@ void KviChannel::setMask(char flag, const QString &mask,bool bAdd,const QString
break;
}
- internalMask(mask,bAdd,setBy,setAt,list,&editor);
+ internalMask(tqmask,bAdd,setBy,setAt,list,&editor);
m_pUserListView->setMaskEntries(flag,(int)list->count());
}
-void KviChannel::internalMask(const QString &mask,bool bAdd,const QString &setBy,unsigned int setAt,KviPointerList<KviMaskEntry> *l,KviMaskEditor **ppEd)
+void KviChannel::internalMask(const TQString &tqmask,bool bAdd,const TQString &setBy,unsigned int setAt,KviPointerList<KviMaskEntry> *l,KviMaskEditor **ppEd)
{
KviMaskEntry * e = 0;
if(bAdd)
{
for(e = l->first();e;e = l->next())
{
- if(KviQString::equalCI(e->szMask,mask))return; //already there
+ if(KviTQString::equalCI(e->szMask,tqmask))return; //already there
}
e = new KviMaskEntry;
- e->szMask = mask;
+ e->szMask = tqmask;
e->szSetBy = (!setBy.isEmpty()) ? setBy : __tr2qs("(Unknown)");
e->uSetAt = setAt;
l->append(e);
@@ -1468,7 +1468,7 @@ void KviChannel::internalMask(const QString &mask,bool bAdd,const QString &setBy
} else {
for(e = l->first();e;e = l->next())
{
- if(KviQString::equalCI(e->szMask,mask))break;
+ if(KviTQString::equalCI(e->szMask,tqmask))break;
}
if(e)
{
@@ -1480,29 +1480,29 @@ void KviChannel::internalMask(const QString &mask,bool bAdd,const QString &setBy
void KviChannel::updateModeLabel()
{
- QString tmp = m_szChannelMode;
- QString tip = __tr2qs("<b>Channel mode:</b>");
+ TQString tmp = m_szChannelMode;
+ TQString tip = __tr2qs("<b>Channel mode:</b>");
//const char * aux = m_szChannelMode.utf8().data(); leaks memory and will not work with getChannelModeDescription() (can channel modes be multibyte ?)
KviStr mod = m_szChannelMode;
const char * aux = mod.ptr();
while(*aux)
{
- KviQString::appendFormatted(tip,"<br>%c: %Q",*aux,&(m_pConsole->connection()->serverInfo()->getChannelModeDescription(*aux)));
+ KviTQString::appendFormatted(tip,"<br>%c: %Q",*aux,&(m_pConsole->connection()->serverInfo()->getChannelModeDescription(*aux)));
++aux;
}
if(!m_szChannelKey.isEmpty())
{
if(!tmp.isEmpty())tmp.append(' ');
- KviQString::appendFormatted(tmp,"k:%s",m_szChannelKey.utf8().data());
- KviQString::appendFormatted(tip,__tr2qs("<br><b>Key:</b> %s"),m_szChannelKey.utf8().data());
+ KviTQString::appendFormatted(tmp,"k:%s",m_szChannelKey.utf8().data());
+ KviTQString::appendFormatted(tip,__tr2qs("<br><b>Key:</b> %s"),m_szChannelKey.utf8().data());
}
if(m_szChannelLimit.hasData())
{
if(!tmp.isEmpty())tmp.append(' ');
- KviQString::appendFormatted(tmp,"l:%s",m_szChannelLimit.ptr());
- KviQString::appendFormatted(tip,__tr2qs("<br><b>Limit:</b> %s"),m_szChannelLimit.ptr());
+ KviTQString::appendFormatted(tmp,"l:%s",m_szChannelLimit.ptr());
+ KviTQString::appendFormatted(tip,__tr2qs("<br><b>Limit:</b> %s"),m_szChannelLimit.ptr());
}
m_pModeWidget->refreshModes();
@@ -1541,11 +1541,11 @@ void KviChannel::outputMessage(int msg_type,const char *format,...)
}
*/
-void KviChannel::outputMessage(int msg_type,const QString &msg)
+void KviChannel::outputMessage(int msg_type,const TQString &msg)
{
- QString szBuf(msg);
+ TQString szBuf(msg);
preprocessMessage(szBuf);
- const QChar * pC = KviQString::nullTerminatedArray(szBuf);
+ const TQChar * pC = KviTQString::nullTerminatedArray(szBuf);
if(!pC)return;
internalOutput(m_pMessageView ? m_pMessageView : m_pIrcView,msg_type,(const kvi_wchar_t *)pC);
}
@@ -1580,7 +1580,7 @@ void KviChannel::checkChannelSync()
// we already have all the spontaneous server replies
// (so probably mode, topic (or no topic is set),names)
// we have already received the I and e lists (if requested)
- kvs_int_t iSyncTime = m_joinTime.time().msecsTo(QTime::currentTime());
+ kvs_int_t iSyncTime = m_joinTime.time().msecsTo(TQTime::currentTime());
if(iSyncTime < 0)iSyncTime += 86400000;
bool bStop = KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnChannelSync,this,iSyncTime);
@@ -1591,9 +1591,9 @@ void KviChannel::checkChannelSync()
}
}
-bool KviChannel::eventFilter(QObject * o, QEvent * e)
+bool KviChannel::eventFilter(TQObject * o, TQEvent * e)
{
- if(e->type() == QEvent::FocusOut && o == m_pTopicWidget && \
+ if(e->type() == TQEvent::FocusOut && TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_pTopicWidget) && \
m_pTopicWidget->isVisible())
m_pTopicWidget->deactivate();
@@ -1601,20 +1601,20 @@ bool KviChannel::eventFilter(QObject * o, QEvent * e)
}
-void KviChannel::preprocessMessage(QString & szMessage)
+void KviChannel::preprocessMessage(TQString & szMessage)
{
- QStringList strings = QStringList::split(" ",szMessage, TRUE);
- for ( QStringList::Iterator it = strings.begin(); it != strings.end(); ++it ) {
- if((*it).contains('\r')) continue;
- QString tmp = KviMircCntrl::stripControlBytes(*it);
- if( findEntry(*it) ) *it=QString("\r!n\r%1\r").arg(*it);
+ TQStringList strings = TQStringList::split(" ",szMessage, TRUE);
+ for ( TQStringList::Iterator it = strings.begin(); it != strings.end(); ++it ) {
+ if((*it).tqcontains('\r')) continue;
+ TQString tmp = KviMircCntrl::stripControlBytes(*it);
+ if( findEntry(*it) ) *it=TQString("\r!n\r%1\r").tqarg(*it);
if(m_pConsole)
if(m_pConsole->connection())
- if(m_pConsole->connection()->serverInfo()->supportedChannelTypes().contains(tmp[0]))
+ if(m_pConsole->connection()->serverInfo()->supportedChannelTypes().tqcontains(tmp[0]))
if((*it)==tmp)
- *it=QString("\r!c\r%1\r").arg(*it);
+ *it=TQString("\r!c\r%1\r").tqarg(*it);
else
- *it=QString("\r!c%1\r%2\r").arg(tmp).arg(*it);
+ *it=TQString("\r!c%1\r%2\r").tqarg(tmp).tqarg(*it);
}
szMessage=strings.join(" ");
}