From 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 22 Jun 2011 00:30:31 +0000 Subject: TQt4 port kdenetwork This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kopete/protocols/irc/ircaccount.cpp | 96 ++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'kopete/protocols/irc/ircaccount.cpp') diff --git a/kopete/protocols/irc/ircaccount.cpp b/kopete/protocols/irc/ircaccount.cpp index 09d0db3c..9dbdfc4a 100644 --- a/kopete/protocols/irc/ircaccount.cpp +++ b/kopete/protocols/irc/ircaccount.cpp @@ -57,11 +57,11 @@ #include #include -const TQString IRCAccount::CONFIG_CODECMIB = TQString::fromLatin1("Codec"); -const TQString IRCAccount::CONFIG_NETWORKNAME = TQString::fromLatin1("NetworkName"); -const TQString IRCAccount::CONFIG_NICKNAME = TQString::fromLatin1("NickName"); -const TQString IRCAccount::CONFIG_USERNAME = TQString::fromLatin1("UserName"); -const TQString IRCAccount::CONFIG_REALNAME = TQString::fromLatin1("RealName"); +const TQString IRCAccount::CONFIG_CODECMIB = TQString::tqfromLatin1("Codec"); +const TQString IRCAccount::CONFIG_NETWORKNAME = TQString::tqfromLatin1("NetworkName"); +const TQString IRCAccount::CONFIG_NICKNAME = TQString::tqfromLatin1("NickName"); +const TQString IRCAccount::CONFIG_USERNAME = TQString::tqfromLatin1("UserName"); +const TQString IRCAccount::CONFIG_REALNAME = TQString::tqfromLatin1("RealName"); IRCAccount::IRCAccount(IRCProtocol *protocol, const TQString &accountId, const TQString &autoChan, const TQString& netName, const TQString &nickName) : Kopete::PasswordedAccount(protocol, accountId, 0, true), autoConnect( autoChan ), commandSource(0) @@ -79,7 +79,7 @@ IRCAccount::IRCAccount(IRCProtocol *protocol, const TQString &accountId, const T for( TQMap< TQString, TQString >::ConstIterator it = replies.begin(); it != replies.end(); ++it ) m_engine->addCustomCtcp( it.key(), it.data() ); - TQString version=i18n("Kopete IRC Plugin %1 [http://kopete.kde.org]").arg(kapp->aboutData()->version()); + TQString version=i18n("Kopete IRC Plugin %1 [http://kopete.kde.org]").tqarg(kapp->aboutData()->version()); m_engine->setVersionString( version ); TQObject::connect(m_engine, TQT_SIGNAL(successfullyChangedNick(const TQString &, const TQString &)), @@ -100,8 +100,8 @@ IRCAccount::IRCAccount(IRCProtocol *protocol, const TQString &accountId, const T TQObject::connect(m_engine, TQT_SIGNAL(incomingCtcpReply(const TQString &, const TQString &, const TQString &)), this, TQT_SLOT( slotNewCtcpReply(const TQString&, const TQString &, const TQString &))); - TQObject::connect(m_engine, TQT_SIGNAL(statusChanged(KIRC::Engine::Status)), - this, TQT_SLOT(engineStatusChanged(KIRC::Engine::Status))); + TQObject::connect(m_engine, TQT_SIGNAL(statusChanged(KIRC::Engine::tqStatus)), + this, TQT_SLOT(engineStatusChanged(KIRC::Engine::tqStatus))); TQObject::connect(m_engine, TQT_SIGNAL(incomingServerLoadTooHigh()), this, TQT_SLOT(slotServerBusy())); @@ -173,7 +173,7 @@ IRCAccount::IRCAccount(IRCProtocol *protocol, const TQString &accountId, const T /* Could not find this host. Add it to the networks structure */ m_network = new IRCNetwork; - m_network->name = i18n("Temporary Network - %1").arg( hostName ); + m_network->name = i18n("Temporary Network - %1").tqarg( hostName ); m_network->description = i18n("Network imported from previous version of Kopete, or an IRC URI"); IRCHost *host = new IRCHost; @@ -204,12 +204,12 @@ IRCAccount::IRCAccount(IRCProtocol *protocol, const TQString &accountId, const T m_contactManager = new IRCContactManager(mNickName, this); setMyself( m_contactManager->mySelf() ); - setAccountLabel( TQString::fromLatin1("%1@%2").arg(mNickName,networkName) ); + setAccountLabel( TQString::tqfromLatin1("%1@%2").tqarg(mNickName,networkName) ); m_myServer = m_contactManager->myServer(); - m_joinChannelAction = new KAction ( i18n("Join Channel..."), TQString::null, 0, this, + m_joinChannelAction = new KAction ( i18n("Join Channel..."), TQString(), 0, this, TQT_SLOT(slotJoinChannel()), this); - m_searchChannelAction = new KAction ( i18n("Search Channels..."), TQString::null, 0, this, + m_searchChannelAction = new KAction ( i18n("Search Channels..."), TQString(), 0, this, TQT_SLOT(slotSearchChannels()), this); } @@ -226,7 +226,7 @@ void IRCAccount::slotNickInUse( const TQString &nick ) { TQString newNick = KInputDialog::getText( i18n("IRC Plugin"), - i18n("The nickname %1 is already in use. Please enter an alternate nickname:").arg(nick), + i18n("The nickname %1 is already in use. Please enter an alternate nickname:").tqarg(nick), nick); if (newNick.isNull()) @@ -243,23 +243,23 @@ void IRCAccount::slotNickInUse( const TQString &nick ) void IRCAccount::slotNickInUseAlert( const TQString &nick ) { - KMessageBox::error(Kopete::UI::Global::mainWidget(), i18n("The nickname %1 is already in use").arg(nick), i18n("IRC Plugin")); + KMessageBox::error(Kopete::UI::Global::mainWidget(), i18n("The nickname %1 is already in use").tqarg(nick), i18n("IRC Plugin")); } void IRCAccount::setAltNick( const TQString &altNick ) { - configGroup()->writeEntry(TQString::fromLatin1( "altNick" ), altNick); + configGroup()->writeEntry(TQString::tqfromLatin1( "altNick" ), altNick); } const TQString IRCAccount::altNick() const { - return configGroup()->readEntry(TQString::fromLatin1("altNick")); + return configGroup()->readEntry(TQString::tqfromLatin1("altNick")); } void IRCAccount::setAutoShowServerWindow( bool show ) { autoShowServerWindow = show; - configGroup()->writeEntry(TQString::fromLatin1( "AutoShowServerWindow" ), autoShowServerWindow); + configGroup()->writeEntry(TQString::tqfromLatin1( "AutoShowServerWindow" ), autoShowServerWindow); } const TQString IRCAccount::networkName() const @@ -306,8 +306,8 @@ void IRCAccount::setNetwork( const TQString &network ) KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Error, i18n("The network associated with this account, %1, no longer exists. Please" - " ensure that the account has a valid network. The account will not be enabled until you do so.").arg(network), - i18n("Problem Loading %1").arg( accountId() ), 0 ); + " ensure that the account has a valid network. The account will not be enabled until you do so.").tqarg(network), + i18n("Problem Loading %1").tqarg( accountId() ), 0 ); } } @@ -338,29 +338,29 @@ TQTextCodec *IRCAccount::codec() const // FIXME: Move this to a dictionnary void IRCAccount::setDefaultPart( const TQString &defaultPart ) { - configGroup()->writeEntry( TQString::fromLatin1( "defaultPart" ), defaultPart ); + configGroup()->writeEntry( TQString::tqfromLatin1( "defaultPart" ), defaultPart ); } // FIXME: Move this to a dictionnary void IRCAccount::setDefaultQuit( const TQString &defaultQuit ) { - configGroup()->writeEntry( TQString::fromLatin1( "defaultQuit" ), defaultQuit ); + configGroup()->writeEntry( TQString::tqfromLatin1( "defaultQuit" ), defaultQuit ); } // FIXME: Move this to a dictionnary const TQString IRCAccount::defaultPart() const { - TQString partMsg = configGroup()->readEntry(TQString::fromLatin1("defaultPart")); + TQString partMsg = configGroup()->readEntry(TQString::tqfromLatin1("defaultPart")); if( partMsg.isEmpty() ) - return TQString::fromLatin1("Kopete %1 : http://kopete.kde.org").arg( kapp->aboutData()->version() ); + return TQString::tqfromLatin1("Kopete %1 : http://kopete.kde.org").tqarg( kapp->aboutData()->version() ); return partMsg; } const TQString IRCAccount::defaultQuit() const { - TQString quitMsg = configGroup()->readEntry(TQString::fromLatin1("defaultQuit")); + TQString quitMsg = configGroup()->readEntry(TQString::tqfromLatin1("defaultQuit")); if( quitMsg.isEmpty() ) - return TQString::fromLatin1("Kopete %1 : http://kopete.kde.org").arg(kapp->aboutData()->version()); + return TQString::tqfromLatin1("Kopete %1 : http://kopete.kde.org").tqarg(kapp->aboutData()->version()); return quitMsg; } @@ -370,7 +370,7 @@ void IRCAccount::setCustomCtcpReplies( const TQMap< TQString, TQString > &replie for( TQMap< TQString, TQString >::ConstIterator it = replies.begin(); it != replies.end(); ++it ) { m_engine->addCustomCtcp( it.key(), it.data() ); - val.append( TQString::fromLatin1("%1=%2").arg( it.key() ).arg( it.data() ) ); + val.append( TQString::tqfromLatin1("%1=%2").tqarg( it.key() ).tqarg( it.data() ) ); } configGroup()->writeEntry( "CustomCtcp", val ); @@ -416,7 +416,7 @@ void IRCAccount::setMessageDestinations( int serverNotices, int serverMessages, KActionMenu *IRCAccount::actionMenu() { - TQString menuTitle = TQString::fromLatin1( " %1 <%2> " ).arg( accountId() ).arg( myself()->onlineStatus().description() ); + TQString menuTitle = TQString::tqfromLatin1( " %1 <%2> " ).tqarg( accountId() ).tqarg( myself()->onlinetqStatus().description() ); KActionMenu *mActionMenu = Kopete::Account::actionMenu(); @@ -426,7 +426,7 @@ KActionMenu *IRCAccount::actionMenu() mActionMenu->popupMenu()->insertSeparator(); mActionMenu->insert(m_joinChannelAction); mActionMenu->insert(m_searchChannelAction); - mActionMenu->insert( new KAction ( i18n("Show Server Window"), TQString::null, 0, this, TQT_SLOT(slotShowServerWindow()), mActionMenu ) ); + mActionMenu->insert( new KAction ( i18n("Show Server Window"), TQString(), 0, this, TQT_SLOT(slotShowServerWindow()), mActionMenu ) ); if( m_engine->isConnected() && m_engine->useSSL() ) { @@ -455,14 +455,14 @@ void IRCAccount::connectWithPassword(const TQString &password) { KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Error, - i18n("The network associated with this account, %1, has no valid hosts. Please ensure that the account has a valid network.").arg(m_network->name), + i18n("The network associated with this account, %1, has no valid hosts. Please ensure that the account has a valid network.").tqarg(m_network->name), i18n("Network is Empty"), 0 ); } else if( currentHost == hosts.count() ) { KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget(), KMessageBox::Error, - i18n("Kopete could not connect to any of the servers in the network associated with this account (%1). Please try again later.").arg(m_network->name), + i18n("Kopete could not connect to any of the servers in the network associated with this account (%1). Please try again later.").tqarg(m_network->name), i18n("Network is Unavailable"), 0 ); currentHost = 0; @@ -490,7 +490,7 @@ void IRCAccount::connectWithPassword(const TQString &password) } IRCHost *host = hosts[ currentHost++ ]; - myServer()->appendMessage( i18n("Connecting to %1...").arg( host->host ) ); + myServer()->appendMessage( i18n("Connecting to %1...").tqarg( host->host ) ); if( host->ssl ) myServer()->appendMessage( i18n("Using SSL") ); @@ -505,13 +505,13 @@ void IRCAccount::connectWithPassword(const TQString &password) } } -void IRCAccount::engineStatusChanged(KIRC::Engine::Status newStatus) +void IRCAccount::engineStatusChanged(KIRC::Engine::tqStatus newtqStatus) { kdDebug(14120) << k_funcinfo << endl; - mySelf()->updateStatus(); + mySelf()->updatetqStatus(); - switch (newStatus) + switch (newtqStatus) { case KIRC::Engine::Idle: // Do nothing. @@ -563,7 +563,7 @@ void IRCAccount::slotPerformOnConnectCommands() return; if (!autoConnect.isEmpty()) - Kopete::CommandHandler::commandHandler()->processMessage( TQString::fromLatin1("/join %1").arg(autoConnect), manager); + Kopete::CommandHandler::commandHandler()->processMessage( TQString::tqfromLatin1("/join %1").tqarg(autoConnect), manager); TQStringList commands(connectCommands()); for (TQStringList::Iterator it=commands.begin(); it != commands.end(); ++it) @@ -597,7 +597,7 @@ void IRCAccount::slotSearchChannels() if( !m_channelList ) { m_channelList = new ChannelListDialog( m_engine, - i18n("Channel List for %1").arg( m_engine->currentHost() ), this, + i18n("Channel List for %1").tqarg( m_engine->currentHost() ), this, TQT_SLOT( slotJoinNamedChannel( const TQString & ) ) ); } else @@ -653,17 +653,17 @@ void IRCAccount::slotShowServerWindow() bool IRCAccount::isConnected() { -// return ( myself()->onlineStatus().status() != Kopete::OnlineStatus::Offline ); +// return ( myself()->onlinetqStatus().status() != Kopete::OnlineStatus::Offline ); return m_engine->isConnected(); } void IRCAccount::setOnlineStatus( const Kopete::OnlineStatus& status , const TQString &reason ) { if ( status.status() == Kopete::OnlineStatus::Online && - myself()->onlineStatus().status() == Kopete::OnlineStatus::Offline ) + myself()->onlinetqStatus().status() == Kopete::OnlineStatus::Offline ) connect(); else if (status.status() == Kopete::OnlineStatus::Online && - myself()->onlineStatus().status() == Kopete::OnlineStatus::Away ) + myself()->onlinetqStatus().status() == Kopete::OnlineStatus::Away ) setAway( false ); else if ( status.status() == Kopete::OnlineStatus::Offline ) disconnect(); @@ -700,7 +700,7 @@ bool IRCAccount::createContact( const TQString &contactId, Kopete::MetaContact * return false; } - else if (contactId.startsWith(TQString::fromLatin1("#"))) + else if (contactId.startsWith(TQString::tqfromLatin1("#"))) { c = static_cast(contactManager()->findChannel(contactId, m)); } @@ -714,8 +714,8 @@ bool IRCAccount::createContact( const TQString &contactId, Kopete::MetaContact * {//This should NEVER happen Kopete::MetaContact *old = c->metaContact(); c->setMetaContact( m ); - Kopete::ContactPtrList children = old->contacts(); - if (children.isEmpty()) + Kopete::ContactPtrList tqchildren = old->contacts(); + if (tqchildren.isEmpty()) Kopete::ContactList::self()->removeMetaContact( old ); } else if( c->metaContact()->isTemporary() ) @@ -749,7 +749,7 @@ void IRCAccount::slotJoinChannel() KLineEditDlg dlg( i18n("Please enter name of the channel you want to join:"), - TQString::null, + TQString(), Kopete::UI::Global::mainWidget() ); @@ -781,7 +781,7 @@ void IRCAccount::slotJoinChannel() } KMessageBox::error( Kopete::UI::Global::mainWidget(), - i18n("\"%1\" is an invalid channel. Channels must start with '#', '!', '+', or '&'.").arg(chan), + i18n("\"%1\" is an invalid channel. Channels must start with '#', '!', '+', or '&'.").tqarg(chan), i18n("IRC Plugin") ); } @@ -789,15 +789,15 @@ void IRCAccount::slotJoinChannel() void IRCAccount::slotNewCtcpReply(const TQString &type, const TQString &/*target*/, const TQString &messageReceived) { - appendMessage( i18n("CTCP %1 REPLY: %2").arg(type).arg(messageReceived), InfoReply ); + appendMessage( i18n("CTCP %1 REPLY: %2").tqarg(type).tqarg(messageReceived), InfoReply ); } void IRCAccount::slotNoSuchNickname( const TQString &nick ) { if( KIRC::Entity::isChannel(nick) ) - appendMessage( i18n("The channel \"%1\" does not exist").arg(nick), UnknownReply ); + appendMessage( i18n("The channel \"%1\" does not exist").tqarg(nick), UnknownReply ); else - appendMessage( i18n("The nickname \"%1\" does not exist").arg(nick), UnknownReply ); + appendMessage( i18n("The nickname \"%1\" does not exist").tqarg(nick), UnknownReply ); } void IRCAccount::appendMessage( const TQString &message, MessageType type ) @@ -852,7 +852,7 @@ void IRCAccount::appendMessage( const TQString &message, MessageType type ) if( destination == KNotify ) { KNotifyClient::event( - Kopete::UI::Global::mainWidget()->winId(), TQString::fromLatin1("irc_event"), message + Kopete::UI::Global::mainWidget()->winId(), TQString::tqfromLatin1("irc_event"), message ); } } -- cgit v1.2.1