diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kopete/protocols/irc/ircchannelcontact.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/irc/ircchannelcontact.cpp')
-rw-r--r-- | kopete/protocols/irc/ircchannelcontact.cpp | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/kopete/protocols/irc/ircchannelcontact.cpp b/kopete/protocols/irc/ircchannelcontact.cpp index cc99acf3..cab2748b 100644 --- a/kopete/protocols/irc/ircchannelcontact.cpp +++ b/kopete/protocols/irc/ircchannelcontact.cpp @@ -37,33 +37,33 @@ #include <kglobal.h> #include <kmessagebox.h> -#include <qtimer.h> +#include <tqtimer.h> //This is the number of nicknames we will process concurrently when joining a channel //Lower numbers ensure less GUI blocking, but take marginally longer to complete. //Higher numbers are absolute fastest, but block GUI until all members are added #define NICK_BATCH_LENGTH 1 -IRCChannelContact::IRCChannelContact(IRCContactManager *contactManager, const QString &channel, Kopete::MetaContact *metac) +IRCChannelContact::IRCChannelContact(IRCContactManager *contactManager, const TQString &channel, Kopete::MetaContact *metac) : IRCContact(contactManager, channel, metac, "irc_channel") { KIRC::Engine *engine = kircEngine(); - mInfoTimer = new QTimer( this ); - QObject::connect(mInfoTimer, SIGNAL(timeout()), this, SLOT( slotUpdateInfo() ) ); + mInfoTimer = new TQTimer( this ); + TQObject::connect(mInfoTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT( slotUpdateInfo() ) ); - QObject::connect(engine, SIGNAL(incomingUserIsAway(const QString &, const QString &)), - this, SLOT(slotIncomingUserIsAway(const QString &, const QString &))); + TQObject::connect(engine, TQT_SIGNAL(incomingUserIsAway(const TQString &, const TQString &)), + this, TQT_SLOT(slotIncomingUserIsAway(const TQString &, const TQString &))); - QObject::connect(engine, SIGNAL(incomingListedChan(const QString &, uint, const QString &)), - this, SLOT(slotChannelListed(const QString &, uint, const QString &))); + TQObject::connect(engine, TQT_SIGNAL(incomingListedChan(const TQString &, uint, const TQString &)), + this, TQT_SLOT(slotChannelListed(const TQString &, uint, const TQString &))); actionJoin = 0L; - actionModeT = new KToggleAction(i18n("Only Operators Can Change &Topic"), 0, this, SLOT(slotModeChanged()), this ); - actionModeN = new KToggleAction(i18n("&No Outside Messages"), 0, this, SLOT(slotModeChanged()), this ); - actionModeS = new KToggleAction(i18n("&Secret"), 0, this, SLOT(slotModeChanged()), this ); - actionModeM = new KToggleAction(i18n("&Moderated"), 0, this, SLOT(slotModeChanged()), this ); - actionModeI = new KToggleAction(i18n("&Invite Only"), 0, this, SLOT(slotModeChanged()), this ); + actionModeT = new KToggleAction(i18n("Only Operators Can Change &Topic"), 0, this, TQT_SLOT(slotModeChanged()), this ); + actionModeN = new KToggleAction(i18n("&No Outside Messages"), 0, this, TQT_SLOT(slotModeChanged()), this ); + actionModeS = new KToggleAction(i18n("&Secret"), 0, this, TQT_SLOT(slotModeChanged()), this ); + actionModeM = new KToggleAction(i18n("&Moderated"), 0, this, TQT_SLOT(slotModeChanged()), this ); + actionModeI = new KToggleAction(i18n("&Invite Only"), 0, this, TQT_SLOT(slotModeChanged()), this ); actionHomePage = 0L; updateStatus(); @@ -78,9 +78,9 @@ void IRCChannelContact::slotUpdateInfo() /** This woudl be nice, but it generates server errors too often if( !manager(Kopete::Contact::CannotCreate) && onlineStatus() == m_protocol->m_ChannelStatusOnline ) - kircEngine()->writeMessage( QString::fromLatin1("LIST %1").arg(m_nickName) ); + kircEngine()->writeMessage( TQString::fromLatin1("LIST %1").arg(m_nickName) ); else - setProperty( QString::fromLatin1("channelMembers"), i18n("Members"), manager()->members().count() ); + setProperty( TQString::fromLatin1("channelMembers"), i18n("Members"), manager()->members().count() ); */ KIRC::Engine *engine = kircEngine(); @@ -88,7 +88,7 @@ void IRCChannelContact::slotUpdateInfo() if (manager(Kopete::Contact::CannotCreate)) { setProperty(m_protocol->propChannelMembers, manager()->members().count()); - engine->writeMessage(QString::fromLatin1("WHO %1").arg(m_nickName)); + engine->writeMessage(TQString::fromLatin1("WHO %1").arg(m_nickName)); } else { @@ -99,7 +99,7 @@ void IRCChannelContact::slotUpdateInfo() mInfoTimer->start( 45000, true ); } -void IRCChannelContact::slotChannelListed( const QString &channel, uint members, const QString &topic ) +void IRCChannelContact::slotChannelListed( const TQString &channel, uint members, const TQString &topic ) { if (!manager(Kopete::Contact::CannotCreate) && onlineStatus() == m_protocol->m_ChannelStatusOnline && @@ -191,7 +191,7 @@ void IRCChannelContact::slotConnectedToServer() kircEngine()->join(m_nickName, password()); } -void IRCChannelContact::namesList(const QStringList &nicknames) +void IRCChannelContact::namesList(const TQStringList &nicknames) { mInfoTimer->stop(); mJoinedNicks += nicknames; @@ -200,7 +200,7 @@ void IRCChannelContact::namesList(const QStringList &nicknames) void IRCChannelContact::endOfNames() { - setMode(QString::null); + setMode(TQString::null); slotUpdateInfo(); } @@ -217,8 +217,8 @@ void IRCChannelContact::slotAddNicknames() { // Pick a nick from the front of the list. - QString nickToAdd = mJoinedNicks.front(); - QChar firstChar = nickToAdd[0]; + TQString nickToAdd = mJoinedNicks.front(); + TQChar firstChar = nickToAdd[0]; if( firstChar == '@' || firstChar == '%' || firstChar == '+' ) nickToAdd = nickToAdd.remove(0, 1); @@ -261,10 +261,10 @@ void IRCChannelContact::slotAddNicknames() mJoinedNicks.pop_front(); } - QTimer::singleShot( 0, this, SLOT( slotAddNicknames() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( slotAddNicknames() ) ); } -void IRCChannelContact::channelTopic(const QString &topic) +void IRCChannelContact::channelTopic(const TQString &topic) { mTopic = topic; setProperty( m_protocol->propChannelTopic, mTopic ); @@ -283,7 +283,7 @@ void IRCChannelContact::channelTopic(const QString &topic) } } -void IRCChannelContact::channelHomePage(const QString &url) +void IRCChannelContact::channelHomePage(const TQString &url) { kdDebug(14120) << k_funcinfo << endl; setProperty( m_protocol->propHomepage, url ); @@ -303,9 +303,9 @@ void IRCChannelContact::join() if (manager()) { connect(manager(), - SIGNAL(onlineStatusChanged(Kopete::Contact *, const Kopete::OnlineStatus &, + TQT_SIGNAL(onlineStatusChanged(Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus &)), - SLOT(slotOnlineStatusChanged(Kopete::Contact *, const Kopete::OnlineStatus &, + TQT_SLOT(slotOnlineStatusChanged(Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus &))); } } @@ -322,7 +322,7 @@ void IRCChannelContact::part() kircEngine()->part(m_nickName, ircAccount()->defaultPart()); } -void IRCChannelContact::slotIncomingUserIsAway( const QString &nick, const QString & ) +void IRCChannelContact::slotIncomingUserIsAway( const TQString &nick, const TQString & ) { IRCAccount *account = ircAccount(); @@ -348,7 +348,7 @@ void IRCChannelContact::slotIncomingUserIsAway( const QString &nick, const QStri } } -void IRCChannelContact::userJoinedChannel(const QString &nickname) +void IRCChannelContact::userJoinedChannel(const TQString &nickname) { IRCAccount *account = ircAccount(); @@ -385,7 +385,7 @@ void IRCChannelContact::userJoinedChannel(const QString &nickname) } } -void IRCChannelContact::userPartedChannel(const QString &nickname,const QString &reason) +void IRCChannelContact::userPartedChannel(const TQString &nickname,const TQString &reason) { IRCAccount *account = ircAccount(); @@ -401,7 +401,7 @@ void IRCChannelContact::userPartedChannel(const QString &nickname,const QString } } -void IRCChannelContact::userKicked(const QString &nick, const QString &nickKicked, const QString &reason) +void IRCChannelContact::userKicked(const TQString &nick, const TQString &nickKicked, const TQString &reason) { IRCAccount *account = ircAccount(); @@ -410,7 +410,7 @@ void IRCChannelContact::userKicked(const QString &nick, const QString &nickKicke Kopete::Contact *c = locateUser( nickKicked ); if (c) { - QString r; + TQString r; if ((reason != nick) && (reason != nickKicked)) { r = i18n( "%1 was kicked by %2. Reason: %3" ).arg(nickKicked, nick, reason); @@ -431,7 +431,7 @@ void IRCChannelContact::userKicked(const QString &nick, const QString &nickKicke } else { - QString r; + TQString r; if ((reason != nick) && (reason != nickKicked)) { r = i18n( "You were kicked from %1 by %2. Reason: %3" ).arg(m_nickName, nickKicked, reason); @@ -444,7 +444,7 @@ void IRCChannelContact::userKicked(const QString &nick, const QString &nickKicke } } -void IRCChannelContact::setTopic(const QString &topic) +void IRCChannelContact::setTopic(const TQString &topic) { IRCAccount *account = ircAccount(); @@ -454,7 +454,7 @@ void IRCChannelContact::setTopic(const QString &topic) m_protocol->m_UserStatusOp || !modeEnabled('t') ) { bool okPressed = true; - QString newTopic = topic; + TQString newTopic = topic; if( newTopic.isNull() ) newTopic = KInputDialog::getText( i18n("New Topic"), i18n("Enter the new topic:"), Kopete::Message::unescape(mTopic), &okPressed, 0L ); @@ -475,7 +475,7 @@ void IRCChannelContact::setTopic(const QString &topic) } } -void IRCChannelContact::topicChanged(const QString &nick, const QString &newtopic) +void IRCChannelContact::topicChanged(const TQString &nick, const TQString &newtopic) { IRCAccount *account = ircAccount(); @@ -489,7 +489,7 @@ void IRCChannelContact::topicChanged(const QString &nick, const QString &newtopi appendMessage(msg); } -void IRCChannelContact::topicUser(const QString &nick, const QDateTime &time) +void IRCChannelContact::topicUser(const TQString &nick, const TQDateTime &time) { IRCAccount *account = ircAccount(); @@ -501,7 +501,7 @@ void IRCChannelContact::topicUser(const QString &nick, const QDateTime &time) appendMessage(msg); } -void IRCChannelContact::incomingModeChange( const QString &nick, const QString &mode ) +void IRCChannelContact::incomingModeChange( const TQString &nick, const TQString &mode ) { Kopete::Message msg(this, mMyself, i18n("%1 sets mode %2 on %3").arg(nick).arg(mode).arg(m_nickName), Kopete::Message::Internal, Kopete::Message::PlainText, CHAT_VIEW); msg.setImportance( Kopete::Message::Low); //set the importance manualy to low @@ -509,7 +509,7 @@ void IRCChannelContact::incomingModeChange( const QString &nick, const QString & bool inParams = false; bool modeEnabled = false; - QString params = QString::null; + TQString params = TQString::null; for( uint i=0; i < mode.length(); i++ ) { switch( mode[i] ) @@ -535,8 +535,8 @@ void IRCChannelContact::incomingModeChange( const QString &nick, const QString & } } -void IRCChannelContact::incomingChannelMode( const QString &mode, - const QString &/*params*/ ) +void IRCChannelContact::incomingChannelMode( const TQString &mode, + const TQString &/*params*/ ) { for( uint i=1; i < mode.length(); i++ ) { @@ -545,7 +545,7 @@ void IRCChannelContact::incomingChannelMode( const QString &mode, } } -void IRCChannelContact::setMode(const QString &mode) +void IRCChannelContact::setMode(const TQString &mode) { if (manager(Kopete::Contact::CannotCreate)) kircEngine()->mode(m_nickName, mode); @@ -586,9 +586,9 @@ void IRCChannelContact::failedChanFull() void IRCChannelContact::failedChankey() { bool ok; - QString diaPassword = KInputDialog::getText( i18n( "IRC Plugin" ), + TQString diaPassword = KInputDialog::getText( i18n( "IRC Plugin" ), i18n( "Please enter key for channel %1: ").arg(m_nickName), - QString::null, + TQString::null, &ok ); if ( !ok ) @@ -600,7 +600,7 @@ void IRCChannelContact::failedChankey() } } -void IRCChannelContact::toggleMode( QChar mode, bool enabled, bool update ) +void IRCChannelContact::toggleMode( TQChar mode, bool enabled, bool update ) { if( manager(Kopete::Contact::CannotCreate) ) { @@ -636,16 +636,16 @@ void IRCChannelContact::toggleMode( QChar mode, bool enabled, bool update ) if( modeMap[mode] != enabled ) { if( enabled ) - setMode( QString::fromLatin1("+") + mode ); + setMode( TQString::fromLatin1("+") + mode ); else - setMode( QString::fromLatin1("-") + mode ); + setMode( TQString::fromLatin1("-") + mode ); } } modeMap[mode] = enabled; } -bool IRCChannelContact::modeEnabled( QChar mode, QString *value ) +bool IRCChannelContact::modeEnabled( TQChar mode, TQString *value ) { if( !value ) return modeMap[mode]; @@ -653,20 +653,20 @@ bool IRCChannelContact::modeEnabled( QChar mode, QString *value ) return false; } -QPtrList<KAction> *IRCChannelContact::customContextMenuActions() +TQPtrList<KAction> *IRCChannelContact::customContextMenuActions() { - QPtrList<KAction> *mCustomActions = new QPtrList<KAction>(); + TQPtrList<KAction> *mCustomActions = new TQPtrList<KAction>(); if( !actionJoin ) { - actionJoin = new KAction(i18n("&Join"), 0, this, SLOT(join()), this, "actionJoin"); - actionPart = new KAction(i18n("&Part"), 0, this, SLOT(partAction()), this, "actionPart"); - actionTopic = new KAction(i18n("Change &Topic..."), 0, this, SLOT(setTopic()), this, "actionTopic"); + actionJoin = new KAction(i18n("&Join"), 0, this, TQT_SLOT(join()), this, "actionJoin"); + actionPart = new KAction(i18n("&Part"), 0, this, TQT_SLOT(partAction()), this, "actionPart"); + actionTopic = new KAction(i18n("Change &Topic..."), 0, this, TQT_SLOT(setTopic()), this, "actionTopic"); actionModeMenu = new KActionMenu(i18n("Channel Modes"), 0, this, "actionModeMenu"); if( !property(m_protocol->propHomepage).value().isNull() ) { actionHomePage = new KAction( i18n("Visit &Homepage"), 0, this, - SLOT(slotHomepage()), this, "actionHomepage"); + TQT_SLOT(slotHomepage()), this, "actionHomepage"); } else if( actionHomePage ) { @@ -681,8 +681,8 @@ QPtrList<KAction> *IRCChannelContact::customContextMenuActions() actionModeMenu->setEnabled( true ); codecAction = new KCodecAction( i18n("&Encoding"), 0, this, "selectcharset" ); - connect( codecAction, SIGNAL( activated( const QTextCodec * ) ), - this, SLOT( setCodec( const QTextCodec *) ) ); + connect( codecAction, TQT_SIGNAL( activated( const TQTextCodec * ) ), + this, TQT_SLOT( setCodec( const TQTextCodec *) ) ); codecAction->setCodec( codec() ); } @@ -708,23 +708,23 @@ QPtrList<KAction> *IRCChannelContact::customContextMenuActions() void IRCChannelContact::slotHomepage() { - QString homePage = property(m_protocol->propHomepage).value().toString(); + TQString homePage = property(m_protocol->propHomepage).value().toString(); if( !homePage.isEmpty() ) { new KRun( KURL( homePage ), 0, false); } } -const QString IRCChannelContact::caption() const +const TQString IRCChannelContact::caption() const { - QString cap = QString::fromLatin1("%1 @ %2").arg(m_nickName).arg(kircEngine()->currentHost()); + TQString cap = TQString::fromLatin1("%1 @ %2").arg(m_nickName).arg(kircEngine()->currentHost()); if(!mTopic.isEmpty()) - cap.append( QString::fromLatin1(" - %1").arg(Kopete::Message::unescape(mTopic)) ); + cap.append( TQString::fromLatin1(" - %1").arg(Kopete::Message::unescape(mTopic)) ); return cap; } -void IRCChannelContact::privateMessage(IRCContact *from, IRCContact *to, const QString &message) +void IRCChannelContact::privateMessage(IRCContact *from, IRCContact *to, const TQString &message) { if(to == this) { @@ -734,7 +734,7 @@ void IRCChannelContact::privateMessage(IRCContact *from, IRCContact *to, const Q } } -void IRCChannelContact::newAction(const QString &from, const QString &action) +void IRCChannelContact::newAction(const TQString &from, const TQString &action) { IRCAccount *account = ircAccount(); |