summaryrefslogtreecommitdiffstats
path: root/konversation/src/channel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'konversation/src/channel.cpp')
-rw-r--r--konversation/src/channel.cpp544
1 files changed, 272 insertions, 272 deletions
diff --git a/konversation/src/channel.cpp b/konversation/src/channel.cpp
index 38a7e63..04a4020 100644
--- a/konversation/src/channel.cpp
+++ b/konversation/src/channel.cpp
@@ -32,24 +32,24 @@
#include "linkaddressbook/linkaddressbookui.h"
#include "linkaddressbook/addressbook.h"
-#include <qlabel.h>
-#include <qvbox.h>
-#include <qevent.h>
-#include <qhbox.h>
-#include <qgrid.h>
-#include <qdragobject.h>
-#include <qsizepolicy.h>
-#include <qheader.h>
-#include <qregexp.h>
-#include <qtooltip.h>
-#include <qsplitter.h>
-#include <qcheckbox.h>
-#include <qtimer.h>
-#include <qcombobox.h>
-#include <qtextcodec.h>
-#include <qwhatsthis.h>
-#include <qtoolbutton.h>
-#include <qlayout.h>
+#include <tqlabel.h>
+#include <tqvbox.h>
+#include <tqevent.h>
+#include <tqhbox.h>
+#include <tqgrid.h>
+#include <tqdragobject.h>
+#include <tqsizepolicy.h>
+#include <tqheader.h>
+#include <tqregexp.h>
+#include <tqtooltip.h>
+#include <tqsplitter.h>
+#include <tqcheckbox.h>
+#include <tqtimer.h>
+#include <tqcombobox.h>
+#include <tqtextcodec.h>
+#include <tqwhatsthis.h>
+#include <tqtoolbutton.h>
+#include <tqlayout.h>
#include <kprocess.h>
@@ -65,7 +65,7 @@
#include <kwin.h>
-Channel::Channel(QWidget* parent, QString _name) : ChatWindow(parent)
+Channel::Channel(TQWidget* parent, TQString _name) : ChatWindow(parent)
{
// init variables
@@ -107,38 +107,38 @@ Channel::Channel(QWidget* parent, QString _name) : ChatWindow(parent)
setChannelEncodingSupported(true);
// Build some size policies for the widgets
- QSizePolicy hfixed = QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
- QSizePolicy hmodest = QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
- QSizePolicy vmodest = QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
- QSizePolicy vfixed = QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
- QSizePolicy modest = QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
- QSizePolicy greedy = QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
-
- m_vertSplitter = new QSplitter(Qt::Vertical, this);
+ TQSizePolicy hfixed = TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred);
+ TQSizePolicy hmodest = TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding);
+ TQSizePolicy vmodest = TQSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred);
+ TQSizePolicy vfixed = TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed);
+ TQSizePolicy modest = TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Preferred);
+ TQSizePolicy greedy = TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding);
+
+ m_vertSplitter = new TQSplitter(Qt::Vertical, this);
m_vertSplitter->setOpaqueResize(KGlobalSettings::opaqueResize());
- QWidget* topicWidget = new QWidget(m_vertSplitter);
- m_vertSplitter->setResizeMode(topicWidget,QSplitter::KeepSize);
+ TQWidget* topicWidget = new TQWidget(m_vertSplitter);
+ m_vertSplitter->setResizeMode(topicWidget,TQSplitter::KeepSize);
- QGridLayout* topicLayout = new QGridLayout(topicWidget, 2, 3, 0, 0);
+ TQGridLayout* topicLayout = new TQGridLayout(topicWidget, 2, 3, 0, 0);
- m_topicButton = new QToolButton(topicWidget);
+ m_topicButton = new TQToolButton(topicWidget);
m_topicButton->setIconSet(SmallIconSet("edit", 16));
- QToolTip::add(m_topicButton, i18n("Edit Channel Settings"));
- connect(m_topicButton, SIGNAL(clicked()), this, SLOT(showOptionsDialog()));
+ TQToolTip::add(m_topicButton, i18n("Edit Channel Settings"));
+ connect(m_topicButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(showOptionsDialog()));
topicLine = new Konversation::TopicLabel(topicWidget);
- QWhatsThis::add(topicLine, i18n("<qt>Every channel on IRC has a topic associated with it. This is simply a message that everybody can see.<p>If you are an operator, or the channel mode <em>'T'</em> has not been set, then you can change the topic by clicking the Edit Channel Properties button to the left of the topic. You can also view the history of topics there.</qt>"));
- connect(topicLine, SIGNAL(setStatusBarTempText(const QString&)), this, SIGNAL(setStatusBarTempText(const QString&)));
- connect(topicLine, SIGNAL(clearStatusBarTempText()), this, SIGNAL(clearStatusBarTempText()));
- connect(topicLine,SIGNAL(popupCommand(int)),this,SLOT(popupChannelCommand(int)));
+ TQWhatsThis::add(topicLine, i18n("<qt>Every channel on IRC has a topic associated with it. This is simply a message that everybody can see.<p>If you are an operator, or the channel mode <em>'T'</em> has not been set, then you can change the topic by clicking the Edit Channel Properties button to the left of the topic. You can also view the history of topics there.</qt>"));
+ connect(topicLine, TQT_SIGNAL(setStatusBarTempText(const TQString&)), this, TQT_SIGNAL(setStatusBarTempText(const TQString&)));
+ connect(topicLine, TQT_SIGNAL(clearStatusBarTempText()), this, TQT_SIGNAL(clearStatusBarTempText()));
+ connect(topicLine,TQT_SIGNAL(popupCommand(int)),this,TQT_SLOT(popupChannelCommand(int)));
topicLayout->addWidget(m_topicButton, 0, 0);
topicLayout->addMultiCellWidget(topicLine, 0, 1, 1, 1);
// The box holding the channel modes
- modeBox = new QHBox(topicWidget);
+ modeBox = new TQHBox(topicWidget);
modeBox->setSizePolicy(hfixed);
modeT = new ModeButton("T",modeBox,0);
modeN = new ModeButton("N",modeBox,1);
@@ -149,29 +149,29 @@ Channel::Channel(QWidget* parent, QString _name) : ChatWindow(parent)
modeK = new ModeButton("K",modeBox,6);
modeL = new ModeButton("L",modeBox,7);
- QWhatsThis::add(modeT, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p>The <b>T</b>opic mode means that only the channel operator can change the topic for the channel.</qt>"));
- QWhatsThis::add(modeN, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p><b>N</b>o messages from outside means that users that are not in the channel cannot send messages that everybody in the channel can see. Almost all channels have this set to prevent nuisance messages.</qt>"));
- QWhatsThis::add(modeS, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p>A <b>S</b>ecret channel will not show up in the channel list, nor will any user be able to see that you are in the channel with the <em>WHOIS</em> command or anything similar. Only the people that are in the same channel will know that you are in this channel, if this mode is set.</qt>"));
- QWhatsThis::add(modeI, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p>An <b>I</b>nvite only channel means that people can only join the channel if they are invited. To invite someone, a channel operator needs to issue the command <em>/invite nick</em> from within the channel.</qt>"));
- QWhatsThis::add(modeP, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p>A <b>P</b>rivate channel is shown in a listing of all channels, but the topic is not shown. A user's <em>WHOIS</e> may or may not show them as being in a private channel depending on the IRC server.</qt>"));
- QWhatsThis::add(modeM, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p>A <b>M</b>oderated channel is one where only operators, half-operators and those with voice can talk.</qt>"));
- QWhatsThis::add(modeK, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p>A <b>P</b>rotected channel requires users to enter a password in order to join.</qt>"));
- QWhatsThis::add(modeL, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p>A channel that has a user <b>L</b>imit means that only that many users can be in the channel at any one time. Some channels have a bot that sits in the channel and changes this automatically depending on how busy the channel is.</qt>"));
-
- connect(modeT,SIGNAL(clicked(int,bool)),this,SLOT(modeButtonClicked(int,bool)));
- connect(modeN,SIGNAL(clicked(int,bool)),this,SLOT(modeButtonClicked(int,bool)));
- connect(modeS,SIGNAL(clicked(int,bool)),this,SLOT(modeButtonClicked(int,bool)));
- connect(modeI,SIGNAL(clicked(int,bool)),this,SLOT(modeButtonClicked(int,bool)));
- connect(modeP,SIGNAL(clicked(int,bool)),this,SLOT(modeButtonClicked(int,bool)));
- connect(modeM,SIGNAL(clicked(int,bool)),this,SLOT(modeButtonClicked(int,bool)));
- connect(modeK,SIGNAL(clicked(int,bool)),this,SLOT(modeButtonClicked(int,bool)));
- connect(modeL,SIGNAL(clicked(int,bool)),this,SLOT(modeButtonClicked(int,bool)));
+ TQWhatsThis::add(modeT, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p>The <b>T</b>opic mode means that only the channel operator can change the topic for the channel.</qt>"));
+ TQWhatsThis::add(modeN, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p><b>N</b>o messages from outside means that users that are not in the channel cannot send messages that everybody in the channel can see. Almost all channels have this set to prevent nuisance messages.</qt>"));
+ TQWhatsThis::add(modeS, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p>A <b>S</b>ecret channel will not show up in the channel list, nor will any user be able to see that you are in the channel with the <em>WHOIS</em> command or anything similar. Only the people that are in the same channel will know that you are in this channel, if this mode is set.</qt>"));
+ TQWhatsThis::add(modeI, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p>An <b>I</b>nvite only channel means that people can only join the channel if they are invited. To invite someone, a channel operator needs to issue the command <em>/invite nick</em> from within the channel.</qt>"));
+ TQWhatsThis::add(modeP, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p>A <b>P</b>rivate channel is shown in a listing of all channels, but the topic is not shown. A user's <em>WHOIS</e> may or may not show them as being in a private channel depending on the IRC server.</qt>"));
+ TQWhatsThis::add(modeM, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p>A <b>M</b>oderated channel is one where only operators, half-operators and those with voice can talk.</qt>"));
+ TQWhatsThis::add(modeK, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p>A <b>P</b>rotected channel requires users to enter a password in order to join.</qt>"));
+ TQWhatsThis::add(modeL, i18n("<qt>These control the <em>mode</em> of the channel. Only an operator can change these.<p>A channel that has a user <b>L</b>imit means that only that many users can be in the channel at any one time. Some channels have a bot that sits in the channel and changes this automatically depending on how busy the channel is.</qt>"));
+
+ connect(modeT,TQT_SIGNAL(clicked(int,bool)),this,TQT_SLOT(modeButtonClicked(int,bool)));
+ connect(modeN,TQT_SIGNAL(clicked(int,bool)),this,TQT_SLOT(modeButtonClicked(int,bool)));
+ connect(modeS,TQT_SIGNAL(clicked(int,bool)),this,TQT_SLOT(modeButtonClicked(int,bool)));
+ connect(modeI,TQT_SIGNAL(clicked(int,bool)),this,TQT_SLOT(modeButtonClicked(int,bool)));
+ connect(modeP,TQT_SIGNAL(clicked(int,bool)),this,TQT_SLOT(modeButtonClicked(int,bool)));
+ connect(modeM,TQT_SIGNAL(clicked(int,bool)),this,TQT_SLOT(modeButtonClicked(int,bool)));
+ connect(modeK,TQT_SIGNAL(clicked(int,bool)),this,TQT_SLOT(modeButtonClicked(int,bool)));
+ connect(modeL,TQT_SIGNAL(clicked(int,bool)),this,TQT_SLOT(modeButtonClicked(int,bool)));
limit=new KLineEdit(modeBox);
- QToolTip::add(limit, i18n("Maximum users allowed in channel"));
- QWhatsThis::add(limit, i18n("<qt>This is the channel user limit - the maximum number of users that can be in the channel at a time. If you are an operator, you can set this. The channel mode <b>T</b>opic (button to left) will automatically be set if set this.</qt>"));
- connect(limit,SIGNAL (returnPressed()),this,SLOT (channelLimitChanged()) );
- connect(limit,SIGNAL (lostFocus()), this, SLOT(channelLimitChanged()) );
+ TQToolTip::add(limit, i18n("Maximum users allowed in channel"));
+ TQWhatsThis::add(limit, i18n("<qt>This is the channel user limit - the maximum number of users that can be in the channel at a time. If you are an operator, you can set this. The channel mode <b>T</b>opic (button to left) will automatically be set if set this.</qt>"));
+ connect(limit,TQT_SIGNAL (returnPressed()),this,TQT_SLOT (channelLimitChanged()) );
+ connect(limit,TQT_SIGNAL (lostFocus()), this, TQT_SLOT(channelLimitChanged()) );
topicLayout->addWidget(modeBox, 0, 2);
topicLayout->setRowStretch(1, 10);
@@ -181,27 +181,27 @@ Channel::Channel(QWidget* parent, QString _name) : ChatWindow(parent)
showModeButtons(Preferences::showModeButtons());
// (this) The main Box, holding the channel view/topic and the input line
- m_horizSplitter = new QSplitter(m_vertSplitter);
+ m_horizSplitter = new TQSplitter(m_vertSplitter);
m_horizSplitter->setOpaqueResize( KGlobalSettings::opaqueResize() );
// Server will be set later in setServer()
IRCViewBox* ircViewBox = new IRCViewBox(m_horizSplitter, NULL);
setTextView(ircViewBox->ircView());
- connect(textView,SIGNAL(popupCommand(int)),this,SLOT(popupChannelCommand(int)));
- connect(topicLine, SIGNAL(currentChannelChanged(const QString&)),textView,SLOT(setCurrentChannel(const QString&)));
+ connect(textView,TQT_SIGNAL(popupCommand(int)),this,TQT_SLOT(popupChannelCommand(int)));
+ connect(topicLine, TQT_SIGNAL(currentChannelChanged(const TQString&)),textView,TQT_SLOT(setCurrentChannel(const TQString&)));
// The box that holds the Nick List and the quick action buttons
- nickListButtons = new QVBox(m_horizSplitter);
- m_horizSplitter->setResizeMode(nickListButtons,QSplitter::KeepSize);
+ nickListButtons = new TQVBox(m_horizSplitter);
+ m_horizSplitter->setResizeMode(nickListButtons,TQSplitter::KeepSize);
nickListButtons->setSpacing(spacing());
nicknameListView=new NickListView(nickListButtons, this);
- nicknameListView->setHScrollBarMode(QScrollView::AlwaysOff);
+ nicknameListView->setHScrollBarMode(TQScrollView::AlwaysOff);
nicknameListView->setSelectionModeExt(KListView::Extended);
nicknameListView->setAllColumnsShowFocus(true);
nicknameListView->setSorting(1,true);
- nicknameListView->addColumn(QString());
- nicknameListView->addColumn(QString());
+ nicknameListView->addColumn(TQString());
+ nicknameListView->addColumn(TQString());
nicknameListView->setColumnWidthMode(1,KListView::Maximum);
nicknameListView->header()->hide();
@@ -219,18 +219,18 @@ Channel::Channel(QWidget* parent, QString _name) : ChatWindow(parent)
buttonsGrid=0;
// The box holding the Nickname button and Channel input
- commandLineBox = new QHBox(this);
+ commandLineBox = new TQHBox(this);
commandLineBox->setSpacing(spacing());
- nicknameCombobox = new QComboBox(commandLineBox);
+ nicknameCombobox = new TQComboBox(commandLineBox);
nicknameCombobox->setEditable(true);
nicknameCombobox->insertStringList(Preferences::nicknameList());
- QWhatsThis::add(nicknameCombobox, i18n("<qt>This shows your current nick, and any alternatives you have set up. If you select or type in a different nickname, then a request will be sent to the IRC server to change your nick. If the server allows it, the new nickname will be selected. If you type in a new nickname, you need to press 'Enter' at the end.<p>You can add change the alternative nicknames from the <em>Identities</em> option in the <em>File</em> menu.</qt>"));
+ TQWhatsThis::add(nicknameCombobox, i18n("<qt>This shows your current nick, and any alternatives you have set up. If you select or type in a different nickname, then a request will be sent to the IRC server to change your nick. If the server allows it, the new nickname will be selected. If you type in a new nickname, you need to press 'Enter' at the end.<p>You can add change the alternative nicknames from the <em>Identities</em> option in the <em>File</em> menu.</qt>"));
oldNick = nicknameCombobox->currentText();
- awayLabel = new QLabel(i18n("(away)"), commandLineBox);
+ awayLabel = new TQLabel(i18n("(away)"), commandLineBox);
awayLabel->hide();
- blowfishLabel = new QLabel(commandLineBox);
+ blowfishLabel = new TQLabel(commandLineBox);
blowfishLabel->hide();
blowfishLabel->setPixmap(KGlobal::iconLoader()->loadIcon("encrypted", KIcon::Toolbar));
channelInput = new IRCInput(commandLineBox);
@@ -240,8 +240,8 @@ Channel::Channel(QWidget* parent, QString _name) : ChatWindow(parent)
channelInput->installEventFilter(this);
// Set the widgets size policies
- m_topicButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
- topicLine->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum));
+ m_topicButton->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed));
+ topicLine->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Minimum));
commandLineBox->setSizePolicy(vfixed);
@@ -268,57 +268,57 @@ Channel::Channel(QWidget* parent, QString _name) : ChatWindow(parent)
getTextView()->setSizePolicy(greedy);
nicknameListView->setSizePolicy(hmodest);
- connect(channelInput,SIGNAL (submit()),this,SLOT (channelTextEntered()) );
- connect(channelInput,SIGNAL (envelopeCommand()),this,SLOT (channelPassthroughCommand()) );
- connect(channelInput,SIGNAL (nickCompletion()),this,SLOT (completeNick()) );
- connect(channelInput,SIGNAL (endCompletion()),this,SLOT (endCompleteNick()) );
- connect(channelInput,SIGNAL (textPasted(const QString&)),this,SLOT (textPasted(const QString&)) );
+ connect(channelInput,TQT_SIGNAL (submit()),this,TQT_SLOT (channelTextEntered()) );
+ connect(channelInput,TQT_SIGNAL (envelopeCommand()),this,TQT_SLOT (channelPassthroughCommand()) );
+ connect(channelInput,TQT_SIGNAL (nickCompletion()),this,TQT_SLOT (completeNick()) );
+ connect(channelInput,TQT_SIGNAL (endCompletion()),this,TQT_SLOT (endCompleteNick()) );
+ connect(channelInput,TQT_SIGNAL (textPasted(const TQString&)),this,TQT_SLOT (textPasted(const TQString&)) );
- connect(getTextView(), SIGNAL(textPasted(bool)), channelInput, SLOT(paste(bool)));
- connect(getTextView(),SIGNAL (gotFocus()),channelInput,SLOT (setFocus()) );
- connect(getTextView(),SIGNAL (sendFile()),this,SLOT (sendFileMenu()) );
- connect(getTextView(),SIGNAL (autoText(const QString&)),this,SLOT (sendChannelText(const QString&)) );
+ connect(getTextView(), TQT_SIGNAL(textPasted(bool)), channelInput, TQT_SLOT(paste(bool)));
+ connect(getTextView(),TQT_SIGNAL (gotFocus()),channelInput,TQT_SLOT (setFocus()) );
+ connect(getTextView(),TQT_SIGNAL (sendFile()),this,TQT_SLOT (sendFileMenu()) );
+ connect(getTextView(),TQT_SIGNAL (autoText(const TQString&)),this,TQT_SLOT (sendChannelText(const TQString&)) );
- connect(nicknameListView,SIGNAL (popupCommand(int)),this,SLOT (popupCommand(int)) );
- connect(nicknameListView,SIGNAL (doubleClicked(QListViewItem*)),this,SLOT (doubleClickCommand(QListViewItem*)) );
- connect(nicknameListView,SIGNAL (dropped(QDropEvent*,QListViewItem*)),this,SLOT (filesDropped(QDropEvent*)) );
- connect(nicknameCombobox,SIGNAL (activated(int)),this,SLOT(nicknameComboboxChanged()));
+ connect(nicknameListView,TQT_SIGNAL (popupCommand(int)),this,TQT_SLOT (popupCommand(int)) );
+ connect(nicknameListView,TQT_SIGNAL (doubleClicked(TQListViewItem*)),this,TQT_SLOT (doubleClickCommand(TQListViewItem*)) );
+ connect(nicknameListView,TQT_SIGNAL (dropped(TQDropEvent*,TQListViewItem*)),this,TQT_SLOT (filesDropped(TQDropEvent*)) );
+ connect(nicknameCombobox,TQT_SIGNAL (activated(int)),this,TQT_SLOT(nicknameComboboxChanged()));
if(nicknameCombobox->lineEdit())
- connect(nicknameCombobox->lineEdit(), SIGNAL (lostFocus()),this,SLOT(nicknameComboboxChanged()));
+ connect(nicknameCombobox->lineEdit(), TQT_SIGNAL (lostFocus()),this,TQT_SLOT(nicknameComboboxChanged()));
nicknameList.setAutoDelete(true);
setLog(Preferences::log());
- connect(&userhostTimer,SIGNAL (timeout()),this,SLOT (autoUserhost()));
+ connect(&userhostTimer,TQT_SIGNAL (timeout()),this,TQT_SLOT (autoUserhost()));
// every few seconds try to get more userhosts
userhostTimer.start(10000);
- connect(&m_whoTimer,SIGNAL (timeout()),this,SLOT (autoWho()));
+ connect(&m_whoTimer,TQT_SIGNAL (timeout()),this,TQT_SLOT (autoWho()));
// every 5 minutes decrease everyone's activity by 1 unit
m_fadeActivityTimer.start(5*60*1000);
- connect(&m_fadeActivityTimer, SIGNAL(timeout()), this, SLOT(fadeActivity()));
+ connect(&m_fadeActivityTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(fadeActivity()));
// re-schedule when the settings were changed
- connect(Preferences::self(), SIGNAL (autoContinuousWhoChanged()),this,SLOT (scheduleAutoWho()));
+ connect(Preferences::self(), TQT_SIGNAL (autoContinuousWhoChanged()),this,TQT_SLOT (scheduleAutoWho()));
updateAppearance();
//FIXME JOHNFLUX
- // connect( Konversation::Addressbook::self()->getAddressBook(), SIGNAL( addressBookChanged( AddressBook * ) ), this, SLOT( slotLoadAddressees() ) );
- // connect( Konversation::Addressbook::self(), SIGNAL(addresseesChanged()), this, SLOT(slotLoadAddressees()));
+ // connect( Konversation::Addressbook::self()->getAddressBook(), TQT_SIGNAL( addressBookChanged( AddressBook * ) ), this, TQT_SLOT( slotLoadAddressees() ) );
+ // connect( Konversation::Addressbook::self(), TQT_SIGNAL(addresseesChanged()), this, TQT_SLOT(slotLoadAddressees()));
}
//FIXME there is some logic in setLogfileName that needs to be split out and called here if the server display name gets changed
void Channel::setServer(Server* server)
{
if (m_server != server)
- connect(server, SIGNAL(connectionStateChanged(Server*, Konversation::ConnectionState)),
- SLOT(connectionStateChanged(Server*, Konversation::ConnectionState)));
+ connect(server, TQT_SIGNAL(connectionStateChanged(Server*, Konversation::ConnectionState)),
+ TQT_SLOT(connectionStateChanged(Server*, Konversation::ConnectionState)));
ChatWindow::setServer(server);
if (server->getKeyForRecipient(getName()))
blowfishLabel->show();
@@ -347,14 +347,14 @@ void Channel::setEncryptedOutput(bool e)
if (e) {
blowfishLabel->show();
//scan the channel topic and decrypt it if necessary
- QString topic(m_topicHistory[0].section(' ',2));
+ TQString topic(m_topicHistory[0].section(' ',2));
//prepend two colons to make it appear to be an irc message for decryption,
// \r because it won't decrypt without it, even though the message did not have a \r
// when encrypted. Bring on the QCA!
- QCString cipher="::"+topic.utf8()+'\x0d';
+ TQCString cipher="::"+topic.utf8()+'\x0d';
Konversation::decryptTopic(getName(), cipher, m_server);
- topic=QString::fromUtf8(cipher.data()+2, cipher.length()-2);
+ topic=TQString::fromUtf8(cipher.data()+2, cipher.length()-2);
m_topicHistory[0] = m_topicHistory[0].section(' ', 0, 1) + ' ' + topic;
topicLine->setText(topic);
emit topicHistoryChanged();
@@ -396,7 +396,7 @@ ChannelNickPtr Channel::getOwnChannelNick()
return m_ownChannelNick;
}
-ChannelNickPtr Channel::getChannelNick(const QString &ircnick)
+ChannelNickPtr Channel::getChannelNick(const TQString &ircnick)
{
return m_server->getChannelNick(getName(), ircnick);
}
@@ -421,25 +421,25 @@ void Channel::showOptionsDialog()
m_optionsDialog->show();
}
-void Channel::filesDropped(QDropEvent* e)
+void Channel::filesDropped(TQDropEvent* e)
{
- QPoint p(nicknameListView->contentsToViewport(e->pos()));
+ TQPoint p(nicknameListView->contentsToViewport(e->pos()));
Nick* it = dynamic_cast<Nick*>(nicknameListView->itemAt(p));
if (!it) return;
- QStrList uris;
- if (QUriDrag::decode(e,uris))
+ TQStrList uris;
+ if (TQUriDrag::decode(e,uris))
m_server->sendURIs(uris, it->getChannelNick()->getNickname());
}
-void Channel::textPasted(const QString& text)
+void Channel::textPasted(const TQString& text)
{
if(m_server)
{
- QStringList multiline=QStringList::split('\n',text);
+ TQStringList multiline=TQStringList::split('\n',text);
for(unsigned int index=0;index<multiline.count();index++)
{
- QString line=multiline[index];
- QString cChar(Preferences::commandChar());
+ TQString line=multiline[index];
+ TQString cChar(Preferences::commandChar());
// make sure that lines starting with command char get escaped
if(line.startsWith(cChar)) line=cChar+line;
sendChannelText(line);
@@ -459,12 +459,12 @@ void Channel::popupChannelCommand(int id)
// Will be connected to NickListView::popupCommand(int)
void Channel::popupCommand(int id)
{
- QString pattern;
- QString cc = Preferences::commandChar();
- QString args;
- QString question;
+ TQString pattern;
+ TQString cc = Preferences::commandChar();
+ TQString args;
+ TQString question;
bool raw=false;
- QStringList nickList = getSelectedNickList();
+ TQStringList nickList = getSelectedNickList();
switch(id)
{
@@ -568,8 +568,8 @@ void Channel::popupCommand(int id)
break;
case Konversation::Ping:
{
- unsigned int time_t = QDateTime::currentDateTime().toTime_t();
- pattern=QString(cc+"CTCP %u PING %1").arg(time_t);
+ unsigned int time_t = TQDateTime::currentDateTime().toTime_t();
+ pattern=TQString(cc+"CTCP %u PING %1").arg(time_t);
}
break;
case Konversation::Kick:
@@ -626,9 +626,9 @@ void Channel::popupCommand(int id)
break;
case Konversation::UnignoreNick:
{
- QStringList selectedIgnoredNicks;
+ TQStringList selectedIgnoredNicks;
- for (QStringList::Iterator it=nickList.begin(); it!=nickList.end(); ++it)
+ for (TQStringList::Iterator it=nickList.begin(); it!=nickList.end(); ++it)
{
if (Preferences::isIgnored((*it)))
selectedIgnoredNicks.append((*it));
@@ -649,7 +649,7 @@ void Channel::popupCommand(int id)
{
if (m_server->getServerGroup())
{
- for (QStringList::Iterator it=nickList.begin(); it!=nickList.end(); ++it)
+ for (TQStringList::Iterator it=nickList.begin(); it!=nickList.end(); ++it)
{
if (!Preferences::isNotify(m_server->getServerGroup()->id(), (*it)))
Preferences::addNotify(m_server->getServerGroup()->id(), (*it));
@@ -663,13 +663,13 @@ void Channel::popupCommand(int id)
{
pattern.replace("%c",getName());
- QString command;
+ TQString command;
if (pattern.contains("%l"))
{
- QStringList list;
+ TQStringList list;
- for (QStringList::Iterator it=nickList.begin(); it!=nickList.end(); ++it)
+ for (TQStringList::Iterator it=nickList.begin(); it!=nickList.end(); ++it)
list.append((*it));
command = pattern.replace("%l", list.join(" "));
@@ -681,9 +681,9 @@ void Channel::popupCommand(int id)
}
else
{
- QStringList patternList = QStringList::split('\n',pattern);
+ TQStringList patternList = TQStringList::split('\n',pattern);
- for (QStringList::Iterator it=nickList.begin(); it!=nickList.end(); ++it)
+ for (TQStringList::Iterator it=nickList.begin(); it!=nickList.end(); ++it)
{
for (unsigned int index = 0; index<patternList.count(); index++)
{
@@ -701,7 +701,7 @@ void Channel::popupCommand(int id)
}
// Will be connected to NickListView::doubleClicked()
-void Channel::doubleClickCommand(QListViewItem* item)
+void Channel::doubleClickCommand(TQListViewItem* item)
{
if(item)
{
@@ -719,8 +719,8 @@ void Channel::completeNick()
channelInput->getCursorPosition(&oldPos,&pos);// oldPos is a dummy here, taking the paragraph parameter
oldPos = channelInput->getOldCursorPosition();
- QString line=channelInput->text();
- QString newLine;
+ TQString line=channelInput->text();
+ TQString newLine;
// Check if completion position is out of range
if(completionPosition >= nicknameList.count()) completionPosition = 0;
@@ -736,7 +736,7 @@ void Channel::completeNick()
// If the cursor is at beginning of line, insert last completion
if(pos == 0 && !channelInput->lastCompletion().isEmpty())
{
- QString addStart(Preferences::nickCompleteSuffixStart());
+ TQString addStart(Preferences::nickCompleteSuffixStart());
newLine = channelInput->lastCompletion() + addStart;
// New cursor position is behind nickname
pos = newLine.length();
@@ -752,7 +752,7 @@ void Channel::completeNick()
// step back to last space or start of line
while(pos && line[pos-1] != ' ') pos--;
// copy search pattern (lowercase)
- QString pattern = line.mid(pos, oldPos - pos);
+ TQString pattern = line.mid(pos, oldPos - pos);
// copy line to newLine-buffer
newLine = line;
@@ -760,13 +760,13 @@ void Channel::completeNick()
if(!pattern.isEmpty())
{
bool complete = false;
- QString foundNick;
+ TQString foundNick;
// try to find matching nickname in list of names
if(Preferences::nickCompletionMode() == 1 ||
Preferences::nickCompletionMode() == 2)
{ // Shell like completion
- QStringList found;
+ TQStringList found;
foundNick = nicknameList.completeNick(pattern, complete, found,
(Preferences::nickCompletionMode() == 2),
Preferences::nickCompletionCaseSensitive());
@@ -775,7 +775,7 @@ void Channel::completeNick()
{
if(Preferences::nickCompletionMode() == 1)
{
- QString nicksFound = found.join(" ");
+ TQString nicksFound = found.join(" ");
appendServerMessage(i18n("Completion"), i18n("Possible completions: %1.").arg(nicksFound));
}
else
@@ -787,7 +787,7 @@ void Channel::completeNick()
else if(Preferences::nickCompletionMode() == 0)
{
if(mode == '\0') {
- QPtrListIterator<Nick> it(nicknameList);
+ TQPtrListIterator<Nick> it(nicknameList);
uint timeStamp = 0;
int listPosition = 0;
Nick* nick = 0;
@@ -811,11 +811,11 @@ void Channel::completeNick()
// remember old nick completion position
unsigned int oldCompletionPosition = completionPosition;
complete = true;
- QString prefixCharacter = Preferences::prefixCharacter();
+ TQString prefixCharacter = Preferences::prefixCharacter();
do
{
- QString lookNick = nicknameList.at(completionPosition)->getChannelNick()->getNickname();
+ TQString lookNick = nicknameList.at(completionPosition)->getChannelNick()->getNickname();
if(!prefixCharacter.isEmpty() && lookNick.contains(prefixCharacter))
{
@@ -854,7 +854,7 @@ void Channel::completeNick()
if(pos && complete)
{
channelInput->setLastCompletion(foundNick);
- QString addMiddle = Preferences::nickCompleteSuffixMiddle();
+ TQString addMiddle = Preferences::nickCompleteSuffixMiddle();
newLine.insert(pos, foundNick + addMiddle);
pos = pos + foundNick.length() + addMiddle.length();
}
@@ -862,7 +862,7 @@ void Channel::completeNick()
else if(complete)
{
channelInput->setLastCompletion(foundNick);
- QString addStart = Preferences::nickCompleteSuffixStart();
+ TQString addStart = Preferences::nickCompleteSuffixStart();
newLine.insert(pos, foundNick + addStart);
pos = pos + foundNick.length() + addStart.length();
}
@@ -891,7 +891,7 @@ void Channel::endCompleteNick()
else completionPosition=nicknameList.count()-1;
}
-void Channel::setName(const QString& newName)
+void Channel::setName(const TQString& newName)
{
ChatWindow::setName(newName);
setLogfileName(newName.lower());
@@ -915,13 +915,13 @@ void Channel::setAutoJoin(bool autojoin)
{
Konversation::ChannelSettings before;
- QPtrList<Channel> channelList = m_server->getChannelList();
+ TQPtrList<Channel> channelList = m_server->getChannelList();
if (channelList.count() > 1)
{
- QPtrListIterator<Channel> it(channelList);
+ TQPtrListIterator<Channel> it(channelList);
Channel* channel;
- QMap<int, Channel*> channelMap;
+ TQMap<int, Channel*> channelMap;
int index = -1;
int ownIndex = m_server->getViewContainer()->getViewIndex(this);
@@ -937,7 +937,7 @@ void Channel::setAutoJoin(bool autojoin)
if (channelMap.count())
{
- QMap<int, Channel*>::Iterator it2;
+ TQMap<int, Channel*>::Iterator it2;
for (it2 = channelMap.begin(); it2 != channelMap.end(); ++it2)
{
@@ -965,11 +965,11 @@ void Channel::setAutoJoin(bool autojoin)
-QString Channel::getPassword()
+TQString Channel::getPassword()
{
- QString password;
+ TQString password;
- for (QStringList::const_iterator it = m_modeList.begin(); it != m_modeList.end(); ++it)
+ for (TQStringList::const_iterator it = m_modeList.begin(); it != m_modeList.end(); ++it)
{
if ((*it)[0] == 'k') password = (*it).mid(1);
}
@@ -995,7 +995,7 @@ void Channel::sendFileMenu()
void Channel::channelTextEntered()
{
- QString line = channelInput->text();
+ TQString line = channelInput->text();
channelInput->setText ("");
if(line.lower().stripWhiteSpace() == Preferences::commandChar()+"clear")
@@ -1015,8 +1015,8 @@ void Channel::channelTextEntered()
void Channel::channelPassthroughCommand()
{
- QString commandChar = Preferences::commandChar();
- QString line = channelInput->text();
+ TQString commandChar = Preferences::commandChar();
+ TQString line = channelInput->text();
channelInput->setText("");
@@ -1031,22 +1031,22 @@ void Channel::channelPassthroughCommand()
}
}
-void Channel::sendChannelText(const QString& sendLine)
+void Channel::sendChannelText(const TQString& sendLine)
{
// create a work copy
- QString outputAll(sendLine);
+ TQString outputAll(sendLine);
// replace aliases and wildcards
if(m_server->getOutputFilter()->replaceAliases(outputAll))
{
outputAll = m_server->parseWildcards(outputAll,m_server->getNickname(),getName(),getPassword(),
- getSelectedNickList(),QString());
+ getSelectedNickList(),TQString());
}
// Send all strings, one after another
- QStringList outList=QStringList::split(QRegExp("[\r\n]+"),outputAll);
+ TQStringList outList=TQStringList::split(TQRegExp("[\r\n]+"),outputAll);
for(unsigned int index=0;index<outList.count();index++)
{
- QString output(outList[index]);
+ TQString output(outList[index]);
// encoding stuff is done in Server()
Konversation::OutputFilterResult result = m_server->getOutputFilter()->parse(m_server->getNickname(),output,getName());
@@ -1063,7 +1063,7 @@ void Channel::sendChannelText(const QString& sendLine)
else if (result.outputList.count())
{
Q_ASSERT(result.type==Konversation::Message);
- for ( QStringList::Iterator it = result.outputList.begin(); it != result.outputList.end(); ++it )
+ for ( TQStringList::Iterator it = result.outputList.begin(); it != result.outputList.end(); ++it )
{
append(m_server->getNickname(), *it);
}
@@ -1080,14 +1080,14 @@ void Channel::sendChannelText(const QString& sendLine)
} // for
}
-void Channel::setNickname(const QString& newNickname)
+void Channel::setNickname(const TQString& newNickname)
{
nicknameCombobox->setCurrentText(newNickname);
}
-QStringList Channel::getSelectedNickList()
+TQStringList Channel::getSelectedNickList()
{
- QStringList result;
+ TQStringList result;
if (channelCommand)
result.append(textView->getContextNick());
@@ -1140,14 +1140,14 @@ void Channel::channelLimitChanged()
void Channel::modeButtonClicked(int id, bool on)
{
char mode[]={'t','n','s','i','p','m','k','l'};
- QString command("MODE %1 %2%3 %4");
- QString args = getPassword();
+ TQString command("MODE %1 %2%3 %4");
+ TQString args = getPassword();
if (mode[id] == 'k')
{
if (args.isEmpty())
{
- QCString newPassword;
+ TQCString newPassword;
int result = KPasswordDialog::getPassword(newPassword, i18n("Channel Password"));
@@ -1177,10 +1177,10 @@ void Channel::modeButtonClicked(int id, bool on)
m_server->queue(command.arg(getName()).arg((on) ? "+" : "-").arg(mode[id]).arg(args));
}
-void Channel::quickButtonClicked(const QString &buttonText)
+void Channel::quickButtonClicked(const TQString &buttonText)
{
// parse wildcards (toParse,nickname,channelName,nickList,queryName,parameter)
- QString out=m_server->parseWildcards(buttonText,m_server->getNickname(),getName(),getPassword(),getSelectedNickList(),QString());
+ TQString out=m_server->parseWildcards(buttonText,m_server->getNickname(),getName(),getPassword(),getSelectedNickList(),TQString());
// are there any newlines in the definition?
if(out.find('\n')!=-1)
@@ -1193,11 +1193,11 @@ void Channel::quickButtonClicked(const QString &buttonText)
void Channel::addNickname(ChannelNickPtr channelnick)
{
- QString nickname = channelnick->loweredNickname();
+ TQString nickname = channelnick->loweredNickname();
Nick* nick=0;
Nick* lookNick;
- QPtrListIterator<Nick> it(nicknameList);
+ TQPtrListIterator<Nick> it(nicknameList);
while((lookNick = it.current()) != 0)
{
@@ -1238,11 +1238,11 @@ void Channel::fastAddNickname(ChannelNickPtr channelnick)
nicknameList.append(nick);
}
-void Channel::nickRenamed(const QString &oldNick, const NickInfo& nickInfo)
+void Channel::nickRenamed(const TQString &oldNick, const NickInfo& nickInfo)
{
/* Did we change our nick name? */
- QString newNick = nickInfo.getNickname();
+ TQString newNick = nickInfo.getNickname();
if(newNick == m_server->getNickname()) /* Check newNick because m_server->getNickname() is already updated to new nick */
{
@@ -1268,7 +1268,7 @@ void Channel::joinNickname(ChannelNickPtr channelNick)
appendCommandMessage(i18n("Join"),i18n("%1 is the channel and %2 is our hostmask",
"You have joined the channel %1 (%2).").arg(getName()).arg(channelNick->getHostmask()),false, false, true);
m_ownChannelNick = channelNick;
- connect(m_ownChannelNick, SIGNAL(channelNickChanged()), SLOT(refreshModeButtons()));
+ connect(m_ownChannelNick, TQT_SIGNAL(channelNickChanged()), TQT_SLOT(refreshModeButtons()));
refreshModeButtons();
setActive(true);
@@ -1280,22 +1280,22 @@ void Channel::joinNickname(ChannelNickPtr channelNick)
}
else
{
- QString nick = channelNick->getNickname();
- QString hostname = channelNick->getHostmask();
+ TQString nick = channelNick->getNickname();
+ TQString hostname = channelNick->getHostmask();
appendCommandMessage(i18n("Join"), i18n("%1 is the nick joining and %2 the hostmask of that nick",
"%1 has joined this channel (%2).").arg(nick).arg(hostname),false, false);
addNickname(channelNick);
}
}
-void Channel::removeNick(ChannelNickPtr channelNick, const QString &reason, bool quit)
+void Channel::removeNick(ChannelNickPtr channelNick, const TQString &reason, bool quit)
{
- QString displayReason = reason;
+ TQString displayReason = reason;
if(!displayReason.isEmpty())
{
// if the reason contains text markup characters, play it safe and reset all
- if(displayReason.find(QRegExp("[\\0000-\\0037]")) != -1)
+ if(displayReason.find(TQRegExp("[\\0000-\\0037]")) != -1)
displayReason += "\017";
}
@@ -1359,14 +1359,14 @@ void Channel::removeNick(ChannelNickPtr channelNick, const QString &reason, bool
}
}
-void Channel::kickNick(ChannelNickPtr channelNick, const QString &kicker, const QString &reason)
+void Channel::kickNick(ChannelNickPtr channelNick, const TQString &kicker, const TQString &reason)
{
- QString displayReason = reason;
+ TQString displayReason = reason;
if(!displayReason.isEmpty())
{
// if the reason contains text markup characters, play it safe and reset all
- if(displayReason.find(QRegExp("[\\0000-\\0037]")) != -1)
+ if(displayReason.find(TQRegExp("[\\0000-\\0037]")) != -1)
displayReason += "\017";
}
@@ -1450,10 +1450,10 @@ void Channel::kickNick(ChannelNickPtr channelNick, const QString &kicker, const
}
}
-Nick* Channel::getNickByName(const QString &lookname)
+Nick* Channel::getNickByName(const TQString &lookname)
{
- QString lcLookname = lookname.lower();
- QPtrListIterator<Nick> it(nicknameList);
+ TQString lcLookname = lookname.lower();
+ TQPtrListIterator<Nick> it(nicknameList);
while(it.current() != 0)
{
@@ -1502,17 +1502,17 @@ void Channel::adjustOps(int value)
void Channel::emitUpdateInfo()
{
- QString info = getName() + " - ";
+ TQString info = getName() + " - ";
info += i18n("%n nick", "%n nicks", numberOfNicks());
info += i18n(" (%n op)", " (%n ops)", numberOfOps());
emit updateInfo(info);
}
-void Channel::setTopic(const QString &newTopic)
+void Channel::setTopic(const TQString &newTopic)
{
appendCommandMessage(i18n("Topic"), i18n("The channel topic is \"%1\".").arg(newTopic));
- QString topic = Konversation::removeIrcMarkup(newTopic);
+ TQString topic = Konversation::removeIrcMarkup(newTopic);
topicLine->setText(topic);
topicAuthorUnknown=true; // if we only get called with a topic, it was a 332, which usually has a 333 next
@@ -1521,12 +1521,12 @@ void Channel::setTopic(const QString &newTopic)
if(m_topicHistory.first().section(' ', 2) != newTopic)
{
- m_topicHistory.prepend(QString("%1 "+i18n("unknown")+" %2").arg(QDateTime::currentDateTime().toTime_t()).arg(newTopic));
+ m_topicHistory.prepend(TQString("%1 "+i18n("unknown")+" %2").arg(TQDateTime::currentDateTime().toTime_t()).arg(newTopic));
emit topicHistoryChanged();
}
}
-void Channel::setTopic(const QString &nickname, const QString &newTopic) // Overloaded
+void Channel::setTopic(const TQString &nickname, const TQString &newTopic) // Overloaded
{
if(nickname == m_server->getNickname())
{
@@ -1537,43 +1537,43 @@ void Channel::setTopic(const QString &nickname, const QString &newTopic) // Over
appendCommandMessage(i18n("Topic"), i18n("%1 sets the channel topic to \"%2\".").arg(nickname).arg(newTopic));
}
- m_topicHistory.prepend(QString("%1 %2 %3").arg(QDateTime::currentDateTime().toTime_t()).arg(nickname).arg(newTopic));
- QString topic = Konversation::removeIrcMarkup(newTopic);
+ m_topicHistory.prepend(TQString("%1 %2 %3").arg(TQDateTime::currentDateTime().toTime_t()).arg(nickname).arg(newTopic));
+ TQString topic = Konversation::removeIrcMarkup(newTopic);
topicLine->setText(topic);
emit topicHistoryChanged();
}
-QStringList Channel::getTopicHistory()
+TQStringList Channel::getTopicHistory()
{
return m_topicHistory;
}
-QString Channel::getTopic()
+TQString Channel::getTopic()
{
return m_topicHistory[0];
}
-void Channel::setTopicAuthor(const QString& newAuthor, QDateTime time)
+void Channel::setTopicAuthor(const TQString& newAuthor, TQDateTime time)
{
if (time.isNull() || !time.isValid())
- time=QDateTime::currentDateTime();
+ time=TQDateTime::currentDateTime();
if(topicAuthorUnknown)
{
- m_topicHistory[0] = QString("%1").arg(time.toTime_t()) + ' ' + newAuthor + ' ' + m_topicHistory[0].section(' ', 2);
+ m_topicHistory[0] = TQString("%1").arg(time.toTime_t()) + ' ' + newAuthor + ' ' + m_topicHistory[0].section(' ', 2);
topicAuthorUnknown = false;
emit topicHistoryChanged();
}
}
-void Channel::updateMode(const QString& sourceNick, char mode, bool plus, const QString &parameter)
+void Channel::updateMode(const TQString& sourceNick, char mode, bool plus, const TQString &parameter)
{
//Note for future expansion: doing m_server->getChannelNick(getName(), sourceNick); may not return a valid channelNickPtr if the
//mode is updated by the server.
- QString message;
+ TQString message;
ChannelNickPtr parameterChannelNick=m_server->getChannelNick(getName(), parameter);
bool fromMe=false;
@@ -2000,10 +2000,10 @@ void Channel::updateMode(const QString& sourceNick, char mode, bool plus, const
void Channel::clearModeList()
{
- QString k;
+ TQString k;
// Keep channel password in the backing store, for rejoins.
- for (QStringList::const_iterator it = m_modeList.begin(); it != m_modeList.end(); ++it)
+ for (TQStringList::const_iterator it = m_modeList.begin(); it != m_modeList.end(); ++it)
{
if ((*it)[0] == 'k') k = (*it);
}
@@ -2041,7 +2041,7 @@ void Channel::clearModeList()
emit modesChanged();
}
-void Channel::updateModeWidgets(char mode, bool plus, const QString &parameter)
+void Channel::updateModeWidgets(char mode, bool plus, const TQString &parameter)
{
ModeButton* widget=0;
@@ -2063,13 +2063,13 @@ void Channel::updateModeWidgets(char mode, bool plus, const QString &parameter)
if(plus)
{
- m_modeList.append(QString(mode + parameter));
+ m_modeList.append(TQString(mode + parameter));
}
else
{
- QStringList removable = m_modeList.grep(QRegExp(QString("^%1.*").arg(mode)));
+ TQStringList removable = m_modeList.grep(TQRegExp(TQString("^%1.*").arg(mode)));
- for(QStringList::iterator it = removable.begin(); it != removable.end(); ++it)
+ for(TQStringList::iterator it = removable.begin(); it != removable.end(); ++it)
{
m_modeList.remove(m_modeList.find((*it)));
}
@@ -2077,14 +2077,14 @@ void Channel::updateModeWidgets(char mode, bool plus, const QString &parameter)
emit modesChanged();
}
-void Channel::updateQuickButtons(const QStringList &newButtonList)
+void Channel::updateQuickButtons(const TQStringList &newButtonList)
{
// remove quick buttons from memory and GUI
while(buttonList.count())
{
QuickButton* button=buttonList.at(0);
// remove tool tips as well
- QToolTip::remove(button);
+ TQToolTip::remove(button);
buttonList.remove(button);
delete button;
}
@@ -2092,21 +2092,21 @@ void Channel::updateQuickButtons(const QStringList &newButtonList)
if(buttonsGrid)delete buttonsGrid;
// the grid that holds the quick action buttons
- buttonsGrid = new QGrid(2, nickListButtons);
+ buttonsGrid = new TQGrid(2, nickListButtons);
// add new quick buttons
for(unsigned int index=0;index<newButtonList.count();index++)
{
// generate empty buttons first, text will be added later
- QuickButton* quickButton = new QuickButton(QString(), QString(), buttonsGrid);
+ QuickButton* quickButton = new QuickButton(TQString(), TQString(), buttonsGrid);
buttonList.append(quickButton);
- connect(quickButton, SIGNAL(clicked(const QString &)), this, SLOT(quickButtonClicked(const QString &)));
+ connect(quickButton, TQT_SIGNAL(clicked(const TQString &)), this, TQT_SLOT(quickButtonClicked(const TQString &)));
// Get the button definition
- QString buttonText=newButtonList[index];
+ TQString buttonText=newButtonList[index];
// Extract button label
- QString buttonLabel=buttonText.section(',',0,0);
+ TQString buttonLabel=buttonText.section(',',0,0);
// Extract button definition
buttonText=buttonText.section(',',1);
@@ -2114,11 +2114,11 @@ void Channel::updateQuickButtons(const QStringList &newButtonList)
quickButton->setDefinition(buttonText);
// Add tool tips
- QString toolTip=buttonText.replace("&","&amp;").
+ TQString toolTip=buttonText.replace("&","&amp;").
replace("<","&lt;").
replace(">","&gt;");
- QToolTip::add(quickButton,toolTip);
+ TQToolTip::add(quickButton,toolTip);
quickButton->show();
} // for
@@ -2193,7 +2193,7 @@ void Channel::indicateAway(bool show)
}
}
-void Channel::showEvent(QShowEvent*)
+void Channel::showEvent(TQShowEvent*)
{
// If the show quick/mode button settings have changed, apply the changes now
if(quickButtonsChanged)
@@ -2219,8 +2219,8 @@ void Channel::showEvent(QShowEvent*)
void Channel::syncSplitters()
{
- QValueList<int> vertSizes = Preferences::topicSplitterSizes();
- QValueList<int> horizSizes = Preferences::channelSplitterSizes();
+ TQValueList<int> vertSizes = Preferences::topicSplitterSizes();
+ TQValueList<int> horizSizes = Preferences::channelSplitterSizes();
if (vertSizes.isEmpty())
{
@@ -2243,7 +2243,7 @@ void Channel::syncSplitters()
void Channel::updateAppearance()
{
- QColor fg,bg,abg;
+ TQColor fg,bg,abg;
if(Preferences::inputFieldsBackgroundColor())
{
@@ -2276,7 +2276,7 @@ void Channel::updateAppearance()
else
{
getTextView()->setViewBackground(Preferences::color(Preferences::TextViewBackground),
- QString());
+ TQString());
}
if (Preferences::customTextFont())
@@ -2322,7 +2322,7 @@ void Channel::updateAppearance()
void Channel::nicknameComboboxChanged()
{
- QString newNick=nicknameCombobox->currentText();
+ TQString newNick=nicknameCombobox->currentText();
oldNick=m_server->getNickname();
if(oldNick!=newNick)
{
@@ -2333,7 +2333,7 @@ void Channel::nicknameComboboxChanged()
}
}
-void Channel::changeNickname(const QString& newNickname)
+void Channel::changeNickname(const TQString& newNickname)
{
if (!newNickname.isEmpty())
m_server->queue("NICK "+newNickname);
@@ -2345,15 +2345,15 @@ void Channel::resetNickList()
purgeNicks();
}
-void Channel::addPendingNickList(const QStringList& pendingChannelNickList)
+void Channel::addPendingNickList(const TQStringList& pendingChannelNickList)
{
if(pendingChannelNickList.isEmpty())
return;
if (!m_processingTimer)
{
- m_processingTimer = new QTimer(this);
- connect(m_processingTimer, SIGNAL(timeout()), this, SLOT(processPendingNicks()));
+ m_processingTimer = new TQTimer(this);
+ connect(m_processingTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(processPendingNicks()));
}
m_pendingChannelNickLists.append(pendingChannelNickList);
@@ -2390,17 +2390,17 @@ void Channel::refreshModeButtons()
limit->setEnabled(enable);
// Tooltips for the ModeButtons
- QString opOnly;
+ TQString opOnly;
if(!enable) opOnly = i18n("You have to be an operator to change this.");
- QToolTip::add(modeT, i18n("Topic can be changed by channel operator only. %1").arg(opOnly));
- QToolTip::add(modeN, i18n("No messages to channel from clients on the outside. %1").arg(opOnly));
- QToolTip::add(modeS, i18n("Secret channel. %1").arg(opOnly));
- QToolTip::add(modeI, i18n("Invite only channel. %1").arg(opOnly));
- QToolTip::add(modeP, i18n("Private channel. %1").arg(opOnly));
- QToolTip::add(modeM, i18n("Moderated channel. %1").arg(opOnly));
- QToolTip::add(modeK, i18n("Protect channel with a password."));
- QToolTip::add(modeL, i18n("Set user limit to channel."));
+ TQToolTip::add(modeT, i18n("Topic can be changed by channel operator only. %1").arg(opOnly));
+ TQToolTip::add(modeN, i18n("No messages to channel from clients on the outside. %1").arg(opOnly));
+ TQToolTip::add(modeS, i18n("Secret channel. %1").arg(opOnly));
+ TQToolTip::add(modeI, i18n("Invite only channel. %1").arg(opOnly));
+ TQToolTip::add(modeP, i18n("Private channel. %1").arg(opOnly));
+ TQToolTip::add(modeM, i18n("Moderated channel. %1").arg(opOnly));
+ TQToolTip::add(modeK, i18n("Protect channel with a password."));
+ TQToolTip::add(modeL, i18n("Set user limit to channel."));
}
@@ -2416,9 +2416,9 @@ void Channel::autoUserhost()
{
int limit = 5;
- QString nickString;
- QPtrList<Nick> nickList = getNickList();
- QPtrListIterator<Nick> it(nickList);
+ TQString nickString;
+ TQPtrList<Nick> nickList = getNickList();
+ TQPtrListIterator<Nick> it(nickList);
Nick* nick;
while((nick = it.current()) != 0)
@@ -2441,7 +2441,7 @@ void Channel::setAutoUserhost(bool state)
if(state)
{
// we can't have automatic resizing with three columns; the hostname column is too wide
- nicknameListView->setHScrollBarMode(QScrollView::Auto);
+ nicknameListView->setHScrollBarMode(TQScrollView::Auto);
// restart userhost timer
userhostTimer.start(10000);
@@ -2449,12 +2449,12 @@ void Channel::setAutoUserhost(bool state)
if(nicknameListView->columns()==2)
{
// re-add the hostmask column
- nicknameListView->addColumn(QString());
+ nicknameListView->addColumn(TQString());
nicknameListView->setColumnWidthMode(2,KListView::Maximum);
- nicknameListView->setResizeMode(QListView::NoColumn);
+ nicknameListView->setResizeMode(TQListView::NoColumn);
// re-add already known hostmasks
- QListViewItem* item=nicknameListView->itemAtIndex(0);
+ TQListViewItem* item=nicknameListView->itemAtIndex(0);
while(item)
{
Nick* lookNick=getNickByName(item->text(1));
@@ -2467,9 +2467,9 @@ void Channel::setAutoUserhost(bool state)
{
userhostTimer.stop();
if(nicknameListView->columns()==3) nicknameListView->removeColumn(2);
- nicknameListView->setHScrollBarMode(QScrollView::AlwaysOff);
+ nicknameListView->setHScrollBarMode(TQScrollView::AlwaysOff);
// make the nick column resize itself automatically to prevent horizontal scrollbar
- nicknameListView->setResizeMode(QListView::LastColumn);
+ nicknameListView->setResizeMode(TQListView::LastColumn);
}
}
@@ -2496,7 +2496,7 @@ void Channel::autoWho()
void Channel::fadeActivity()
{
- QPtrListIterator<Nick> it( nicknameList );
+ TQPtrListIterator<Nick> it( nicknameList );
Nick *nick;
while ( (nick = it.current()) != 0 ) {
++it;
@@ -2504,7 +2504,7 @@ void Channel::fadeActivity()
}
}
-QString Channel::getTextInLine()
+TQString Channel::getTextInLine()
{
return channelInput->text();
}
@@ -2519,7 +2519,7 @@ bool Channel::searchView()
return true;
}
-void Channel::appendInputText(const QString& s, bool fromCursor)
+void Channel::appendInputText(const TQString& s, bool fromCursor)
{
if(!fromCursor)
{
@@ -2570,7 +2570,7 @@ void Channel::setActive(bool active)
purgeNicks();
getTextView()->setNickAndChannelContextMenusEnabled(false);
nicknameCombobox->setEnabled(false);
- topicLine->setText(QString::null);
+ topicLine->setText(TQString::null);
clearModeList();
clearBanList();
}
@@ -2600,7 +2600,7 @@ void Channel::showTopic(bool show)
void Channel::processPendingNicks()
{
- QString nickname = m_pendingChannelNickLists.first()[m_currentIndex];
+ TQString nickname = m_pendingChannelNickLists.first()[m_currentIndex];
bool admin = false;
bool owner = false;
@@ -2656,17 +2656,17 @@ void Channel::processPendingNicks()
}
}
-void Channel::setChannelEncoding(const QString& encoding) // virtual
+void Channel::setChannelEncoding(const TQString& encoding) // virtual
{
Preferences::setChannelEncoding(m_server->getDisplayName(), getName(), encoding);
}
-QString Channel::getChannelEncoding() // virtual
+TQString Channel::getChannelEncoding() // virtual
{
return Preferences::channelEncoding(m_server->getDisplayName(), getName());
}
-QString Channel::getChannelEncodingDefaultDesc() // virtual
+TQString Channel::getChannelEncodingDefaultDesc() // virtual
{
return i18n("Identity Default ( %1 )").arg(getServer()->getIdentity()->getCodecName());
}
@@ -2701,8 +2701,8 @@ void Channel::requestNickListSort()
{
if(!m_delayedSortTimer)
{
- m_delayedSortTimer = new QTimer(this);
- connect(m_delayedSortTimer, SIGNAL(timeout()), this, SLOT(sortNickList()));
+ m_delayedSortTimer = new TQTimer(this);
+ connect(m_delayedSortTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(sortNickList()));
}
if(!m_delayedSortTimer->isActive())
@@ -2731,9 +2731,9 @@ void Channel::setIdentity(const IdentityPtr identity)
}
}
-bool Channel::eventFilter(QObject* watched, QEvent* e)
+bool Channel::eventFilter(TQObject* watched, TQEvent* e)
{
- if((watched == nicknameListView) && (e->type() == QEvent::Resize) && splittersInitialized && isShown())
+ if((watched == nicknameListView) && (e->type() == TQEvent::Resize) && splittersInitialized && isShown())
{
if (!topicSplitterHidden && !channelSplitterHidden)
{
@@ -2753,9 +2753,9 @@ bool Channel::eventFilter(QObject* watched, QEvent* e)
return ChatWindow::eventFilter(watched, e);
}
-void Channel::addBan(const QString& ban)
+void Channel::addBan(const TQString& ban)
{
- for ( QStringList::Iterator it = m_BanList.begin(); it != m_BanList.end(); ++it )
+ for ( TQStringList::Iterator it = m_BanList.begin(); it != m_BanList.end(); ++it )
{
if ((*it).section(' ', 0, 0) == ban.section(' ', 0, 0))
{
@@ -2771,9 +2771,9 @@ void Channel::addBan(const QString& ban)
emit banAdded(ban);
}
-void Channel::removeBan(const QString& ban)
+void Channel::removeBan(const TQString& ban)
{
- for ( QStringList::Iterator it = m_BanList.begin(); it != m_BanList.end(); ++it )
+ for ( TQStringList::Iterator it = m_BanList.begin(); it != m_BanList.end(); ++it )
{
if ((*it).section(' ', 0, 0) == ban)
{
@@ -2791,13 +2791,13 @@ void Channel::clearBanList()
emit banListCleared();
}
-void Channel::append(const QString& nickname, const QString& message)
+void Channel::append(const TQString& nickname, const TQString& message)
{
if(nickname != getServer()->getNickname()) {
Nick* nick = getNickByName(nickname);
if(nick) {
- nick->getChannelNick()->setTimeStamp(QDateTime::currentDateTime().toTime_t());
+ nick->getChannelNick()->setTimeStamp(TQDateTime::currentDateTime().toTime_t());
}
}
@@ -2805,13 +2805,13 @@ void Channel::append(const QString& nickname, const QString& message)
nickActive(nickname);
}
-void Channel::appendAction(const QString& nickname, const QString& message)
+void Channel::appendAction(const TQString& nickname, const TQString& message)
{
if(nickname != getServer()->getNickname()) {
Nick* nick = getNickByName(nickname);
if(nick) {
- nick->getChannelNick()->setTimeStamp(QDateTime::currentDateTime().toTime_t());
+ nick->getChannelNick()->setTimeStamp(TQDateTime::currentDateTime().toTime_t());
}
}
@@ -2819,7 +2819,7 @@ void Channel::appendAction(const QString& nickname, const QString& message)
nickActive(nickname);
}
-void Channel::nickActive(const QString& nickname) //FIXME reported to crash, can't reproduce
+void Channel::nickActive(const TQString& nickname) //FIXME reported to crash, can't reproduce
{
ChannelNickPtr nick=getChannelNick(nickname);
//XXX Would be nice to know why it can be null here...
@@ -2833,7 +2833,7 @@ void Channel::nickActive(const QString& nickname) //FIXME reported to crash, can
// NickList
//
-NickList::NickList() : QPtrList<Nick>()
+NickList::NickList() : TQPtrList<Nick>()
{
m_compareMethod = NickList::AlphaNumeric;
}
@@ -2844,41 +2844,41 @@ void NickList::setCompareMethod(CompareMethod method)
}
//doesn't the following somehow duplicate NickListViewItem::compare()?
-int NickList::compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2)
+int NickList::compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2)
{
if(m_compareMethod == NickList::TimeStamp) {
int returnValue = static_cast<Nick*>(item2)->getChannelNick()->timeStamp() - static_cast<Nick*>(item1)->getChannelNick()->timeStamp();
if(returnValue == 0) {
- returnValue = QString::compare(static_cast<Nick*>(item1)->getChannelNick()->loweredNickname(),
+ returnValue = TQString::compare(static_cast<Nick*>(item1)->getChannelNick()->loweredNickname(),
static_cast<Nick*>(item2)->getChannelNick()->loweredNickname());
}
return returnValue;
}
- return QString::compare(static_cast<Nick*>(item1)->getChannelNick()->loweredNickname(),
+ return TQString::compare(static_cast<Nick*>(item1)->getChannelNick()->loweredNickname(),
static_cast<Nick*>(item2)->getChannelNick()->loweredNickname());
}
-QString NickList::completeNick(const QString& pattern, bool& complete, QStringList& found,
+TQString NickList::completeNick(const TQString& pattern, bool& complete, TQStringList& found,
bool skipNonAlfaNum, bool caseSensitive)
{
found.clear();
- QString prefix = "^";
- QString newNick;
- QString prefixCharacter = Preferences::prefixCharacter();
+ TQString prefix = "^";
+ TQString newNick;
+ TQString prefixCharacter = Preferences::prefixCharacter();
NickList foundNicks;
foundNicks.setCompareMethod(NickList::TimeStamp);
- if((pattern.find(QRegExp("^(\\d|\\w)")) != -1) && skipNonAlfaNum)
+ if((pattern.find(TQRegExp("^(\\d|\\w)")) != -1) && skipNonAlfaNum)
{
prefix = "^([^\\d\\w]|[\\_]){0,}";
}
- QRegExp regexp(prefix + QRegExp::escape(pattern));
+ TQRegExp regexp(prefix + TQRegExp::escape(pattern));
regexp.setCaseSensitive(caseSensitive);
- QPtrListIterator<Nick> it(*this);
+ TQPtrListIterator<Nick> it(*this);
while(it.current() != 0)
{
@@ -2899,7 +2899,7 @@ QString NickList::completeNick(const QString& pattern, bool& complete, QStringLi
foundNicks.sort();
- QPtrListIterator<Nick> it2(foundNicks);
+ TQPtrListIterator<Nick> it2(foundNicks);
while(it2.current() != 0)
{
@@ -2911,14 +2911,14 @@ QString NickList::completeNick(const QString& pattern, bool& complete, QStringLi
{
bool ok = true;
unsigned int patternLength = pattern.length();
- QString firstNick = found[0];
+ TQString firstNick = found[0];
unsigned int firstNickLength = firstNick.length();
unsigned int foundCount = found.count();
while(ok && ((patternLength) < firstNickLength))
{
++patternLength;
- QStringList tmp = found.grep(firstNick.left(patternLength), caseSensitive);
+ TQStringList tmp = found.grep(firstNick.left(patternLength), caseSensitive);
if(tmp.count() != foundCount)
{
@@ -2936,12 +2936,12 @@ QString NickList::completeNick(const QString& pattern, bool& complete, QStringLi
return found[0];
}
- return QString();
+ return TQString();
}
-bool NickList::containsNick(const QString& nickname)
+bool NickList::containsNick(const TQString& nickname)
{
- QPtrListIterator<Nick> it(*this);
+ TQPtrListIterator<Nick> it(*this);
while (it.current() != 0)
{