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/libkirc/kircengine.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/libkirc/kircengine.cpp')
-rw-r--r-- | kopete/protocols/irc/libkirc/kircengine.cpp | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/kopete/protocols/irc/libkirc/kircengine.cpp b/kopete/protocols/irc/libkirc/kircengine.cpp index 5b70d5fc..03936d5f 100644 --- a/kopete/protocols/irc/libkirc/kircengine.cpp +++ b/kopete/protocols/irc/libkirc/kircengine.cpp @@ -30,8 +30,8 @@ #include <klocale.h> #include <kstandarddirs.h> -#include <qtextcodec.h> -#include <qtimer.h> +#include <tqtextcodec.h> +#include <tqtimer.h> //Needed for getuid / getpwuid #include <unistd.h> @@ -48,13 +48,13 @@ using namespace KIRC; // FIXME: Remove slotConnected() and error(int errCode) while going to KNetwork namespace -/* Please note that the regular expression "[\\r\\n]*$" is used in a QString::replace statement many times. +/* Please note that the regular expression "[\\r\\n]*$" is used in a TQString::replace statement many times. * This gets rid of trailing \r\n, \r, \n, and \n\r characters. */ -const QRegExp Engine::m_RemoveLinefeeds( QString::fromLatin1("[\\r\\n]*$") ); +const TQRegExp Engine::m_RemoveLinefeeds( TQString::fromLatin1("[\\r\\n]*$") ); -Engine::Engine(QObject *parent, const char *name) - : QObject(parent, QString::fromLatin1("[KIRC::Engine]%1").arg(name).latin1()), +Engine::Engine(TQObject *parent, const char *name) + : TQObject(parent, TQString::fromLatin1("[KIRC::Engine]%1").arg(name).latin1()), m_status(Idle), m_FailedNickOnLogin(false), m_useSSL(false), @@ -64,7 +64,7 @@ Engine::Engine(QObject *parent, const char *name) m_ctcpReplies(17, false), codecs(577,false) { - setUserName(QString::null); + setUserName(TQString::null); m_commands.setAutoDelete(true); m_ctcpQueries.setAutoDelete(true); @@ -74,11 +74,11 @@ Engine::Engine(QObject *parent, const char *name) bindNumericReplies(); bindCtcp(); - m_VersionString = QString::fromLatin1("Anonymous client using the KIRC engine."); - m_UserString = QString::fromLatin1("Response not supplied by user."); - m_SourceString = QString::fromLatin1("Unknown client, known source."); + m_VersionString = TQString::fromLatin1("Anonymous client using the KIRC engine."); + m_UserString = TQString::fromLatin1("Response not supplied by user."); + m_SourceString = TQString::fromLatin1("Unknown client, known source."); - defaultCodec = QTextCodec::codecForMib(106); // UTF8 mib is 106 + defaultCodec = TQTextCodec::codecForMib(106); // UTF8 mib is 106 kdDebug(14120) << "Setting default engine codec, " << defaultCodec->name() << endl; m_sock = 0L; @@ -110,9 +110,9 @@ void Engine::setUseSSL( bool useSSL ) m_sock = new KSSLSocket; m_sock->setSocketFlags( KExtendedSocket::inetSocket ); - connect(m_sock, SIGNAL(certificateAccepted()), SLOT(slotConnected())); - connect(m_sock, SIGNAL(certificateRejected()), SLOT(slotConnectionClosed())); - connect(m_sock, SIGNAL(sslFailure()), SLOT(slotConnectionClosed())); + connect(m_sock, TQT_SIGNAL(certificateAccepted()), TQT_SLOT(slotConnected())); + connect(m_sock, TQT_SIGNAL(certificateRejected()), TQT_SLOT(slotConnectionClosed())); + connect(m_sock, TQT_SIGNAL(sslFailure()), TQT_SLOT(slotConnectionClosed())); } else #else @@ -124,12 +124,12 @@ void Engine::setUseSSL( bool useSSL ) m_sock = new KExtendedSocket; m_sock->setSocketFlags( KExtendedSocket::inputBufferedSocket | KExtendedSocket::inetSocket ); - connect(m_sock, SIGNAL(connectionSuccess()), SLOT(slotConnected())); - connect(m_sock, SIGNAL(connectionFailed(int)), SLOT(error(int))); + connect(m_sock, TQT_SIGNAL(connectionSuccess()), TQT_SLOT(slotConnected())); + connect(m_sock, TQT_SIGNAL(connectionFailed(int)), TQT_SLOT(error(int))); } - connect(m_sock, SIGNAL(closed(int)), SLOT(slotConnectionClosed())); - connect(m_sock, SIGNAL(readyRead()), SLOT(slotReadyRead())); + connect(m_sock, TQT_SIGNAL(closed(int)), TQT_SLOT(slotConnectionClosed())); + connect(m_sock, TQT_SIGNAL(readyRead()), TQT_SLOT(slotReadyRead())); } } @@ -183,7 +183,7 @@ void Engine::setStatus(Engine::Status status) } } -void Engine::connectToServer(const QString &host, Q_UINT16 port, const QString &nickname, bool useSSL ) +void Engine::connectToServer(const TQString &host, Q_UINT16 port, const TQString &nickname, bool useSSL ) { setUseSSL(useSSL); @@ -229,45 +229,45 @@ void Engine::error(int errCode) } } -void Engine::setVersionString(const QString &newString) +void Engine::setVersionString(const TQString &newString) { m_VersionString = newString; m_VersionString.remove(m_RemoveLinefeeds); } -void Engine::setUserString(const QString &newString) +void Engine::setUserString(const TQString &newString) { m_UserString = newString; m_UserString.remove(m_RemoveLinefeeds); } -void Engine::setSourceString(const QString &newString) +void Engine::setSourceString(const TQString &newString) { m_SourceString = newString; m_SourceString.remove(m_RemoveLinefeeds); } -void Engine::setUserName(const QString &newName) +void Engine::setUserName(const TQString &newName) { if(newName.isEmpty()) - m_Username = QString::fromLatin1(getpwuid(getuid())->pw_name); + m_Username = TQString::fromLatin1(getpwuid(getuid())->pw_name); else m_Username = newName; m_Username.remove(m_RemoveLinefeeds); } -void Engine::setRealName(const QString &newName) +void Engine::setRealName(const TQString &newName) { if(newName.isEmpty()) - m_realName = QString::fromLatin1(getpwuid(getuid())->pw_gecos); + m_realName = TQString::fromLatin1(getpwuid(getuid())->pw_gecos); else m_realName = newName; m_realName.remove(m_RemoveLinefeeds); } -bool Engine::_bind(QDict<KIRC::MessageRedirector> &dict, - QString command, QObject *object, const char *member, - int minArgs, int maxArgs, const QString &helpMessage) +bool Engine::_bind(TQDict<KIRC::MessageRedirector> &dict, + TQString command, TQObject *object, const char *member, + int minArgs, int maxArgs, const TQString &helpMessage) { // FIXME: Force upper case. // FIXME: Force number format. @@ -283,29 +283,29 @@ bool Engine::_bind(QDict<KIRC::MessageRedirector> &dict, return mr->connect(object, member); } -bool Engine::bind(const QString &command, QObject *object, const char *member, - int minArgs, int maxArgs, const QString &helpMessage) +bool Engine::bind(const TQString &command, TQObject *object, const char *member, + int minArgs, int maxArgs, const TQString &helpMessage) { return _bind(m_commands, command, object, member, minArgs, maxArgs, helpMessage); } -bool Engine::bind(int id, QObject *object, const char *member, - int minArgs, int maxArgs, const QString &helpMessage) +bool Engine::bind(int id, TQObject *object, const char *member, + int minArgs, int maxArgs, const TQString &helpMessage) { - return _bind(m_commands, QString::number(id), object, member, + return _bind(m_commands, TQString::number(id), object, member, minArgs, maxArgs, helpMessage); } -bool Engine::bindCtcpQuery(const QString &command, QObject *object, const char *member, - int minArgs, int maxArgs, const QString &helpMessage) +bool Engine::bindCtcpQuery(const TQString &command, TQObject *object, const char *member, + int minArgs, int maxArgs, const TQString &helpMessage) { return _bind(m_ctcpQueries, command, object, member, minArgs, maxArgs, helpMessage); } -bool Engine::bindCtcpReply(const QString &command, QObject *object, const char *member, - int minArgs, int maxArgs, const QString &helpMessage) +bool Engine::bindCtcpReply(const TQString &command, TQObject *object, const char *member, + int minArgs, int maxArgs, const TQString &helpMessage) { return _bind(m_ctcpReplies, command, object, member, minArgs, maxArgs, helpMessage); @@ -313,32 +313,32 @@ bool Engine::bindCtcpReply(const QString &command, QObject *object, const char * /* Message will be send as passed. */ -void Engine::writeRawMessage(const QString &rawMsg) +void Engine::writeRawMessage(const TQString &rawMsg) { Message::writeRawMessage(this, defaultCodec, rawMsg); } /* Message will be quoted before beeing send. */ -void Engine::writeMessage(const QString &msg, const QTextCodec *codec) +void Engine::writeMessage(const TQString &msg, const TQTextCodec *codec) { Message::writeMessage(this, codec ? codec : defaultCodec, msg); } -void Engine::writeMessage(const QString &command, const QStringList &args, const QString &suffix, const QTextCodec *codec) +void Engine::writeMessage(const TQString &command, const TQStringList &args, const TQString &suffix, const TQTextCodec *codec) { Message::writeMessage(this, codec ? codec : defaultCodec, command, args, suffix ); } -void Engine::writeCtcpMessage(const QString &command, const QString &to, const QString &ctcpMessage) +void Engine::writeCtcpMessage(const TQString &command, const TQString &to, const TQString &ctcpMessage) { Message::writeCtcpMessage(this, defaultCodec, command, to, ctcpMessage); } -void Engine::writeCtcpMessage(const QString &command, const QString &to, const QString &suffix, - const QString &ctcpCommand, const QStringList &ctcpArgs, const QString &ctcpSuffix, bool ) +void Engine::writeCtcpMessage(const TQString &command, const TQString &to, const TQString &suffix, + const TQString &ctcpCommand, const TQStringList &ctcpArgs, const TQString &ctcpSuffix, bool ) { - QString nick = Entity::userNick(to); + TQString nick = Entity::userNick(to); Message::writeCtcpMessage(this, codecForNick( nick ), command, nick, suffix, ctcpCommand, ctcpArgs, ctcpSuffix ); @@ -362,13 +362,13 @@ void Engine::slotReadyRead() // mr = m_numericCommands[ msg.command().toInt() ]; // we do this conversion because some dummy servers sends 1 instead of 001 // numbers are stored as "1" instead of "001" to make convertion faster (no 0 pading). - mr = m_commands[ QString::number(msg.command().toInt()) ]; + mr = m_commands[ TQString::number(msg.command().toInt()) ]; else mr = m_commands[ msg.command() ]; if (mr) { - QStringList errors = mr->operator()(msg); + TQStringList errors = mr->operator()(msg); if (!errors.isEmpty()) { @@ -393,19 +393,19 @@ void Engine::slotReadyRead() emit internalError(ParsingFailed, msg); } - QTimer::singleShot( 0, this, SLOT( slotReadyRead() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( slotReadyRead() ) ); } if(m_sock->socketStatus() != KExtendedSocket::connected) error(); } -const QTextCodec *Engine::codecForNick( const QString &nick ) const +const TQTextCodec *Engine::codecForNick( const TQString &nick ) const { if( nick.isEmpty() ) return defaultCodec; - QTextCodec *codec = codecs[ nick ]; + TQTextCodec *codec = codecs[ nick ]; kdDebug(14120) << nick << " has codec " << codec << endl; if( !codec ) @@ -427,7 +427,7 @@ void Engine::showInfoDialog() * (Only missing the \n\r final characters) * So applying the same parsing rules to the messages. */ -bool Engine::invokeCtcpCommandOfMessage(const QDict<MessageRedirector> &map, Message &msg) +bool Engine::invokeCtcpCommandOfMessage(const TQDict<MessageRedirector> &map, Message &msg) { if(msg.hasCtcpMessage() && msg.ctcpMessage().isValid()) { @@ -436,14 +436,14 @@ bool Engine::invokeCtcpCommandOfMessage(const QDict<MessageRedirector> &map, Mes MessageRedirector *mr = map[ctcpMsg.command()]; if (mr) { - QStringList errors = mr->operator()(msg); + TQStringList errors = mr->operator()(msg); if (errors.isEmpty()) return true; kdDebug(14120) << "Method error for line:" << ctcpMsg.raw() << endl; writeCtcpErrorMessage(msg.prefix(), msg.ctcpRaw(), - QString::fromLatin1("%1 internal error(s)").arg(errors.size())); + TQString::fromLatin1("%1 internal error(s)").arg(errors.size())); } else { @@ -462,7 +462,7 @@ bool Engine::invokeCtcpCommandOfMessage(const QDict<MessageRedirector> &map, Mes return false; } -EntityPtr Engine::getEntity(const QString &name) +EntityPtr Engine::getEntity(const TQString &name) { Entity *entity = 0; @@ -474,7 +474,7 @@ EntityPtr Engine::getEntity(const QString &name) m_entities.append(entity); } - connect(entity, SIGNAL(destroyed(KIRC::Entity *)), SLOT(destroyed(KIRC::Entity *))); + connect(entity, TQT_SIGNAL(destroyed(KIRC::Entity *)), TQT_SLOT(destroyed(KIRC::Entity *))); return EntityPtr(entity); } |