From 47c8a359c5276062c4bc17f0e82410f29081b502 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:48:06 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kopete/protocols/irc/libkirc/kircengine.cpp | 110 +++---- kopete/protocols/irc/libkirc/kircengine.h | 336 ++++++++++----------- .../protocols/irc/libkirc/kircengine_commands.cpp | 102 +++---- kopete/protocols/irc/libkirc/kircengine_ctcp.cpp | 134 ++++---- .../irc/libkirc/kircengine_numericreplies.cpp | 132 ++++---- kopete/protocols/irc/libkirc/kircentity.cpp | 34 +-- kopete/protocols/irc/libkirc/kircentity.h | 52 ++-- kopete/protocols/irc/libkirc/kircmessage.cpp | 118 ++++---- kopete/protocols/irc/libkirc/kircmessage.h | 84 +++--- .../irc/libkirc/kircmessageredirector.cpp | 16 +- .../protocols/irc/libkirc/kircmessageredirector.h | 24 +- kopete/protocols/irc/libkirc/kirctransfer.cpp | 100 +++--- kopete/protocols/irc/libkirc/kirctransfer.h | 58 ++-- .../protocols/irc/libkirc/kirctransferhandler.cpp | 22 +- kopete/protocols/irc/libkirc/kirctransferhandler.h | 24 +- .../protocols/irc/libkirc/kirctransferserver.cpp | 44 +-- kopete/protocols/irc/libkirc/kirctransferserver.h | 16 +- kopete/protocols/irc/libkirc/ksslsocket.cpp | 82 ++--- kopete/protocols/irc/libkirc/ksslsocket.h | 12 +- 19 files changed, 750 insertions(+), 750 deletions(-) (limited to 'kopete/protocols/irc/libkirc') 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 #include -#include -#include +#include +#include //Needed for getuid / getpwuid #include @@ -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 &dict, - QString command, QObject *object, const char *member, - int minArgs, int maxArgs, const QString &helpMessage) +bool Engine::_bind(TQDict &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 &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 &map, Message &msg) +bool Engine::invokeCtcpCommandOfMessage(const TQDict &map, Message &msg) { if(msg.hasCtcpMessage() && msg.ctcpMessage().isValid()) { @@ -436,14 +436,14 @@ bool Engine::invokeCtcpCommandOfMessage(const QDict &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 &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); } diff --git a/kopete/protocols/irc/libkirc/kircengine.h b/kopete/protocols/irc/libkirc/kircengine.h index 50cb8f49..4fb381f1 100644 --- a/kopete/protocols/irc/libkirc/kircengine.h +++ b/kopete/protocols/irc/libkirc/kircengine.h @@ -33,12 +33,12 @@ #include #endif -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include class QRegExp; @@ -55,21 +55,21 @@ class Engine { Q_OBJECT -// Q_PROPERTY(QUrl serverURL READ serverURL WRITE setServerURL) +// Q_PROPERTY(TQUrl serverURL READ serverURL WRITE setServerURL) // Extracted from the base of the serverURL. // Q_PROPERTY(bool useSSL); -// Q_PROPERTY(QString user READ user); -// Q_PROPERTY(QString password); -// Q_PROPERTY(QString host READ host); +// Q_PROPERTY(TQString user READ user); +// Q_PROPERTY(TQString password); +// Q_PROPERTY(TQString host READ host); // Q_PROPERTY(int port READ host); // Extracted from the query of the serverURL. // Q_PROPERTY(bool reqsPasswd); -// Q_PROPERTY(QString name); // real name -// Q_PROPERTY(QStringList nickList READ nickList WRITE setNickList) -// Q_PROPERTY(QString nick READ nick) -// Q_PROPERTY(QStringList portList) +// Q_PROPERTY(TQString name); // real name +// Q_PROPERTY(TQStringList nickList READ nickList WRITE setNickList) +// Q_PROPERTY(TQString nick READ nick) +// Q_PROPERTY(TQStringList portList) Q_ENUMS(Status) @@ -105,38 +105,38 @@ public: MessageOfTheDayCondensedMessage }; - Engine( QObject *parent = 0, const char* name = 0 ); + Engine( TQObject *parent = 0, const char* name = 0 ); ~Engine(); -// QString nick() const; -// QStringList nickList() const; -// void setNickList(const QStringList& nickList); +// TQString nick() const; +// TQStringList nickList() const; +// void setNickList(const TQStringList& nickList); -// QUrl serverURL() const; -// bool setServerURL(const QUrl &url); +// TQUrl serverURL() const; +// bool setServerURL(const TQUrl &url); - inline const QString ¤tHost() const + inline const TQString ¤tHost() const { return m_Host; }; inline Q_UINT16 currentPort() { return m_Port; } - inline const QString &nickName() const + inline const TQString &nickName() const { return m_Nickname; }; - inline const QString &password() const + inline const TQString &password() const { return m_Passwd; } - inline void setPassword(const QString &passwd) + inline void setPassword(const TQString &passwd) { m_Passwd = passwd; }; - inline const QString &userName() const + inline const TQString &userName() const { return m_Username; } - void setUserName(const QString &newName); + void setUserName(const TQString &newName); - void setRealName(const QString &newName); - inline const QString &realName() const + void setRealName(const TQString &newName); + inline const TQString &realName() const { return m_realName; } inline const bool reqsPassword() const @@ -148,18 +148,18 @@ public: const bool useSSL() const { return m_useSSL; }; void setUseSSL( bool useSSL ); - inline const QTextCodec *codec() const + inline const TQTextCodec *codec() const { return defaultCodec; }; - const QTextCodec *codecForNick( const QString &nick ) const; + const TQTextCodec *codecForNick( const TQString &nick ) const; - inline void setDefaultCodec( QTextCodec* codec ) + inline void setDefaultCodec( TQTextCodec* codec ) { defaultCodec = codec; }; - void setVersionString(const QString &versionString); - void setUserString(const QString &userString); - void setSourceString(const QString &sourceString); - void connectToServer(const QString &host, Q_UINT16 port, const QString &nickname, bool useSSL = false); + void setVersionString(const TQString &versionString); + void setUserString(const TQString &userString); + void setSourceString(const TQString &sourceString); + void connectToServer(const TQString &host, Q_UINT16 port, const TQString &nickname, bool useSSL = false); KExtendedSocket *socket() { return m_sock; }; @@ -173,102 +173,102 @@ public: inline bool isConnected() const { return m_status == Connected; } - inline void setCodec( const QString &nick, const QTextCodec *codec ) + inline void setCodec( const TQString &nick, const TQTextCodec *codec ) { codecs.replace( nick, codec ); } /* Custom CTCP replies handling */ - inline QString &customCtcp( const QString &s ) + inline TQString &customCtcp( const TQString &s ) { return customCtcpMap[s]; } - inline void addCustomCtcp( const QString &ctcp, const QString &reply ) + inline void addCustomCtcp( const TQString &ctcp, const TQString &reply ) { customCtcpMap[ ctcp.lower() ] = reply; } - KIRC::EntityPtr getEntity(const QString &name); + KIRC::EntityPtr getEntity(const TQString &name); public slots: //Message output - void writeRawMessage(const QString &message); + void writeRawMessage(const TQString &message); - void writeMessage(const QString &message, const QTextCodec *codec = 0 ); - void writeMessage(const QString &command, const QStringList &args, - const QString &suffix = QString::null, const QTextCodec *codec = 0); + void writeMessage(const TQString &message, const TQTextCodec *codec = 0 ); + void writeMessage(const TQString &command, const TQStringList &args, + const TQString &suffix = TQString::null, const TQTextCodec *codec = 0); - void writeCtcpMessage(const QString &command, const QString &to, const QString &ctcpMessage); + void writeCtcpMessage(const TQString &command, const TQString &to, const TQString &ctcpMessage); - void writeCtcpMessage(const QString &command, const QString &to, const QString &suffix, - const QString &ctcpCommand, const QStringList &ctcpArgs, const QString &ctcpSuffix = QString::null, + void writeCtcpMessage(const TQString &command, const TQString &to, const TQString &suffix, + const TQString &ctcpCommand, const TQStringList &ctcpArgs, const TQString &ctcpSuffix = TQString::null, bool emitRepliedCtcp = true); - inline void writeCtcpQueryMessage(const QString &to, const QString &suffix, - const QString &ctcpCommand, const QStringList &ctcpArgs = QStringList(), const QString &ctcpSuffix = QString::null, + inline void writeCtcpQueryMessage(const TQString &to, const TQString &suffix, + const TQString &ctcpCommand, const TQStringList &ctcpArgs = TQStringList(), const TQString &ctcpSuffix = TQString::null, bool emitRepliedCtcp = true) { return writeCtcpMessage("PRIVMSG", to, suffix, ctcpCommand, ctcpArgs, ctcpSuffix, emitRepliedCtcp); } - inline void writeCtcpReplyMessage(const QString &to, const QString &ctcpMessage) + inline void writeCtcpReplyMessage(const TQString &to, const TQString &ctcpMessage) { writeCtcpMessage("NOTICE", to, ctcpMessage); } - inline void writeCtcpReplyMessage(const QString &to, const QString &suffix, - const QString &ctcpCommand, const QStringList &ctcpArgs = QStringList(), const QString &ctcpSuffix = QString::null, + inline void writeCtcpReplyMessage(const TQString &to, const TQString &suffix, + const TQString &ctcpCommand, const TQStringList &ctcpArgs = TQStringList(), const TQString &ctcpSuffix = TQString::null, bool emitRepliedCtcp = true) { return writeCtcpMessage("NOTICE", to, suffix, ctcpCommand, ctcpArgs, ctcpSuffix, emitRepliedCtcp); } - inline void writeCtcpErrorMessage(const QString &to, const QString &ctcpLine, const QString &errorMsg, + inline void writeCtcpErrorMessage(const TQString &to, const TQString &ctcpLine, const TQString &errorMsg, bool emitRepliedCtcp=true) - { return writeCtcpReplyMessage(to, QString::null, "ERRMSG", ctcpLine, errorMsg, emitRepliedCtcp); } + { return writeCtcpReplyMessage(to, TQString::null, "ERRMSG", ctcpLine, errorMsg, emitRepliedCtcp); } - bool bind(const QString &command, QObject *object, const char *member, + bool bind(const TQString &command, TQObject *object, const char *member, int minArgs = KIRC::MessageRedirector::Unknown, int maxArgs = KIRC::MessageRedirector::Unknown, - const QString &helpMessage = QString::null); + const TQString &helpMessage = TQString::null); - bool bind(int id, QObject *object, const char *member, + bool bind(int id, TQObject *object, const char *member, int minArgs = KIRC::MessageRedirector::Unknown, int maxArgs = KIRC::MessageRedirector::Unknown, - const QString &helpMessage = QString::null); + const TQString &helpMessage = TQString::null); - bool bindCtcpQuery(const QString &command, QObject *object, const char *member, + bool bindCtcpQuery(const TQString &command, TQObject *object, const char *member, int minArgs = KIRC::MessageRedirector::Unknown, int maxArgs = KIRC::MessageRedirector::Unknown, - const QString &helpMessage = QString::null); + const TQString &helpMessage = TQString::null); - bool bindCtcpReply(const QString &command, QObject *object, const char *member, + bool bindCtcpReply(const TQString &command, TQObject *object, const char *member, int minArgs = KIRC::MessageRedirector::Unknown, int maxArgs = KIRC::MessageRedirector::Unknown, - const QString &helpMessage = QString::null); + const TQString &helpMessage = TQString::null); - void away(bool isAway, const QString &awayMessage = QString::null); - void ison(const QStringList &nickList); - void join(const QString &name, const QString &key); - void kick(const QString &user, const QString &channel, const QString &reason); + void away(bool isAway, const TQString &awayMessage = TQString::null); + void ison(const TQStringList &nickList); + void join(const TQString &name, const TQString &key); + void kick(const TQString &user, const TQString &channel, const TQString &reason); void list(); - void mode(const QString &target, const QString &mode); - void motd(const QString &server = QString::null); - void nick(const QString &newNickname); - void notice(const QString &target, const QString &message); - void part(const QString &name, const QString &reason); - void pass(const QString &password); - void privmsg(const QString &contact, const QString &message); + void mode(const TQString &target, const TQString &mode); + void motd(const TQString &server = TQString::null); + void nick(const TQString &newNickname); + void notice(const TQString &target, const TQString &message); + void part(const TQString &name, const TQString &reason); + void pass(const TQString &password); + void privmsg(const TQString &contact, const TQString &message); /** * Send a quit message for the given reason. * If now is set to true the connection is closed and no event message is sent. * Therefore setting now to true should only be used while destroying the object. */ - void quit(const QString &reason, bool now=false); + void quit(const TQString &reason, bool now=false); - void topic(const QString &channel, const QString &topic); - void user(const QString &newUsername, const QString &hostname, const QString &newRealname); - void user(const QString &newUsername, Q_UINT8 mode, const QString &newRealname); - void whois(const QString &user); + void topic(const TQString &channel, const TQString &topic); + void user(const TQString &newUsername, const TQString &hostname, const TQString &newRealname); + void user(const TQString &newUsername, Q_UINT8 mode, const TQString &newRealname); + void whois(const TQString &user); /* CTCP commands */ - void CtcpRequestCommand(const QString &contact, const QString &command); - void CtcpRequest_action(const QString &contact, const QString &message); - void CtcpRequest_dcc(const QString &, const QString &, unsigned int port, KIRC::Transfer::Type type); - void CtcpRequest_ping(const QString &target); - void CtcpRequest_version(const QString &target); + void CtcpRequestCommand(const TQString &contact, const TQString &command); + void CtcpRequest_action(const TQString &contact, const TQString &message); + void CtcpRequest_dcc(const TQString &, const TQString &, unsigned int port, KIRC::Transfer::Type type); + void CtcpRequest_ping(const TQString &target); + void CtcpRequest_version(const TQString &target); public slots: void showInfoDialog(); @@ -296,88 +296,88 @@ signals: void receivedMessage( KIRC::Engine::ServerMessageType type, const KIRC::EntityPtr &from, const KIRC::EntityPtrList &to, - const QString &msg); + const TQString &msg); - void successfullyChangedNick(const QString &, const QString &); + void successfullyChangedNick(const TQString &, const TQString &); //ServerContact Signals - void incomingMotd(const QString &motd); - void incomingNotice(const QString &originating, const QString &message); - void incomingHostInfo(const QString &servername, const QString &version, - const QString &userModes, const QString &channelModes); - void incomingYourHostInfo(const QString &servername, const QString &version, - const QString &userModes, const QString &channelModes); - void incomingConnectString(const QString &clients); + void incomingMotd(const TQString &motd); + void incomingNotice(const TQString &originating, const TQString &message); + void incomingHostInfo(const TQString &servername, const TQString &version, + const TQString &userModes, const TQString &channelModes); + void incomingYourHostInfo(const TQString &servername, const TQString &version, + const TQString &userModes, const TQString &channelModes); + void incomingConnectString(const TQString &clients); //Channel Contact Signals - void incomingMessage(const QString &originating, const QString &target, const QString &message); - void incomingTopicChange(const QString &, const QString &, const QString &); - void incomingExistingTopic(const QString &, const QString &); - void incomingTopicUser(const QString &channel, const QString &user, const QDateTime &time); - void incomingJoinedChannel(const QString &channel,const QString &nick); - void incomingPartedChannel(const QString &channel,const QString &nick, const QString &reason); - void incomingNamesList(const QString &channel, const QStringList &nicknames); - void incomingEndOfNames(const QString &channel); - void incomingChannelMode(const QString &channel, const QString &mode, const QString ¶ms); - void incomingCannotSendToChannel(const QString &channel, const QString &message); - void incomingChannelModeChange(const QString &channel, const QString &nick, const QString &mode); - void incomingChannelHomePage(const QString &channel, const QString &url); + void incomingMessage(const TQString &originating, const TQString &target, const TQString &message); + void incomingTopicChange(const TQString &, const TQString &, const TQString &); + void incomingExistingTopic(const TQString &, const TQString &); + void incomingTopicUser(const TQString &channel, const TQString &user, const TQDateTime &time); + void incomingJoinedChannel(const TQString &channel,const TQString &nick); + void incomingPartedChannel(const TQString &channel,const TQString &nick, const TQString &reason); + void incomingNamesList(const TQString &channel, const TQStringList &nicknames); + void incomingEndOfNames(const TQString &channel); + void incomingChannelMode(const TQString &channel, const TQString &mode, const TQString ¶ms); + void incomingCannotSendToChannel(const TQString &channel, const TQString &message); + void incomingChannelModeChange(const TQString &channel, const TQString &nick, const TQString &mode); + void incomingChannelHomePage(const TQString &channel, const TQString &url); //Contact Signals - void incomingPrivMessage(const QString &, const QString &, const QString &); - void incomingQuitIRC(const QString &user, const QString &reason); - void incomingUserModeChange(const QString &nick, const QString &mode); - void incomingNoSuchNickname(const QString &nick); + void incomingPrivMessage(const TQString &, const TQString &, const TQString &); + void incomingQuitIRC(const TQString &user, const TQString &reason); + void incomingUserModeChange(const TQString &nick, const TQString &mode); + void incomingNoSuchNickname(const TQString &nick); // CTCP Signals -// void action(const QString &from, const QString &to, const QString &message); - void incomingAction(const QString &channel, const QString &originating, const QString &message); - void incomingPrivAction(const QString &target, const QString &originating, const QString &message); +// void action(const TQString &from, const TQString &to, const TQString &message); + void incomingAction(const TQString &channel, const TQString &originating, const TQString &message); + void incomingPrivAction(const TQString &target, const TQString &originating, const TQString &message); //Response Signals - void incomingUserOnline(const QString &nick); - void incomingWhoIsUser(const QString &nickname, const QString &username, - const QString &hostname, const QString &realname); - void incomingWhoWasUser(const QString &nickname, const QString &username, - const QString &hostname, const QString &realname); - void incomingWhoIsServer(const QString &nickname, const QString &server, const QString &serverInfo); - void incomingWhoIsOperator(const QString &nickname); - void incomingWhoIsIdentified(const QString &nickname); - void incomingWhoIsChannels(const QString &nickname, const QString &channel); - void incomingWhoIsIdle(const QString &nickname, unsigned long seconds); /* 317 */ - void incomingSignOnTime(const QString &nickname, unsigned long seconds); /* 317 */ - void incomingEndOfWhois(const QString &nickname); - void incomingEndOfWhoWas(const QString &nickname); - - void incomingWhoReply( const QString &nick, const QString &channel, const QString &user, const QString &host, - const QString &server,bool away, const QString &flag, uint hops, const QString &realName ); - - void incomingEndOfWho( const QString &query ); + void incomingUserOnline(const TQString &nick); + void incomingWhoIsUser(const TQString &nickname, const TQString &username, + const TQString &hostname, const TQString &realname); + void incomingWhoWasUser(const TQString &nickname, const TQString &username, + const TQString &hostname, const TQString &realname); + void incomingWhoIsServer(const TQString &nickname, const TQString &server, const TQString &serverInfo); + void incomingWhoIsOperator(const TQString &nickname); + void incomingWhoIsIdentified(const TQString &nickname); + void incomingWhoIsChannels(const TQString &nickname, const TQString &channel); + void incomingWhoIsIdle(const TQString &nickname, unsigned long seconds); /* 317 */ + void incomingSignOnTime(const TQString &nickname, unsigned long seconds); /* 317 */ + void incomingEndOfWhois(const TQString &nickname); + void incomingEndOfWhoWas(const TQString &nickname); + + void incomingWhoReply( const TQString &nick, const TQString &channel, const TQString &user, const TQString &host, + const TQString &server,bool away, const TQString &flag, uint hops, const TQString &realName ); + + void incomingEndOfWho( const TQString &query ); //Error Message Signals void incomingServerLoadTooHigh(); - void incomingNickInUse(const QString &usingNick); - void incomingNickChange(const QString &, const QString &); + void incomingNickInUse(const TQString &usingNick); + void incomingNickChange(const TQString &, const TQString &); void incomingFailedServerPassword(); - void incomingFailedChankey(const QString &); - void incomingFailedChanBanned(const QString &); - void incomingFailedChanInvite(const QString &); - void incomingFailedChanFull(const QString &); - void incomingFailedNickOnLogin(const QString &); - void incomingNoNickChan(const QString &); - void incomingWasNoNick(const QString &); + void incomingFailedChankey(const TQString &); + void incomingFailedChanBanned(const TQString &); + void incomingFailedChanInvite(const TQString &); + void incomingFailedChanFull(const TQString &); + void incomingFailedNickOnLogin(const TQString &); + void incomingNoNickChan(const TQString &); + void incomingWasNoNick(const TQString &); //General Signals - void incomingUnknown(const QString &); - void incomingUnknownCtcp(const QString &); - void incomingKick(const QString &channel, const QString &nick, - const QString &nickKicked, const QString &reason); + void incomingUnknown(const TQString &); + void incomingUnknownCtcp(const TQString &); + void incomingKick(const TQString &channel, const TQString &nick, + const TQString &nickKicked, const TQString &reason); - void incomingUserIsAway(const QString &nick, const QString &awayMessage); - void incomingListedChan(const QString &chan, uint users, const QString &topic); + void incomingUserIsAway(const TQString &nick, const TQString &awayMessage); + void incomingListedChan(const TQString &chan, uint users, const TQString &topic); void incomingEndOfList(); - void incomingCtcpReply(const QString &type, const QString &target, const QString &messageReceived); + void incomingCtcpReply(const TQString &type, const TQString &target, const TQString &messageReceived); private slots: void destroyed(KIRC::Entity *entity); @@ -479,50 +479,50 @@ private: void bindCtcp(); void setStatus(KIRC::Engine::Status status); - bool invokeCtcpCommandOfMessage(const QDict &map, KIRC::Message &message); + bool invokeCtcpCommandOfMessage(const TQDict &map, KIRC::Message &message); /* * Methods that handles all the bindings creations. * This methods is used by all the bind(...) methods. */ - bool _bind(QDict &dict, - QString command, QObject *object, const char *member, - int minArgs, int maxArgs, const QString &helpMessage); + bool _bind(TQDict &dict, + TQString command, TQObject *object, const char *member, + int minArgs, int maxArgs, const TQString &helpMessage); //Static regexes - static const QRegExp m_RemoveLinefeeds; + static const TQRegExp m_RemoveLinefeeds; KIRC::Engine::Status m_status; - QString m_Host; + TQString m_Host; Q_UINT16 m_Port; -// QUrl serverURL; -// QUrl currentServerURL; - QString m_Nickname; - QString m_Username; - QString m_realName; - QString m_Passwd; +// TQUrl serverURL; +// TQUrl currentServerURL; + TQString m_Nickname; + TQString m_Username; + TQString m_realName; + TQString m_Passwd; bool m_ReqsPasswd; bool m_FailedNickOnLogin; bool m_useSSL; - QValueList m_entities; + TQValueList m_entities; KIRC::EntityPtr m_server; KIRC::EntityPtr m_self; - QString m_VersionString; - QString m_UserString; - QString m_SourceString; - QString m_PendingNick; + TQString m_VersionString; + TQString m_UserString; + TQString m_SourceString; + TQString m_PendingNick; - QDict m_commands; -// QIntDict m_numericCommands; - QDict m_ctcpQueries; - QDict m_ctcpReplies; + TQDict m_commands; +// TQIntDict m_numericCommands; + TQDict m_ctcpQueries; + TQDict m_ctcpReplies; - QMap customCtcpMap; - QDict codecs; - QTextCodec *defaultCodec; + TQMap customCtcpMap; + TQDict codecs; + TQTextCodec *defaultCodec; KExtendedSocket *m_sock; }; diff --git a/kopete/protocols/irc/libkirc/kircengine_commands.cpp b/kopete/protocols/irc/libkirc/kircengine_commands.cpp index 0a0f9002..21a90676 100644 --- a/kopete/protocols/irc/libkirc/kircengine_commands.cpp +++ b/kopete/protocols/irc/libkirc/kircengine_commands.cpp @@ -21,36 +21,36 @@ #include -#include +#include using namespace KIRC; void Engine::bindCommands() { - bind("ERROR", this, SLOT(error(KIRC::Message &)), 0, 0); - bind("JOIN", this, SLOT(join(KIRC::Message &)), 0, 1); - bind("KICK", this, SLOT(kick(KIRC::Message &)), 2, 2); - bind("NICK", this, SLOT(nick(KIRC::Message &)), 0, 0); - bind("MODE", this, SLOT(mode(KIRC::Message &)), 1, 1); - bind("NOTICE", this, SLOT(notice(KIRC::Message &)), 1, 1); - bind("PART", this, SLOT(part(KIRC::Message &)), 1, 1); - bind("PING", this, SLOT(ping(KIRC::Message &)), 0, 0); - bind("PONG", this, SLOT(pong(KIRC::Message &)), 0, 0); - bind("PRIVMSG", this, SLOT(privmsg(KIRC::Message &)), 1, 1); - bind("QUIT", this, SLOT(quit(KIRC::Message &)), 0, 0); -// bind("SQUIT", this, SLOT(squit(KIRC::Message &)), 1, 1); - bind("TOPIC", this, SLOT(topic(KIRC::Message &)), 1, 1); + bind("ERROR", this, TQT_SLOT(error(KIRC::Message &)), 0, 0); + bind("JOIN", this, TQT_SLOT(join(KIRC::Message &)), 0, 1); + bind("KICK", this, TQT_SLOT(kick(KIRC::Message &)), 2, 2); + bind("NICK", this, TQT_SLOT(nick(KIRC::Message &)), 0, 0); + bind("MODE", this, TQT_SLOT(mode(KIRC::Message &)), 1, 1); + bind("NOTICE", this, TQT_SLOT(notice(KIRC::Message &)), 1, 1); + bind("PART", this, TQT_SLOT(part(KIRC::Message &)), 1, 1); + bind("PING", this, TQT_SLOT(ping(KIRC::Message &)), 0, 0); + bind("PONG", this, TQT_SLOT(pong(KIRC::Message &)), 0, 0); + bind("PRIVMSG", this, TQT_SLOT(privmsg(KIRC::Message &)), 1, 1); + bind("QUIT", this, TQT_SLOT(quit(KIRC::Message &)), 0, 0); +// bind("SQUIT", this, TQT_SLOT(squit(KIRC::Message &)), 1, 1); + bind("TOPIC", this, TQT_SLOT(topic(KIRC::Message &)), 1, 1); } -void Engine::away(bool isAway, const QString &awayMessage) +void Engine::away(bool isAway, const TQString &awayMessage) { if(isAway) if( !awayMessage.isEmpty() ) - writeMessage("AWAY", QString::null, awayMessage); + writeMessage("AWAY", TQString::null, awayMessage); else - writeMessage("AWAY", QString::null, QString::fromLatin1("I'm away.")); + writeMessage("AWAY", TQString::null, TQString::fromLatin1("I'm away.")); else - writeMessage("AWAY", QString::null); + writeMessage("AWAY", TQString::null); } // FIXME: Really handle this message @@ -59,28 +59,28 @@ void Engine::error(Message &) setStatus(Closing); } -void Engine::ison(const QStringList &nickList) +void Engine::ison(const TQStringList &nickList) { if (!nickList.isEmpty()) { - QString statement = QString::fromLatin1("ISON"); - for (QStringList::ConstIterator it = nickList.begin(); it != nickList.end(); ++it) + TQString statement = TQString::fromLatin1("ISON"); + for (TQStringList::ConstIterator it = nickList.begin(); it != nickList.end(); ++it) { if ((statement.length()+(*it).length())>509) // 512(max buf)-2("\r\n")-1() { writeMessage(statement); - statement = QString::fromLatin1("ISON ") + (*it); + statement = TQString::fromLatin1("ISON ") + (*it); } else - statement.append(QChar(' ') + (*it)); + statement.append(TQChar(' ') + (*it)); } writeMessage(statement); } } -void Engine::join(const QString &name, const QString &key) +void Engine::join(const TQString &name, const TQString &key) { - QStringList args(name); + TQStringList args(name); if ( !key.isNull() ) args << key; @@ -101,9 +101,9 @@ void Engine::join(Message &msg) emit incomingJoinedChannel(Kopete::Message::unescape(msg.suffix()), msg.nickFromPrefix()); } -void Engine::kick(const QString &user, const QString &channel, const QString &reason) +void Engine::kick(const TQString &user, const TQString &channel, const TQString &reason) { - writeMessage("KICK", QStringList(channel) << user << reason); + writeMessage("KICK", TQStringList(channel) << user << reason); } void Engine::kick(Message &msg) @@ -114,9 +114,9 @@ void Engine::kick(Message &msg) emit incomingKick( Kopete::Message::unescape(msg.arg(0)), msg.nickFromPrefix(), msg.arg(1), msg.suffix()); } -void Engine::mode(const QString &target, const QString &mode) +void Engine::mode(const TQString &target, const TQString &mode) { - writeMessage("MODE", QStringList(target) << mode); + writeMessage("MODE", TQStringList(target) << mode); } void Engine::mode(Message &msg) @@ -124,7 +124,7 @@ void Engine::mode(Message &msg) /* Change the mode of a user. * " *( ( "+" / "-" ) *( "i" / "w" / "o" / "O" / "r" ) )" */ - QStringList args = msg.args(); + TQStringList args = msg.args(); args.pop_front(); if( Entity::isChannel( msg.arg(0) ) ) emit incomingChannelModeChange( msg.arg(0), msg.nickFromPrefix(), args.join(" ")); @@ -132,7 +132,7 @@ void Engine::mode(Message &msg) emit incomingUserModeChange( msg.nickFromPrefix(), args.join(" ")); } -void Engine::nick(const QString &newNickname) +void Engine::nick(const TQString &newNickname) { m_PendingNick = newNickname; writeMessage("NICK", newNickname); @@ -142,12 +142,12 @@ void Engine::nick(Message &msg) { /* Nick name of a user changed * "" */ - QString oldNick = msg.prefix().section('!', 0, 0); - QString newNick = msg.suffix(); + TQString oldNick = msg.prefix().section('!', 0, 0); + TQString newNick = msg.suffix(); if( codecs[ oldNick ] ) { - QTextCodec *c = codecs[ oldNick ]; + TQTextCodec *c = codecs[ oldNick ]; codecs.remove( oldNick ); codecs.insert( newNick, c ); } @@ -161,7 +161,7 @@ void Engine::nick(Message &msg) emit incomingNickChange(oldNick, msg.suffix()); } -void Engine::part(const QString &channel, const QString &reason) +void Engine::part(const TQString &channel, const TQString &reason) { /* This will part a channel with 'reason' as the reason for parting */ @@ -177,7 +177,7 @@ void Engine::part(Message &msg) emit incomingPartedChannel(msg.arg(0), msg.nickFromPrefix(), msg.suffix()); } -void Engine::pass(const QString &password) +void Engine::pass(const TQString &password) { writeMessage("PASS", password); } @@ -191,7 +191,7 @@ void Engine::pong(Message &/*msg*/) { } -void Engine::quit(const QString &reason, bool /*now*/) +void Engine::quit(const TQString &reason, bool /*now*/) { kdDebug(14120) << k_funcinfo << reason << endl; @@ -199,7 +199,7 @@ void Engine::quit(const QString &reason, bool /*now*/) return; if (isConnected()) - writeMessage("QUIT", QString::null, reason); + writeMessage("QUIT", TQString::null, reason); setStatus(Closing); } @@ -212,7 +212,7 @@ void Engine::quit(Message &msg) emit incomingQuitIRC(msg.prefix(), msg.suffix()); } -void Engine::user(const QString &newUserName, const QString &hostname, const QString &newRealName) +void Engine::user(const TQString &newUserName, const TQString &hostname, const TQString &newRealName) { /* RFC1459: " " * The USER command is used at the beginning of connection to specify @@ -221,10 +221,10 @@ void Engine::user(const QString &newUserName, const QString &hostname, const QSt m_Username = newUserName; m_realName = newRealName; - writeMessage("USER", QStringList(m_Username) << hostname << m_Host, m_realName); + writeMessage("USER", TQStringList(m_Username) << hostname << m_Host, m_realName); } -void Engine::user(const QString &newUserName, Q_UINT8 mode, const QString &newRealName) +void Engine::user(const TQString &newUserName, Q_UINT8 mode, const TQString &newRealName) { /* RFC2812: " " * mode is a numeric value (from a bit mask). @@ -234,10 +234,10 @@ void Engine::user(const QString &newUserName, Q_UINT8 mode, const QString &newRe m_Username = newUserName; m_realName = newRealName; - writeMessage("USER", QStringList(m_Username) << QString::number(mode) << QChar('*'), m_realName); + writeMessage("USER", TQStringList(m_Username) << TQString::number(mode) << TQChar('*'), m_realName); } -void Engine::topic(const QString &channel, const QString &topic) +void Engine::topic(const TQString &channel, const TQString &topic) { writeMessage("TOPIC", channel, topic); } @@ -252,15 +252,15 @@ void Engine::topic(Message &msg) void Engine::list() { - writeMessage("LIST", QString::null); + writeMessage("LIST", TQString::null); } -void Engine::motd(const QString &server) +void Engine::motd(const TQString &server) { writeMessage("MOTD", server); } -void Engine::privmsg(const QString &contact, const QString &message) +void Engine::privmsg(const TQString &contact, const TQString &message) { writeMessage("PRIVMSG", contact, message, codecForNick( contact ) ); } @@ -272,9 +272,9 @@ void Engine::privmsg(Message &msg) Message m = msg; if (!m.suffix().isEmpty()) { - QString user = m.arg(0); - QString message = m.suffix(); - const QTextCodec *codec = codecForNick( user ); + TQString user = m.arg(0); + TQString message = m.suffix(); + const TQTextCodec *codec = codecForNick( user ); if (codec != defaultCodec) { m.decodeAgain( codec ); message = m.suffix(); @@ -292,7 +292,7 @@ void Engine::privmsg(Message &msg) } } -void Engine::notice(const QString &target, const QString &message) +void Engine::notice(const TQString &target, const TQString &message) { writeMessage("NOTICE", target, message); } @@ -306,7 +306,7 @@ void Engine::notice(Message &msg) invokeCtcpCommandOfMessage(m_ctcpReplies, msg); } -void Engine::whois(const QString &user) +void Engine::whois(const TQString &user) { writeMessage("WHOIS", user); } diff --git a/kopete/protocols/irc/libkirc/kircengine_ctcp.cpp b/kopete/protocols/irc/libkirc/kircengine_ctcp.cpp index db1903f3..7216dea7 100644 --- a/kopete/protocols/irc/libkirc/kircengine_ctcp.cpp +++ b/kopete/protocols/irc/libkirc/kircengine_ctcp.cpp @@ -28,37 +28,37 @@ #include #include -#include -#include +#include +#include using namespace KIRC; void Engine::bindCtcp() { - bindCtcpQuery("ACTION", this, SLOT(CtcpQuery_action(KIRC::Message &)), + bindCtcpQuery("ACTION", this, TQT_SLOT(CtcpQuery_action(KIRC::Message &)), -1, -1); - bindCtcpQuery("CLIENTINFO", this, SLOT(CtcpQuery_clientinfo(KIRC::Message &)), + bindCtcpQuery("CLIENTINFO", this, TQT_SLOT(CtcpQuery_clientinfo(KIRC::Message &)), -1, 1); - bindCtcpQuery("DCC", this, SLOT(CtcpQuery_dcc(KIRC::Message &)), + bindCtcpQuery("DCC", this, TQT_SLOT(CtcpQuery_dcc(KIRC::Message &)), 4, 5); - bindCtcpQuery("FINGER", this, SLOT(CtcpQuery_finger(KIRC::Message &)), + bindCtcpQuery("FINGER", this, TQT_SLOT(CtcpQuery_finger(KIRC::Message &)), -1, 0); - bindCtcpQuery("PING", this, SLOT(CtcpQuery_ping(KIRC::Message &)), + bindCtcpQuery("PING", this, TQT_SLOT(CtcpQuery_ping(KIRC::Message &)), 1, 1); - bindCtcpQuery("SOURCE", this, SLOT(CtcpQuery_source(KIRC::Message &)), + bindCtcpQuery("SOURCE", this, TQT_SLOT(CtcpQuery_source(KIRC::Message &)), -1, 0); - bindCtcpQuery("TIME", this, SLOT(CtcpQuery_time(KIRC::Message &)), + bindCtcpQuery("TIME", this, TQT_SLOT(CtcpQuery_time(KIRC::Message &)), -1, 0); - bindCtcpQuery("USERINFO", this, SLOT(CtcpQuery_userinfo(KIRC::Message &)), + bindCtcpQuery("USERINFO", this, TQT_SLOT(CtcpQuery_userinfo(KIRC::Message &)), -1, 0); - bindCtcpQuery("VERSION", this, SLOT(CtcpQuery_version(KIRC::Message &)), + bindCtcpQuery("VERSION", this, TQT_SLOT(CtcpQuery_version(KIRC::Message &)), -1, 0); - bindCtcpReply("ERRMSG", this, SLOT(CtcpReply_errmsg(KIRC::Message &)), + bindCtcpReply("ERRMSG", this, TQT_SLOT(CtcpReply_errmsg(KIRC::Message &)), 1, -1); - bindCtcpReply("PING", this, SLOT(CtcpReply_ping(KIRC::Message &)), + bindCtcpReply("PING", this, TQT_SLOT(CtcpReply_ping(KIRC::Message &)), 1, 1, ""); - bindCtcpReply("VERSION", this, SLOT(CtcpReply_version(KIRC::Message &)), + bindCtcpReply("VERSION", this, TQT_SLOT(CtcpReply_version(KIRC::Message &)), -1, -1, ""); } @@ -68,20 +68,20 @@ void Engine::bindCtcp() // CtcpReply_* (if any) /* Generic ctcp commnd for the /ctcp trigger */ -void Engine::CtcpRequestCommand(const QString &contact, const QString &command) +void Engine::CtcpRequestCommand(const TQString &contact, const TQString &command) { if(m_status == Connected) { - writeCtcpQueryMessage(contact, QString::null, command); + writeCtcpQueryMessage(contact, TQString::null, command); // emit ctcpCommandMessage( contact, command ); } } -void Engine::CtcpRequest_action(const QString &contact, const QString &message) +void Engine::CtcpRequest_action(const TQString &contact, const TQString &message) { if(m_status == Connected) { - writeCtcpQueryMessage(contact, QString::null, "ACTION", message); + writeCtcpQueryMessage(contact, TQString::null, "ACTION", message); if( Entity::isChannel(contact) ) emit incomingAction(Kopete::Message::unescape(contact), Kopete::Message::unescape(m_Nickname), message); @@ -92,7 +92,7 @@ void Engine::CtcpRequest_action(const QString &contact, const QString &message) void Engine::CtcpQuery_action(Message &msg) { - QString target = msg.arg(0); + TQString target = msg.arg(0); if (target[0] == '#' || target[0] == '!' || target[0] == '&') emit incomingAction(target, msg.nickFromPrefix(), msg.ctcpMessage().ctcpRaw()); else @@ -109,18 +109,18 @@ bool Engine::CtcpReply_action(Message &msg) // FIXME: the API can now answer to help commands. void Engine::CtcpQuery_clientinfo(Message &msg) { - QString clientinfo = customCtcpMap[ QString::fromLatin1("clientinfo") ]; + TQString clientinfo = customCtcpMap[ TQString::fromLatin1("clientinfo") ]; if (clientinfo.isNull()) - clientinfo = QString::fromLatin1("The following commands are supported, but " + clientinfo = TQString::fromLatin1("The following commands are supported, but " "without sub-command help: VERSION, CLIENTINFO, USERINFO, TIME, SOURCE, PING," "ACTION."); - writeCtcpReplyMessage( msg.nickFromPrefix(), QString::null, - msg.ctcpMessage().command(), QString::null, clientinfo); + writeCtcpReplyMessage( msg.nickFromPrefix(), TQString::null, + msg.ctcpMessage().command(), TQString::null, clientinfo); } -void Engine::CtcpRequest_dcc(const QString &nickname, const QString &fileName, uint port, Transfer::Type type) +void Engine::CtcpRequest_dcc(const TQString &nickname, const TQString &fileName, uint port, Transfer::Type type) { if( m_status != Connected || m_sock->localAddress() == 0 || @@ -131,32 +131,32 @@ void Engine::CtcpRequest_dcc(const QString &nickname, const QString &fileName, u { case Transfer::Chat: { - writeCtcpQueryMessage(nickname, QString::null, - QString::fromLatin1("DCC"), - QStringList(QString::fromLatin1("CHAT")) << QString::fromLatin1("chat") << - m_sock->localAddress()->nodeName() << QString::number(port) + writeCtcpQueryMessage(nickname, TQString::null, + TQString::fromLatin1("DCC"), + TQStringList(TQString::fromLatin1("CHAT")) << TQString::fromLatin1("chat") << + m_sock->localAddress()->nodeName() << TQString::number(port) ); break; } case Transfer::FileOutgoing: { - QFileInfo file(fileName); - QString noWhiteSpace = file.fileName(); + TQFileInfo file(fileName); + TQString noWhiteSpace = file.fileName(); if (noWhiteSpace.contains(' ') > 0) - noWhiteSpace.replace(QRegExp("\\s+"), "_"); + noWhiteSpace.replace(TQRegExp("\\s+"), "_"); TransferServer *server = TransferHandler::self()->createServer(this, nickname, type, fileName, file.size()); - QString ip = m_sock->localAddress()->nodeName(); - QString ipNumber = QString::number( ntohl( inet_addr( ip.latin1() ) ) ); + TQString ip = m_sock->localAddress()->nodeName(); + TQString ipNumber = TQString::number( ntohl( inet_addr( ip.latin1() ) ) ); kdDebug(14120) << "Starting DCC file outgoing transfer." << endl; - writeCtcpQueryMessage(nickname, QString::null, - QString::fromLatin1("DCC"), - QStringList(QString::fromLatin1("SEND")) << noWhiteSpace << ipNumber << - QString::number(server->port()) << QString::number(file.size()) + writeCtcpQueryMessage(nickname, TQString::null, + TQString::fromLatin1("DCC"), + TQStringList(TQString::fromLatin1("SEND")) << noWhiteSpace << ipNumber << + TQString::number(server->port()) << TQString::number(file.size()) ); break; } @@ -171,9 +171,9 @@ void Engine::CtcpRequest_dcc(const QString &nickname, const QString &fileName, u void Engine::CtcpQuery_dcc(Message &msg) { Message &ctcpMsg = msg.ctcpMessage(); - QString dccCommand = ctcpMsg.arg(0).upper(); + TQString dccCommand = ctcpMsg.arg(0).upper(); - if (dccCommand == QString::fromLatin1("CHAT")) + if (dccCommand == TQString::fromLatin1("CHAT")) { // if(ctcpMsg.argsSize()!=4) return false; @@ -185,7 +185,7 @@ void Engine::CtcpQuery_dcc(Message &msg) */ bool okayHost, okayPort; // should ctctMsg.arg(1) be tested? - QHostAddress address(ctcpMsg.arg(2).toUInt(&okayHost)); + TQHostAddress address(ctcpMsg.arg(2).toUInt(&okayHost)); unsigned int port = ctcpMsg.arg(3).toUInt(&okayPort); if (okayHost && okayPort) { @@ -196,7 +196,7 @@ void Engine::CtcpQuery_dcc(Message &msg) Transfer::Chat ); } } - else if (dccCommand == QString::fromLatin1("SEND")) + else if (dccCommand == TQString::fromLatin1("SEND")) { // if(ctcpMsg.argsSize()!=5) return false; @@ -208,8 +208,8 @@ void Engine::CtcpQuery_dcc(Message &msg) * filesize = Size of file being sent */ bool okayHost, okayPort, okaySize; -// QFileInfo realfile(msg.arg(1)); - QHostAddress address(ctcpMsg.arg(2).toUInt(&okayHost)); +// TQFileInfo realfile(msg.arg(1)); + TQHostAddress address(ctcpMsg.arg(2).toUInt(&okayHost)); unsigned int port = ctcpMsg.arg(3).toUInt(&okayPort); unsigned int size = ctcpMsg.arg(4).toUInt(&okaySize); if (okayHost && okayPort && okaySize) @@ -243,21 +243,21 @@ void Engine::CtcpQuery_finger( Message &) // To be implemented } -void Engine::CtcpRequest_ping(const QString &target) +void Engine::CtcpRequest_ping(const TQString &target) { kdDebug(14120) << k_funcinfo << endl; timeval time; if (gettimeofday(&time, 0) == 0) { - QString timeReply; + TQString timeReply; if( Entity::isChannel(target) ) - timeReply = QString::fromLatin1("%1.%2").arg(time.tv_sec).arg(time.tv_usec); + timeReply = TQString::fromLatin1("%1.%2").arg(time.tv_sec).arg(time.tv_usec); else - timeReply = QString::number( time.tv_sec ); + timeReply = TQString::number( time.tv_sec ); - writeCtcpQueryMessage( target, QString::null, "PING", timeReply); + writeCtcpQueryMessage( target, TQString::null, "PING", timeReply); } // else // ((MessageRedirector *)sender())->error("failed to get current time"); @@ -265,7 +265,7 @@ void Engine::CtcpRequest_ping(const QString &target) void Engine::CtcpQuery_ping(Message &msg) { - writeCtcpReplyMessage( msg.nickFromPrefix(), QString::null, + writeCtcpReplyMessage( msg.nickFromPrefix(), TQString::null, msg.ctcpMessage().command(), msg.ctcpMessage().arg(0)); } @@ -275,30 +275,30 @@ void Engine::CtcpReply_ping(Message &msg) if (gettimeofday(&time, 0) == 0) { // FIXME: the time code is wrong for usec - QString timeReply = QString::fromLatin1("%1.%2").arg(time.tv_sec).arg(time.tv_usec); + TQString timeReply = TQString::fromLatin1("%1.%2").arg(time.tv_sec).arg(time.tv_usec); double newTime = timeReply.toDouble(); double oldTime = msg.suffix().section(' ',0, 0).toDouble(); double difference = newTime - oldTime; - QString diffString; + TQString diffString; if (difference < 1) { - diffString = QString::number(difference); + diffString = TQString::number(difference); diffString.remove((diffString.find('.') -1), 2); diffString.truncate(3); diffString.append("milliseconds"); } else { - diffString = QString::number(difference); - QString seconds = diffString.section('.', 0, 0); - QString millSec = diffString.section('.', 1, 1); + diffString = TQString::number(difference); + TQString seconds = diffString.section('.', 0, 0); + TQString millSec = diffString.section('.', 1, 1); millSec.remove(millSec.find('.'), 1); millSec.truncate(3); - diffString = QString::fromLatin1("%1 seconds, %2 milliseconds").arg(seconds).arg(millSec); + diffString = TQString::fromLatin1("%1 seconds, %2 milliseconds").arg(seconds).arg(millSec); } - emit incomingCtcpReply(QString::fromLatin1("PING"), msg.nickFromPrefix(), diffString); + emit incomingCtcpReply(TQString::fromLatin1("PING"), msg.nickFromPrefix(), diffString); } // else // ((MessageRedirector *)sender())->error("failed to get current time"); @@ -306,36 +306,36 @@ void Engine::CtcpReply_ping(Message &msg) void Engine::CtcpQuery_source(Message &msg) { - writeCtcpReplyMessage(msg.nickFromPrefix(), QString::null, + writeCtcpReplyMessage(msg.nickFromPrefix(), TQString::null, msg.ctcpMessage().command(), m_SourceString); } void Engine::CtcpQuery_time(Message &msg) { - writeCtcpReplyMessage(msg.nickFromPrefix(), QString::null, - msg.ctcpMessage().command(), QDateTime::currentDateTime().toString(), - QString::null, false); + writeCtcpReplyMessage(msg.nickFromPrefix(), TQString::null, + msg.ctcpMessage().command(), TQDateTime::currentDateTime().toString(), + TQString::null, false); } void Engine::CtcpQuery_userinfo(Message &msg) { - QString userinfo = customCtcpMap[ QString::fromLatin1("userinfo") ]; + TQString userinfo = customCtcpMap[ TQString::fromLatin1("userinfo") ]; if (userinfo.isNull()) userinfo = m_UserString; - writeCtcpReplyMessage(msg.nickFromPrefix(), QString::null, - msg.ctcpMessage().command(), QString::null, userinfo); + writeCtcpReplyMessage(msg.nickFromPrefix(), TQString::null, + msg.ctcpMessage().command(), TQString::null, userinfo); } -void Engine::CtcpRequest_version(const QString &target) +void Engine::CtcpRequest_version(const TQString &target) { - writeCtcpQueryMessage(target, QString::null, "VERSION"); + writeCtcpQueryMessage(target, TQString::null, "VERSION"); } void Engine::CtcpQuery_version(Message &msg) { - QString response = customCtcpMap[ QString::fromLatin1("version") ]; + TQString response = customCtcpMap[ TQString::fromLatin1("version") ]; kdDebug(14120) << "Version check: " << response << endl; if (response.isNull()) diff --git a/kopete/protocols/irc/libkirc/kircengine_numericreplies.cpp b/kopete/protocols/irc/libkirc/kircengine_numericreplies.cpp index c47b8b05..67d3a842 100644 --- a/kopete/protocols/irc/libkirc/kircengine_numericreplies.cpp +++ b/kopete/protocols/irc/libkirc/kircengine_numericreplies.cpp @@ -20,7 +20,7 @@ #include "kircengine.h" -#include +#include using namespace KIRC; @@ -31,69 +31,69 @@ using namespace KIRC; void Engine::bindNumericReplies() { - bind(1, this, SLOT(numericReply_001(KIRC::Message &)), 1, 1); - bind(2, this, SLOT(numericReply_002(KIRC::Message &)), 1, 1); - bind(3, this, SLOT(numericReply_003(KIRC::Message &)), 1, 1); - bind(4, this, SLOT(numericReply_004(KIRC::Message &)), 5, 5); - bind(5, this, SLOT(numericReply_004(KIRC::Message &)), 1, 1); - - bind(250, this, SLOT(numericReply_250(KIRC::Message &))); - bind(251, this, SLOT(numericReply_251(KIRC::Message &))); - bind(252, this, SLOT(numericReply_252(KIRC::Message &)), 2, 2); - bind(253, this, SLOT(numericReply_253(KIRC::Message &)), 2, 2); - bind(254, this, SLOT(numericReply_254(KIRC::Message &)), 2, 2); - bind(255, this, SLOT(numericReply_255(KIRC::Message &)), 1, 1); // incomingConnectString - - bind(263, this, SLOT(numericReply_263(KIRC::Message &))); // incomingServerLoadTooHigh - bind(265, this, SLOT(numericReply_265(KIRC::Message &))); - bind(266, this, SLOT(numericReply_266(KIRC::Message &))); - - bind(301, this, SLOT(numericReply_301(KIRC::Message &)), 2, 2); - bind(303, this, SLOT(numericReply_303(KIRC::Message &)), 1, 1); - bind(305, this, SLOT(ignoreMessage(KIRC::Message &)), 0, 0 ); // You are no longer marked as away - bind(306, this, SLOT(ignoreMessage(KIRC::Message &)), 0, 0 ); // You are marked as away - bind(307, this, SLOT(numericReply_307(KIRC::Message &)), 1, 1); - bind(311, this, SLOT(numericReply_311(KIRC::Message &)), 5, 5); - bind(312, this, SLOT(numericReply_312(KIRC::Message &)), 3, 3); - bind(313, this, SLOT(numericReply_313(KIRC::Message &)), 2, 2); - bind(314, this, SLOT(numericReply_314(KIRC::Message &)), 5, 5); - bind(315, this, SLOT(numericReply_315(KIRC::Message &)), 2, 2); - bind(317, this, SLOT(numericReply_317(KIRC::Message &)), 3, 4); - bind(318, this, SLOT(numericReply_318(KIRC::Message &)), 2, 2); - bind(319, this, SLOT(numericReply_319(KIRC::Message &)), 2, 2); - bind(320, this, SLOT(numericReply_320(KIRC::Message &)), 2, 2); - bind(321, this, SLOT(ignoreMessage(KIRC::Message &)), 0, 0 ); - bind(322, this, SLOT(numericReply_322(KIRC::Message &)), 3, 3); - bind(323, this, SLOT(numericReply_323(KIRC::Message &)), 1, 1); - bind(324, this, SLOT(numericReply_324(KIRC::Message &)), 2, 4); - bind(328, this, SLOT(numericReply_328(KIRC::Message &)), 2, 2); - bind(329, this, SLOT(numericReply_329(KIRC::Message &)), 3, 3); - bind(330, this, SLOT(ignoreMessage(KIRC::Message &)), 0, 0); // ??? - bind(331, this, SLOT(numericReply_331(KIRC::Message &)), 2, 2); - bind(332, this, SLOT(numericReply_332(KIRC::Message &)), 2, 2); - bind(333, this, SLOT(numericReply_333(KIRC::Message &)), 4, 4); - bind(352, this, SLOT(numericReply_352(KIRC::Message &)), 5, 10); - bind(353, this, SLOT(numericReply_353(KIRC::Message &)), 3, 3); - bind(366, this, SLOT(numericReply_366(KIRC::Message &)), 2, 2); - bind(369, this, SLOT(numericReply_369(KIRC::Message &)), 2, 2); - bind(372, this, SLOT(numericReply_372(KIRC::Message &)), 1, 1); - bind(375, this, SLOT(ignoreMessage(KIRC::Message&)), 0, 0 ); - bind(376, this, SLOT(ignoreMessage(KIRC::Message&)), 0, 0 ); - - bind(401, this, SLOT(numericReply_401(KIRC::Message &)), 2, 2); // incomingNoNickChan -// bind(404, this, SLOT(numericReply_404(KIRC::Message &)), 2, 2); // incomingCannotSendToChannel - bind(406, this, SLOT(numericReply_406(KIRC::Message &)), 2, 2); // incomingWasNoNick - bind(422, this, SLOT(numericReply_422(KIRC::Message &)), 1, 1); - bind(433, this, SLOT(numericReply_433(KIRC::Message &)), 2, 2); -// bind(442, this, SLOT(numericReply_442(KIRC::Message &)), 2, 2); // incomingCannotSendToChannel - bind(464, this, SLOT(numericReply_464(KIRC::Message &)), 1, 1); - bind(471, this, SLOT(numericReply_471(KIRC::Message &)), 2, 2); - bind(473, this, SLOT(numericReply_473(KIRC::Message &)), 2, 2); - bind(474, this, SLOT(numericReply_474(KIRC::Message &)), 2, 2); - bind(475, this, SLOT(numericReply_475(KIRC::Message &)), 2, 2); + bind(1, this, TQT_SLOT(numericReply_001(KIRC::Message &)), 1, 1); + bind(2, this, TQT_SLOT(numericReply_002(KIRC::Message &)), 1, 1); + bind(3, this, TQT_SLOT(numericReply_003(KIRC::Message &)), 1, 1); + bind(4, this, TQT_SLOT(numericReply_004(KIRC::Message &)), 5, 5); + bind(5, this, TQT_SLOT(numericReply_004(KIRC::Message &)), 1, 1); + + bind(250, this, TQT_SLOT(numericReply_250(KIRC::Message &))); + bind(251, this, TQT_SLOT(numericReply_251(KIRC::Message &))); + bind(252, this, TQT_SLOT(numericReply_252(KIRC::Message &)), 2, 2); + bind(253, this, TQT_SLOT(numericReply_253(KIRC::Message &)), 2, 2); + bind(254, this, TQT_SLOT(numericReply_254(KIRC::Message &)), 2, 2); + bind(255, this, TQT_SLOT(numericReply_255(KIRC::Message &)), 1, 1); // incomingConnectString + + bind(263, this, TQT_SLOT(numericReply_263(KIRC::Message &))); // incomingServerLoadTooHigh + bind(265, this, TQT_SLOT(numericReply_265(KIRC::Message &))); + bind(266, this, TQT_SLOT(numericReply_266(KIRC::Message &))); + + bind(301, this, TQT_SLOT(numericReply_301(KIRC::Message &)), 2, 2); + bind(303, this, TQT_SLOT(numericReply_303(KIRC::Message &)), 1, 1); + bind(305, this, TQT_SLOT(ignoreMessage(KIRC::Message &)), 0, 0 ); // You are no longer marked as away + bind(306, this, TQT_SLOT(ignoreMessage(KIRC::Message &)), 0, 0 ); // You are marked as away + bind(307, this, TQT_SLOT(numericReply_307(KIRC::Message &)), 1, 1); + bind(311, this, TQT_SLOT(numericReply_311(KIRC::Message &)), 5, 5); + bind(312, this, TQT_SLOT(numericReply_312(KIRC::Message &)), 3, 3); + bind(313, this, TQT_SLOT(numericReply_313(KIRC::Message &)), 2, 2); + bind(314, this, TQT_SLOT(numericReply_314(KIRC::Message &)), 5, 5); + bind(315, this, TQT_SLOT(numericReply_315(KIRC::Message &)), 2, 2); + bind(317, this, TQT_SLOT(numericReply_317(KIRC::Message &)), 3, 4); + bind(318, this, TQT_SLOT(numericReply_318(KIRC::Message &)), 2, 2); + bind(319, this, TQT_SLOT(numericReply_319(KIRC::Message &)), 2, 2); + bind(320, this, TQT_SLOT(numericReply_320(KIRC::Message &)), 2, 2); + bind(321, this, TQT_SLOT(ignoreMessage(KIRC::Message &)), 0, 0 ); + bind(322, this, TQT_SLOT(numericReply_322(KIRC::Message &)), 3, 3); + bind(323, this, TQT_SLOT(numericReply_323(KIRC::Message &)), 1, 1); + bind(324, this, TQT_SLOT(numericReply_324(KIRC::Message &)), 2, 4); + bind(328, this, TQT_SLOT(numericReply_328(KIRC::Message &)), 2, 2); + bind(329, this, TQT_SLOT(numericReply_329(KIRC::Message &)), 3, 3); + bind(330, this, TQT_SLOT(ignoreMessage(KIRC::Message &)), 0, 0); // ??? + bind(331, this, TQT_SLOT(numericReply_331(KIRC::Message &)), 2, 2); + bind(332, this, TQT_SLOT(numericReply_332(KIRC::Message &)), 2, 2); + bind(333, this, TQT_SLOT(numericReply_333(KIRC::Message &)), 4, 4); + bind(352, this, TQT_SLOT(numericReply_352(KIRC::Message &)), 5, 10); + bind(353, this, TQT_SLOT(numericReply_353(KIRC::Message &)), 3, 3); + bind(366, this, TQT_SLOT(numericReply_366(KIRC::Message &)), 2, 2); + bind(369, this, TQT_SLOT(numericReply_369(KIRC::Message &)), 2, 2); + bind(372, this, TQT_SLOT(numericReply_372(KIRC::Message &)), 1, 1); + bind(375, this, TQT_SLOT(ignoreMessage(KIRC::Message&)), 0, 0 ); + bind(376, this, TQT_SLOT(ignoreMessage(KIRC::Message&)), 0, 0 ); + + bind(401, this, TQT_SLOT(numericReply_401(KIRC::Message &)), 2, 2); // incomingNoNickChan +// bind(404, this, TQT_SLOT(numericReply_404(KIRC::Message &)), 2, 2); // incomingCannotSendToChannel + bind(406, this, TQT_SLOT(numericReply_406(KIRC::Message &)), 2, 2); // incomingWasNoNick + bind(422, this, TQT_SLOT(numericReply_422(KIRC::Message &)), 1, 1); + bind(433, this, TQT_SLOT(numericReply_433(KIRC::Message &)), 2, 2); +// bind(442, this, TQT_SLOT(numericReply_442(KIRC::Message &)), 2, 2); // incomingCannotSendToChannel + bind(464, this, TQT_SLOT(numericReply_464(KIRC::Message &)), 1, 1); + bind(471, this, TQT_SLOT(numericReply_471(KIRC::Message &)), 2, 2); + bind(473, this, TQT_SLOT(numericReply_473(KIRC::Message &)), 2, 2); + bind(474, this, TQT_SLOT(numericReply_474(KIRC::Message &)), 2, 2); + bind(475, this, TQT_SLOT(numericReply_475(KIRC::Message &)), 2, 2); //Freenode seems to use this for a non-RFC compliant purpose, as does Unreal - bind(477, this, SLOT(emitSuffix(KIRC::Message&)),0,0); + bind(477, this, TQT_SLOT(emitSuffix(KIRC::Message&)),0,0); } /* 001: "Welcome to the Internet Relay Network !@" @@ -237,8 +237,8 @@ void Engine::numericReply_301(Message &msg) */ void Engine::numericReply_303(Message &msg) { - QStringList nicks = QStringList::split(QRegExp(QChar(' ')), msg.suffix()); - for(QStringList::Iterator it = nicks.begin(); it != nicks.end(); ++it) + TQStringList nicks = TQStringList::split(TQRegExp(TQChar(' ')), msg.suffix()); + for(TQStringList::Iterator it = nicks.begin(); it != nicks.end(); ++it) { if (!(*it).stripWhiteSpace().isEmpty()) emit incomingUserOnline(Kopete::Message::unescape(*it)); @@ -405,7 +405,7 @@ void Engine::numericReply_332(Message &msg) void Engine::numericReply_333( Message &msg ) { kdDebug(14120) << k_funcinfo << endl; - QDateTime d; + TQDateTime d; d.setTime_t( msg.arg(3).toLong() ); emit incomingTopicUser( Kopete::Message::unescape(msg.arg(1)), Kopete::Message::unescape(msg.arg(2)), d ); } @@ -439,7 +439,7 @@ void Engine::numericReply_352(Message &msg) */ void Engine::numericReply_353(Message &msg) { - emit incomingNamesList(Kopete::Message::unescape(msg.arg(2)), QStringList::split(' ', msg.suffix())); + emit incomingNamesList(Kopete::Message::unescape(msg.arg(2)), TQStringList::split(' ', msg.suffix())); } /* 366: " :End of NAMES list" diff --git a/kopete/protocols/irc/libkirc/kircentity.cpp b/kopete/protocols/irc/libkirc/kircentity.cpp index 6aa6fd55..ded35fe5 100644 --- a/kopete/protocols/irc/libkirc/kircentity.cpp +++ b/kopete/protocols/irc/libkirc/kircentity.cpp @@ -29,19 +29,19 @@ using namespace KNetwork; * where user and host are optionnal. * NOTE: If changes are done to the regexp string, update also the sm_userStrictRegExp regexp string. */ -const QRegExp Entity::sm_userRegExp(QString::fromLatin1("^([^\\s,:!@]+)(?:(?:!([^\\s,:!@]+))?(?:@([^\\s,!@]+)))?$")); +const TQRegExp Entity::sm_userRegExp(TQString::fromLatin1("^([^\\s,:!@]+)(?:(?:!([^\\s,:!@]+))?(?:@([^\\s,!@]+)))?$")); /** * Regexp to match strictly the complete user definition: * nick!user@host * NOTE: If changes are done to the regexp string, update also the sm_userRegExp regexp string. */ -const QRegExp Entity::sm_userStrictRegExp(QString::fromLatin1("^([^\\s,:!@]+)!([^\\s,:!@]+)@([^\\s,:!@]+)$")); +const TQRegExp Entity::sm_userStrictRegExp(TQString::fromLatin1("^([^\\s,:!@]+)!([^\\s,:!@]+)@([^\\s,:!@]+)$")); -const QRegExp Entity::sm_channelRegExp( QString::fromLatin1("^[#!+&][^\\s,]+$") ); +const TQRegExp Entity::sm_channelRegExp( TQString::fromLatin1("^[#!+&][^\\s,]+$") ); -Entity::Entity(const QString &, const Type type) - : QObject(0, "KIRC::Entity"), +Entity::Entity(const TQString &, const Type type) + : TQObject(0, "KIRC::Entity"), m_type(type) { // rename(name, type); @@ -52,12 +52,12 @@ Entity::~Entity() emit destroyed(this); } -QString Entity::name() const +TQString Entity::name() const { return m_name; } -QString Entity::host() const +TQString Entity::host() const { switch(m_type) { @@ -70,7 +70,7 @@ QString Entity::host() const return userHost(); default: kdDebug(14121) << k_funcinfo << "No host defined for type:" << m_type; - return QString::null; + return TQString::null; } } @@ -86,44 +86,44 @@ KIRC::Entity::Type Entity::guessType() } // FIXME: Implement me -KIRC::Entity::Type Entity::guessType(const QString &) +KIRC::Entity::Type Entity::guessType(const TQString &) { return Unknown; } -QString Entity::userNick() const +TQString Entity::userNick() const { return userNick(m_name); } -QString Entity::userNick(const QString &s) +TQString Entity::userNick(const TQString &s) { return userInfo(s, 1); } -QString Entity::userName() const +TQString Entity::userName() const { return userName(m_name); } -QString Entity::userName(const QString &s) +TQString Entity::userName(const TQString &s) { return userInfo(s, 2); } -QString Entity::userHost() const +TQString Entity::userHost() const { return userHost(m_name); } -QString Entity::userHost(const QString &s) +TQString Entity::userHost(const TQString &s) { return userInfo(s, 3); } -QString Entity::userInfo(const QString &s, int num) +TQString Entity::userInfo(const TQString &s, int num) { - QRegExp userRegExp(sm_userRegExp); + TQRegExp userRegExp(sm_userRegExp); userRegExp.search(s); return userRegExp.cap(num); } diff --git a/kopete/protocols/irc/libkirc/kircentity.h b/kopete/protocols/irc/libkirc/kircentity.h index c9336439..d802d8f4 100644 --- a/kopete/protocols/irc/libkirc/kircentity.h +++ b/kopete/protocols/irc/libkirc/kircentity.h @@ -22,10 +22,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include namespace KIRC { @@ -33,7 +33,7 @@ namespace KIRC class Engine; class Entity - : public QObject, + : public TQObject, public KShared { Q_OBJECT @@ -48,49 +48,49 @@ public: User }; - Entity(const QString &name, const Type type = Unknown); + Entity(const TQString &name, const Type type = Unknown); virtual ~Entity(); - QString name() const; - QString host() const; + TQString name() const; + TQString host() const; KIRC::Entity::Type type() const; KIRC::Entity::Type guessType(); - static KIRC::Entity::Type guessType(const QString &name); + static KIRC::Entity::Type guessType(const TQString &name); - // FIXME: Remove these is* functions ... They are duplicate with the ::guessType(const QString&) - inline static bool isUser( const QString &s ) + // FIXME: Remove these is* functions ... They are duplicate with the ::guessType(const TQString&) + inline static bool isUser( const TQString &s ) { return sm_userRegExp.exactMatch(s); }; inline bool isChannel() { return isChannel(m_name); }; - inline static bool isChannel( const QString &s ) + inline static bool isChannel( const TQString &s ) { return sm_channelRegExp.exactMatch(s); }; - QString userNick() const; - static QString userNick(const QString &s); + TQString userNick() const; + static TQString userNick(const TQString &s); - QString userName() const; - static QString userName(const QString &s); + TQString userName() const; + static TQString userName(const TQString &s); - QString userHost() const; - static QString userHost(const QString &s); + TQString userHost() const; + static TQString userHost(const TQString &s); signals: void destroyed(KIRC::Entity *self); private: - static QString userInfo(const QString &s, int num_cap); + static TQString userInfo(const TQString &s, int num_cap); - static const QRegExp sm_userRegExp; - static const QRegExp sm_userStrictRegExp; - static const QRegExp sm_channelRegExp; + static const TQRegExp sm_userRegExp; + static const TQRegExp sm_userStrictRegExp; + static const TQRegExp sm_channelRegExp; KIRC::Entity::Type m_type; QString m_name; // peer ip address if the entity is a User. - QString m_address; + TQString m_address; }; class EntityPtr @@ -107,7 +107,7 @@ public: }; class EntityPtrList - : public QValueList + : public TQValueList { public: EntityPtrList() @@ -118,8 +118,8 @@ public: append(entity); } - EntityPtrList(const QValueList &list) - : QValueList(list) + EntityPtrList(const TQValueList &list) + : TQValueList(list) { } }; diff --git a/kopete/protocols/irc/libkirc/kircmessage.cpp b/kopete/protocols/irc/libkirc/kircmessage.cpp index f1a5b61f..73a1e53f 100644 --- a/kopete/protocols/irc/libkirc/kircmessage.cpp +++ b/kopete/protocols/irc/libkirc/kircmessage.cpp @@ -30,20 +30,20 @@ using namespace KIRC; #ifndef _IRC_STRICTNESS_ -QRegExp Message::m_IRCNumericCommand("^\\d{1,3}$"); +TQRegExp Message::m_IRCNumericCommand("^\\d{1,3}$"); // TODO: This regexp parsing is no good. It's slower than it needs to be, and -// is not codec-safe since QString requires a codec. NEed to parse this with +// is not codec-safe since TQString requires a codec. NEed to parse this with // our own parsing class that operates on the raw QCStrings -QRegExp Message::m_IRCCommandType1( +TQRegExp Message::m_IRCCommandType1( "^(?::([^ ]+) )?([A-Za-z]+|\\d{1,3})((?: [^ :][^ ]*)*) ?(?: :(.*))?$"); // Extra end arg space check -------------------------^ #else // _IRC_STRICTNESS_ -QRegExp Message::m_IRCNumericCommand("^\\d{3,3}$"); +TQRegExp Message::m_IRCNumericCommand("^\\d{3,3}$"); -QRegExp Message::m_IRCCommandType1( +TQRegExp Message::m_IRCCommandType1( "^(?::([^ ]+) )?([A-Za-z]+|\\d{3,3})((?: [^ :][^ ]*){0,13})(?: :(.*))?$"); -QRegExp Message::m_IRCCommandType2( +TQRegExp Message::m_IRCCommandType2( "^(?::[[^ ]+) )?([A-Za-z]+|\\d{3,3})((?: [^ :][^ ]*){14,14})(?: (.*))?$"); #endif // _IRC_STRICTNESS_ @@ -90,7 +90,7 @@ Message::~Message() delete m_ctcpMessage; } -void Message::writeRawMessage(Engine *engine, const QTextCodec *codec, const QString &str) +void Message::writeRawMessage(Engine *engine, const TQTextCodec *codec, const TQString &str) { // FIXME: Really handle this if (!engine->socket()) @@ -99,65 +99,65 @@ void Message::writeRawMessage(Engine *engine, const QTextCodec *codec, const QSt return; } - QString txt = str + QString::fromLatin1("\r\n"); + TQString txt = str + TQString::fromLatin1("\r\n"); - QCString s(codec->fromUnicode(txt)); + TQCString s(codec->fromUnicode(txt)); kdDebug(14120) << "Message is " << s.length() << " chars" << endl; // FIXME: Should check the amount of data really writen. int wrote = engine->socket()->writeBlock(s.data(), s.length()); - kdDebug(14121) << QString::fromLatin1("(%1 bytes) >> %2").arg(wrote).arg(str) << endl; + kdDebug(14121) << TQString::fromLatin1("(%1 bytes) >> %2").arg(wrote).arg(str) << endl; } -void Message::writeMessage(Engine *engine, const QTextCodec *codec, const QString &message) +void Message::writeMessage(Engine *engine, const TQTextCodec *codec, const TQString &message) { writeRawMessage(engine, codec, quote(message)); } -void Message::writeMessage(Engine *engine, const QTextCodec *codec, - const QString &command, const QStringList &args, const QString &suffix) +void Message::writeMessage(Engine *engine, const TQTextCodec *codec, + const TQString &command, const TQStringList &args, const TQString &suffix) { - QString msg = command; + TQString msg = command; if (!args.isEmpty()) - msg += QChar(' ') + args.join(QChar(' ')).stripWhiteSpace(); // some extra check should be done here + msg += TQChar(' ') + args.join(TQChar(' ')).stripWhiteSpace(); // some extra check should be done here if (!suffix.isNull()) - msg = msg.stripWhiteSpace() + QString::fromLatin1(" :") + suffix; + msg = msg.stripWhiteSpace() + TQString::fromLatin1(" :") + suffix; writeMessage(engine, codec, msg); } -void Message::writeCtcpMessage(Engine *engine, const QTextCodec *codec, - const QString &command, const QString&to, - const QString &ctcpMessage) +void Message::writeCtcpMessage(Engine *engine, const TQTextCodec *codec, + const TQString &command, const TQString&to, + const TQString &ctcpMessage) { - writeMessage(engine, codec, command, to, QChar(0x01) + ctcpQuote(ctcpMessage) + QChar(0x01)); + writeMessage(engine, codec, command, to, TQChar(0x01) + ctcpQuote(ctcpMessage) + TQChar(0x01)); } -void Message::writeCtcpMessage(Engine *engine, const QTextCodec *codec, - const QString &command, const QString &to, const QString &suffix, - const QString &ctcpCommand, const QStringList &ctcpArgs, const QString &ctcpSuffix ) +void Message::writeCtcpMessage(Engine *engine, const TQTextCodec *codec, + const TQString &command, const TQString &to, const TQString &suffix, + const TQString &ctcpCommand, const TQStringList &ctcpArgs, const TQString &ctcpSuffix ) { - QString ctcpMsg = ctcpCommand; + TQString ctcpMsg = ctcpCommand; if (!ctcpArgs.isEmpty()) - ctcpMsg += QChar(' ') + ctcpArgs.join(QChar(' ')).stripWhiteSpace(); // some extra check should be done here + ctcpMsg += TQChar(' ') + ctcpArgs.join(TQChar(' ')).stripWhiteSpace(); // some extra check should be done here if (!ctcpSuffix.isNull()) - ctcpMsg += QString::fromLatin1(" :") + ctcpSuffix; + ctcpMsg += TQString::fromLatin1(" :") + ctcpSuffix; - writeMessage(engine, codec, command, to, suffix + QChar(0x01) + ctcpQuote(ctcpMsg) + QChar(0x01)); + writeMessage(engine, codec, command, to, suffix + TQChar(0x01) + ctcpQuote(ctcpMsg) + TQChar(0x01)); } -Message Message::parse(Engine *engine, const QTextCodec *codec, bool *parseSuccess) +Message Message::parse(Engine *engine, const TQTextCodec *codec, bool *parseSuccess) { if (parseSuccess) *parseSuccess=false; if (engine->socket()->canReadLine()) { - QCString raw(engine->socket()->bytesAvailable()+1); + TQCString raw(engine->socket()->bytesAvailable()+1); Q_LONG length = engine->socket()->readLine(raw.data(), raw.count()); if( length > -1 ) @@ -197,21 +197,21 @@ Message Message::parse(Engine *engine, const QTextCodec *codec, bool *parseSucce return Message(); } -QString Message::quote(const QString &str) +TQString Message::quote(const TQString &str) { - QString tmp = str; - QChar q('\020'); - tmp.replace(q, q+QString(q)); - tmp.replace(QChar('\r'), q+QString::fromLatin1("r")); - tmp.replace(QChar('\n'), q+QString::fromLatin1("n")); - tmp.replace(QChar('\0'), q+QString::fromLatin1("0")); + TQString tmp = str; + TQChar q('\020'); + tmp.replace(q, q+TQString(q)); + tmp.replace(TQChar('\r'), q+TQString::fromLatin1("r")); + tmp.replace(TQChar('\n'), q+TQString::fromLatin1("n")); + tmp.replace(TQChar('\0'), q+TQString::fromLatin1("0")); return tmp; } // FIXME: The unquote system is buggy. -QString Message::unquote(const QString &str) +TQString Message::unquote(const TQString &str) { - QString tmp = str; + TQString tmp = str; char b[3] = { 020, 020, '\0' }; const char b2[2] = { 020, '\0' }; @@ -227,23 +227,23 @@ QString Message::unquote(const QString &str) return tmp; } -QString Message::ctcpQuote(const QString &str) +TQString Message::ctcpQuote(const TQString &str) { - QString tmp = str; - tmp.replace( QChar('\\'), QString::fromLatin1("\\\\")); - tmp.replace( (char)1, QString::fromLatin1("\\1")); + TQString tmp = str; + tmp.replace( TQChar('\\'), TQString::fromLatin1("\\\\")); + tmp.replace( (char)1, TQString::fromLatin1("\\1")); return tmp; } -QString Message::ctcpUnquote(const QString &str) +TQString Message::ctcpUnquote(const TQString &str) { - QString tmp = str; + TQString tmp = str; tmp.replace("\\\\", "\\"); tmp.replace("\\1", "\1" ); return tmp; } -bool Message::matchForIRCRegExp(const QCString &line, const QTextCodec *codec, Message &message) +bool Message::matchForIRCRegExp(const TQCString &line, const TQTextCodec *codec, Message &message) { if(matchForIRCRegExp(m_IRCCommandType1, codec, line, message)) return true; @@ -256,19 +256,19 @@ bool Message::matchForIRCRegExp(const QCString &line, const QTextCodec *codec, M // FIXME: remove the decodeStrings calls or update them. // FIXME: avoid the recursive call, it make the ctcp command unquoted twice (wich is wrong, but valid in most of the cases) -bool Message::matchForIRCRegExp(QRegExp ®exp, const QTextCodec *codec, const QCString &line, Message &msg ) +bool Message::matchForIRCRegExp(TQRegExp ®exp, const TQTextCodec *codec, const TQCString &line, Message &msg ) { if( regexp.exactMatch( codec->toUnicode(line) ) ) { msg.m_raw = line; msg.m_prefix = unquote(regexp.cap(1)); msg.m_command = unquote(regexp.cap(2)); - msg.m_args = QStringList::split(' ', regexp.cap(3)); + msg.m_args = TQStringList::split(' ', regexp.cap(3)); - QCString suffix = codec->fromUnicode(unquote(regexp.cap(4))); + TQCString suffix = codec->fromUnicode(unquote(regexp.cap(4))); if (!suffix.isNull() && suffix.length() > 0) { - QCString ctcpRaw; + TQCString ctcpRaw; if (extractCtcpCommand(suffix, ctcpRaw)) { msg.m_ctcpRaw = codec->toUnicode(ctcpRaw); @@ -279,7 +279,7 @@ bool Message::matchForIRCRegExp(QRegExp ®exp, const QTextCodec *codec, const int space = ctcpRaw.find(' '); if (!matchForIRCRegExp(msg.m_ctcpMessage->m_raw, codec, *msg.m_ctcpMessage)) { - QCString command; + TQCString command; if (space > 0) command = ctcpRaw.mid(0, space).upper(); else @@ -296,28 +296,28 @@ bool Message::matchForIRCRegExp(QRegExp ®exp, const QTextCodec *codec, const msg.m_suffix = Kopete::Message::decodeString( KSParser::parse(suffix), codec ); } else - msg.m_suffix = QString::null; + msg.m_suffix = TQString::null; return true; } return false; } -void Message::decodeAgain( const QTextCodec *codec ) +void Message::decodeAgain( const TQTextCodec *codec ) { matchForIRCRegExp(m_raw, codec, *this); } // FIXME: there are missing parts -QString Message::toString() const +TQString Message::toString() const { if( !isValid() ) - return QString::null; + return TQString::null; - QString msg = m_command; - for (QStringList::ConstIterator it = m_args.begin(); it != m_args.end(); ++it) - msg += QChar(' ') + *it; + TQString msg = m_command; + for (TQStringList::ConstIterator it = m_args.begin(); it != m_args.end(); ++it) + msg += TQChar(' ') + *it; if (!m_suffix.isNull()) - msg += QString::fromLatin1(" :") + m_suffix; + msg += TQString::fromLatin1(" :") + m_suffix; return msg; } @@ -339,7 +339,7 @@ bool Message::isValid() const * string is splited to get the first part of the message and fill the ctcp command. * FIXME: The code currently only match for a textual message or a ctcp message not both mixed as it can be (even if very rare). */ -bool Message::extractCtcpCommand(QCString &message, QCString &ctcpline) +bool Message::extractCtcpCommand(TQCString &message, TQCString &ctcpline) { uint len = message.length(); diff --git a/kopete/protocols/irc/libkirc/kircmessage.h b/kopete/protocols/irc/libkirc/kircmessage.h index e37f3fb2..02631bbf 100644 --- a/kopete/protocols/irc/libkirc/kircmessage.h +++ b/kopete/protocols/irc/libkirc/kircmessage.h @@ -22,11 +22,11 @@ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include @@ -44,20 +44,20 @@ class Message public: /** \brief Sends the message as-is to the server. */ - static void writeRawMessage(KIRC::Engine *engine, const QTextCodec *codec, const QString &str); + static void writeRawMessage(KIRC::Engine *engine, const TQTextCodec *codec, const TQString &str); - static void writeMessage(KIRC::Engine *engine, const QTextCodec *codec, const QString &str); + static void writeMessage(KIRC::Engine *engine, const TQTextCodec *codec, const TQString &str); - static void writeMessage(KIRC::Engine *engine, const QTextCodec *codec, - const QString &command, const QStringList &args, const QString &suffix); + static void writeMessage(KIRC::Engine *engine, const TQTextCodec *codec, + const TQString &command, const TQStringList &args, const TQString &suffix); - static void writeCtcpMessage(KIRC::Engine *engine, const QTextCodec *codec, - const QString &command, const QString &to, - const QString &ctcpMessage); + static void writeCtcpMessage(KIRC::Engine *engine, const TQTextCodec *codec, + const TQString &command, const TQString &to, + const TQString &ctcpMessage); - static void writeCtcpMessage(KIRC::Engine *engine, const QTextCodec *codec, - const QString &command, const QString &to, const QString &suffix, - const QString &ctcpCommand, const QStringList &ctcpArgs = QStringList(), const QString &ctcpSuffix = QString::null ); + static void writeCtcpMessage(KIRC::Engine *engine, const TQTextCodec *codec, + const TQString &command, const TQString &to, const TQString &suffix, + const TQString &ctcpCommand, const TQStringList &ctcpArgs = TQStringList(), const TQString &ctcpSuffix = TQString::null ); Message(); Message(const KIRC::Message &obj); @@ -65,10 +65,10 @@ public: ~Message(); - inline const QString nickFromPrefix() const + inline const TQString nickFromPrefix() const { return Kopete::Message::unescape(KIRC::Entity::userNick(m_prefix)); } - QString toString() const; + TQString toString() const; /** \brief Returns true if the message command is numeric. */ @@ -84,11 +84,11 @@ public: /** \brief Re-decodes the message with given codec. */ - void decodeAgain( const QTextCodec *codec ); + void decodeAgain( const TQTextCodec *codec ); /** \brief The whole message as received. */ - inline const QCString &raw() const + inline const TQCString &raw() const { return m_raw; } /** \brief Prefix of this message. @@ -100,7 +100,7 @@ public: * message = [ ":" prefix SPACE ] command [ params ] crlf * prefix = servername / ( nickname [ [ "!" user ] "@" host ] ) */ - inline const QString &prefix() const + inline const TQString &prefix() const { return m_prefix; } /** \brief The command part of this message. @@ -109,7 +109,7 @@ public: * * Examples: "MODE", "PRIVMSG", 303, 001, ... */ - inline const QString &command() const + inline const TQString &command() const { return m_command; } /** \brief The number of command arguments this message contains. @@ -119,19 +119,19 @@ public: /** \brief i:th command argument. */ - inline const QString &arg(size_t i) const + inline const TQString &arg(size_t i) const { return m_args[i]; } /** \brief All command arguments. */ - inline const QStringList &args() const + inline const TQStringList &args() const { return m_args; } /** \brief Message suffix. */ - inline const QString &suffix() const + inline const TQString &suffix() const { return m_suffix; } - inline const QString &ctcpRaw() const + inline const TQString &ctcpRaw() const { return m_ctcpRaw; } inline bool hasCtcpMessage() const @@ -139,58 +139,58 @@ public: inline class KIRC::Message &ctcpMessage() const { return *m_ctcpMessage; } - static KIRC::Message parse(KIRC::Engine *engine, const QTextCodec *codec, bool *parseSuccess=0); + static KIRC::Message parse(KIRC::Engine *engine, const TQTextCodec *codec, bool *parseSuccess=0); private: /** * Contains the low level dequoted message. */ - QCString m_raw; + TQCString m_raw; /** * Contains the completely dequoted prefix. */ - QString m_prefix; + TQString m_prefix; /** * Contains the completely dequoted command. */ - QString m_command; + TQString m_command; /** * Contains the completely dequoted args. */ - QStringList m_args; + TQStringList m_args; /** * Contains the completely dequoted suffix. */ - QString m_suffix; + TQString m_suffix; /** * If it is a message contains the completely dequoted rawCtcpLine. * If it is a ctcp message contains the completely dequoted rawCtcpArgsLine. */ - QString m_ctcpRaw; + TQString m_ctcpRaw; // low level quoting, message quoting - static QString quote(const QString &str); - static QString unquote(const QString &str); + static TQString quote(const TQString &str); + static TQString unquote(const TQString &str); // ctcp level quoting - static QString ctcpQuote(const QString &str); - static QString ctcpUnquote(const QString &str); + static TQString ctcpQuote(const TQString &str); + static TQString ctcpUnquote(const TQString &str); - static bool extractCtcpCommand(QCString &str, QCString &ctcpline); + static bool extractCtcpCommand(TQCString &str, TQCString &ctcpline); - static bool matchForIRCRegExp(const QCString &line, const QTextCodec *codec, KIRC::Message &message); - static bool matchForIRCRegExp(QRegExp ®exp, const QTextCodec *codec, const QCString &line, KIRC::Message &message); + static bool matchForIRCRegExp(const TQCString &line, const TQTextCodec *codec, KIRC::Message &message); + static bool matchForIRCRegExp(TQRegExp ®exp, const TQTextCodec *codec, const TQCString &line, KIRC::Message &message); class KIRC::Message *m_ctcpMessage; - static QRegExp m_IRCCommandType1; + static TQRegExp m_IRCCommandType1; #ifdef _IRC_STRICTNESS_ - static QRegExp m_IRCCommandType2; + static TQRegExp m_IRCCommandType2; #endif // _IRC_STRICTNESS_ - static QRegExp m_IRCNumericCommand; + static TQRegExp m_IRCNumericCommand; }; } diff --git a/kopete/protocols/irc/libkirc/kircmessageredirector.cpp b/kopete/protocols/irc/libkirc/kircmessageredirector.cpp index 49194ce0..2e1d0b4c 100644 --- a/kopete/protocols/irc/libkirc/kircmessageredirector.cpp +++ b/kopete/protocols/irc/libkirc/kircmessageredirector.cpp @@ -22,21 +22,21 @@ using namespace KIRC; MessageRedirector::MessageRedirector(KIRC::Engine *engine, - int argsSize_min, int argsSize_max, const QString &helpMessage) - : QObject(engine, "KIRC::MessageRedirector"), + int argsSize_min, int argsSize_max, const TQString &helpMessage) + : TQObject(engine, "KIRC::MessageRedirector"), m_argsSize_min(argsSize_min), m_argsSize_max(argsSize_max), m_helpMessage(helpMessage) { } -bool MessageRedirector::connect(QObject *object, const char *member) +bool MessageRedirector::connect(TQObject *object, const char *member) { - return QObject::connect(this, SIGNAL(redirect(KIRC::Message &)), + return TQObject::connect(this, TQT_SIGNAL(redirect(KIRC::Message &)), object, member); } -QStringList MessageRedirector::operator () (Message &msg) +TQStringList MessageRedirector::operator () (Message &msg) { m_errors.clear(); @@ -49,12 +49,12 @@ QStringList MessageRedirector::operator () (Message &msg) return m_errors; } -QString MessageRedirector::helpMessage() +TQString MessageRedirector::helpMessage() { return m_helpMessage; } -void MessageRedirector::error(QString &message) +void MessageRedirector::error(TQString &message) { m_errors.append(message); } @@ -82,7 +82,7 @@ bool MessageRedirector::checkValidity(const Message &msg) ( msg.argsSize() > 0 && ( msg.arg(0) == m_Nickname || msg.arg(0) == m_PendingNick || - msg.arg(0) == QString::fromLatin1("*") + msg.arg(0) == TQString::fromLatin1("*") ) ) ) diff --git a/kopete/protocols/irc/libkirc/kircmessageredirector.h b/kopete/protocols/irc/libkirc/kircmessageredirector.h index f87a2af6..24a2f9af 100644 --- a/kopete/protocols/irc/libkirc/kircmessageredirector.h +++ b/kopete/protocols/irc/libkirc/kircmessageredirector.h @@ -18,8 +18,8 @@ #ifndef KIRC_MESSAGEREDIRECTOR_H #define KIRC_MESSAGEREDIRECTOR_H -#include -#include +#include +#include namespace KIRC { @@ -42,27 +42,27 @@ public: MessageRedirector(KIRC::Engine *engine, int argsSize_min = KIRC::MessageRedirector::Unknown, int argsSize_max = KIRC::MessageRedirector::Unknown, - const QString &helpMessage = QString::null); + const TQString &helpMessage = TQString::null); /** * Connects the given object member signal/slot to this message redirector. * The member signal slot should be looking like: - * SIGNAL(mysignal(KIRC::Message &msg)) + * TQT_SIGNAL(mysignal(KIRC::Message &msg)) * or - * SIGNAL(myslot(KIRC::Message &msg)) + * TQT_SIGNAL(myslot(KIRC::Message &msg)) */ - bool connect(QObject *object, const char *member); + bool connect(TQObject *object, const char *member); /** * Attempt to send the message. - * @return a not empty QStringList on errors or no slots connected. + * @return a not empty TQStringList on errors or no slots connected. * The returned string list contains all the errors. */ - QStringList operator()(KIRC::Message &msg); + TQStringList operator()(KIRC::Message &msg); - void error(QString &errorMessage); + void error(TQString &errorMessage); - QString helpMessage(); + TQString helpMessage(); signals: void redirect(KIRC::Message &); @@ -74,11 +74,11 @@ private: */ bool checkValidity(const KIRC::Message &msg); - QStringList m_errors; + TQStringList m_errors; int m_argsSize_min; int m_argsSize_max; - QString m_helpMessage; + TQString m_helpMessage; }; } diff --git a/kopete/protocols/irc/libkirc/kirctransfer.cpp b/kopete/protocols/irc/libkirc/kirctransfer.cpp index 2466d6a9..af7d8948 100644 --- a/kopete/protocols/irc/libkirc/kirctransfer.cpp +++ b/kopete/protocols/irc/libkirc/kirctransfer.cpp @@ -19,30 +19,30 @@ #include #include -#include -#include +#include +#include #include "kirctransfer.h" using namespace KIRC; -Transfer::Transfer( Engine *engine, QString nick,// QString nick_peer_adress +Transfer::Transfer( Engine *engine, TQString nick,// TQString nick_peer_adress Type type, - QObject *parent, const char *name ) - : QObject( parent, name ), + TQObject *parent, const char *name ) + : TQObject( parent, name ), m_engine(engine), m_nick(nick), m_type(type), m_socket(0), m_initiated(false), - m_file(0), m_fileName(QString::null), m_fileSize(0), m_fileSizeCur(0), m_fileSizeAck(0), + m_file(0), m_fileName(TQString::null), m_fileSize(0), m_fileSizeCur(0), m_fileSizeAck(0), m_receivedBytes(0), m_receivedBytesLimit(0), m_sentBytes(0), m_sentBytesLimit(0) { } -Transfer::Transfer( Engine *engine, QString nick,// QString nick_peer_adress +Transfer::Transfer( Engine *engine, TQString nick,// TQString nick_peer_adress Transfer::Type type, - QString fileName, Q_UINT32 fileSize, // put this in a QVariant ? - QObject *parent, const char *name ) - : QObject( parent, name ), + TQString fileName, Q_UINT32 fileSize, // put this in a TQVariant ? + TQObject *parent, const char *name ) + : TQObject( parent, name ), m_engine(engine), m_nick(nick), m_type(type), m_socket(0), m_initiated(false), @@ -51,12 +51,12 @@ Transfer::Transfer( Engine *engine, QString nick,// QString nick_peer_adress { } -Transfer::Transfer( Engine *engine, QString nick,// QString nick_peer_adress - QHostAddress hostAdress, Q_UINT16 port, // put this in a QVariant ? +Transfer::Transfer( Engine *engine, TQString nick,// TQString nick_peer_adress + TQHostAddress hostAdress, Q_UINT16 port, // put this in a TQVariant ? Transfer::Type type, - QString fileName, Q_UINT32 fileSize, // put this in a QVariant ? - QObject *parent, const char *name ) - : QObject( parent, name ), + TQString fileName, Q_UINT32 fileSize, // put this in a TQVariant ? + TQObject *parent, const char *name ) + : TQObject( parent, name ), m_engine(engine), m_nick(nick), m_type(type), m_socket(0), m_initiated(false), @@ -66,10 +66,10 @@ Transfer::Transfer( Engine *engine, QString nick,// QString nick_peer_adress setSocket(new KExtendedSocket(hostAdress.toString(), port)); } /* -Transfer::Transfer( Engine *engine, QString nick,// QString nick_peer_adress - Transfer::Type type, QVariant properties, - QObject *parent, const char *name ) - : QObject( parent, name ), +Transfer::Transfer( Engine *engine, TQString nick,// TQString nick_peer_adress + Transfer::Type type, TQVariant properties, + TQObject *parent, const char *name ) + : TQObject( parent, name ), m_engine(engine), m_nick(nick), m_type(type), m_socket(properties[socket]), m_initiated(false), @@ -81,11 +81,11 @@ Transfer::Transfer( Engine *engine, QString nick,// QString nick_peer_adress else if(!properites["hostAddress"].isNull() && !properites["hostPort"].isNull()) setSocket(new KExtendedSocket(properites["hostAddress"], properites["hostPort"])); - connect(this, SIGNAL(complete()), - this, SLOT(closeSocket())); + connect(this, TQT_SIGNAL(complete()), + this, TQT_SLOT(closeSocket())); - connect(this, SIGNAL(abort(QString)), - this, SLOT(closeSocket())); + connect(this, TQT_SIGNAL(abort(TQString)), + this, TQT_SLOT(closeSocket())); } */ Transfer::~Transfer() @@ -116,7 +116,7 @@ void Transfer::slotError( int error ) bool Transfer::initiate() { - QTimer *timer = 0; + TQTimer *timer = 0; if(m_initiated) { @@ -134,39 +134,39 @@ bool Transfer::initiate() m_file.setName(m_fileName); - connect(this, SIGNAL(complete()), - this, SLOT(closeSocket())); - connect(this, SIGNAL(abort(QString)), - this, SLOT(closeSocket())); + connect(this, TQT_SIGNAL(complete()), + this, TQT_SLOT(closeSocket())); + connect(this, TQT_SIGNAL(abort(TQString)), + this, TQT_SLOT(closeSocket())); -// connect(m_socket, SIGNAL(connectionClosed()), -// this, SLOT(slotConnectionClosed())); -// connect(m_socket, SIGNAL(delayedCloseFinished()), -// this, SLOT(slotConnectionClosed())); - connect(m_socket, SIGNAL(error(int)), // FIXME: connection failed: No such signal KExtendedSocket::error(int) - this, SLOT(slotError(int))); +// connect(m_socket, TQT_SIGNAL(connectionClosed()), +// this, TQT_SLOT(slotConnectionClosed())); +// connect(m_socket, TQT_SIGNAL(delayedCloseFinished()), +// this, TQT_SLOT(slotConnectionClosed())); + connect(m_socket, TQT_SIGNAL(error(int)), // FIXME: connection failed: No such signal KExtendedSocket::error(int) + this, TQT_SLOT(slotError(int))); switch( m_type ) { case Chat: kdDebug(14121) << k_funcinfo << "Stting up a chat." << endl; - connect(m_socket, SIGNAL(readyRead()), - this, SLOT(readyReadFileIncoming())); + connect(m_socket, TQT_SIGNAL(readyRead()), + this, TQT_SLOT(readyReadFileIncoming())); break; case FileIncoming: kdDebug(14121) << k_funcinfo << "Stting up an incoming file transfer." << endl; m_file.open(IO_WriteOnly); - connect(m_socket, SIGNAL(readyRead()), - this, SLOT(readyReadFileIncoming())); + connect(m_socket, TQT_SIGNAL(readyRead()), + this, TQT_SLOT(readyReadFileIncoming())); break; case FileOutgoing: kdDebug(14121) << k_funcinfo << "Stting up an outgoing file transfer." << endl; m_file.open(IO_ReadOnly); - connect(m_socket, SIGNAL(readyRead()), - this, SLOT(readyReadFileOutgoing())); -// timer = new QTimer(this); -// connect(timer, SIGNAL(timeout()), -// this, SLOT(writeFileOutgoing())); + connect(m_socket, TQT_SIGNAL(readyRead()), + this, TQT_SLOT(readyReadFileOutgoing())); +// timer = new TQTimer(this); +// connect(timer, TQT_SIGNAL(timeout()), +// this, TQT_SLOT(writeFileOutgoing())); // timer->start(1000, false); writeFileOutgoing(); // send a first packet. break; @@ -189,9 +189,9 @@ bool Transfer::initiate() // I wonder if calling this is really necessary // As far as I understand, buffer (socket buffer at least) should be flushed while event-looping. // But I'm not really sure of this, so I force the flush. - timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), - this, SLOT(flush())); + timer = new TQTimer(this); + connect(timer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(flush())); timer->start(1000, FALSE); // flush the streams at every seconds return true; @@ -240,12 +240,12 @@ void Transfer::closeSocket() m_socket->flush(); } -void Transfer::userAbort(QString msg) +void Transfer::userAbort(TQString msg) { emit abort(msg); } -void Transfer::setCodec( QTextCodec *codec ) +void Transfer::setCodec( TQTextCodec *codec ) { switch( m_type ) { @@ -258,7 +258,7 @@ void Transfer::setCodec( QTextCodec *codec ) } } -void Transfer::writeLine( const QString &line ) +void Transfer::writeLine( const TQString &line ) { switch( m_type ) { @@ -275,7 +275,7 @@ void Transfer::readyReadLine() { if( m_socket->canReadLine() ) { - QString msg = m_socket_textStream.readLine(); + TQString msg = m_socket_textStream.readLine(); emit readLine(msg); } } diff --git a/kopete/protocols/irc/libkirc/kirctransfer.h b/kopete/protocols/irc/libkirc/kirctransfer.h index 3453f5cb..4053d1fd 100644 --- a/kopete/protocols/irc/libkirc/kirctransfer.h +++ b/kopete/protocols/irc/libkirc/kirctransfer.h @@ -18,11 +18,11 @@ #ifndef KIRCTRANSFER_H #define KIRCTRANSFER_H -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include class KExtendedSocket; @@ -56,25 +56,25 @@ public: Closed }; public: - Transfer( KIRC::Engine *engine, QString nick,// QString nick_peer_adress + Transfer( KIRC::Engine *engine, TQString nick,// TQString nick_peer_adress Type type = Unknown, - QObject *parent = 0L, const char *name = 0L ); + TQObject *parent = 0L, const char *name = 0L ); - Transfer( KIRC::Engine *engine, QString nick,// QString nick_peer_adress, - QHostAddress peer_address, Q_UINT16 peer_port, + Transfer( KIRC::Engine *engine, TQString nick,// TQString nick_peer_adress, + TQHostAddress peer_address, Q_UINT16 peer_port, Transfer::Type type, - QObject *parent = 0L, const char *name = 0L ); + TQObject *parent = 0L, const char *name = 0L ); - Transfer( KIRC::Engine *engine, QString nick,// QString nick_peer_adress, + Transfer( KIRC::Engine *engine, TQString nick,// TQString nick_peer_adress, Transfer::Type type, - QString fileName, Q_UINT32 fileSize, - QObject *parent = 0L, const char *name = 0L ); + TQString fileName, Q_UINT32 fileSize, + TQObject *parent = 0L, const char *name = 0L ); - Transfer( KIRC::Engine *engine, QString nick,// QString nick_peer_adress, - QHostAddress peer_address, Q_UINT16 peer_port, + Transfer( KIRC::Engine *engine, TQString nick,// TQString nick_peer_adress, + TQHostAddress peer_address, Q_UINT16 peer_port, Transfer::Type type, - QString fileName, Q_UINT32 fileSize, - QObject *parent = 0L, const char *name = 0L ); + TQString fileName, Q_UINT32 fileSize, + TQObject *parent = 0L, const char *name = 0L ); /* For a file transfer properties are: @@ -88,15 +88,15 @@ public: Q_UINT32 fileSize for detemining the file propeties. *//* - Transfer( KIRC *engine, QString nick,// QString nick_peer_adress, - Transfer::Type type, QVariant properties, - QObject *parent = 0L, const char *name = 0L ); + Transfer( KIRC *engine, TQString nick,// TQString nick_peer_adress, + Transfer::Type type, TQVariant properties, + TQObject *parent = 0L, const char *name = 0L ); */ ~Transfer(); KIRC::Engine *engine() const { return m_engine; } - QString nick() const + TQString nick() const { return m_nick; } Type type() const { return m_type; } @@ -108,11 +108,11 @@ public: */ bool initiate(); - QString fileName() const + TQString fileName() const { return m_fileName; } /* Change the file name. */ - void setFileName(QString fileName) + void setFileName(TQString fileName) { m_fileName = fileName; } unsigned long fileSize() const { return m_fileSize; } @@ -120,15 +120,15 @@ public slots: bool setSocket( KExtendedSocket *socket ); void closeSocket(); - void setCodec( QTextCodec *codec ); - void writeLine( const QString &msg ); + void setCodec( TQTextCodec *codec ); + void writeLine( const TQString &msg ); void flush(); - void userAbort(QString); + void userAbort(TQString); signals: - void readLine( const QString &msg ); + void readLine( const TQString &msg ); void fileSizeCurrent( unsigned int ); void fileSizeAcknowledge( unsigned int ); @@ -136,7 +136,7 @@ signals: // void received(Q_UINT32); // void sent(Q_UINT32); - void abort(QString); + void abort(TQString); /* Emited when the transfer is complete. * Usually it means that the file transfer has successfully finished. @@ -166,7 +166,7 @@ protected: // Text member data QTextStream m_socket_textStream; -// QTextCodec * m_socket_codec; +// TQTextCodec * m_socket_codec; // File member data QFile m_file; diff --git a/kopete/protocols/irc/libkirc/kirctransferhandler.cpp b/kopete/protocols/irc/libkirc/kirctransferhandler.cpp index 3fa73dff..c6c2185e 100644 --- a/kopete/protocols/irc/libkirc/kirctransferhandler.cpp +++ b/kopete/protocols/irc/libkirc/kirctransferhandler.cpp @@ -19,9 +19,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "kirctransferserver.h" @@ -54,9 +54,9 @@ TransferServer *TransferHandler::server( Q_UINT16 port, int backlog ) return m_server; } -TransferServer *TransferHandler::createServer(Engine *engine, QString m_userName, +TransferServer *TransferHandler::createServer(Engine *engine, TQString m_userName, Transfer::Type type, - QString fileName, Q_UINT32 fileSize) + TQString fileName, Q_UINT32 fileSize) { TransferServer *server = new TransferServer(engine, m_userName, type, fileName, fileSize, this); transferServerCreated(server); @@ -64,13 +64,13 @@ TransferServer *TransferHandler::createServer(Engine *engine, QString m_userName } Transfer *TransferHandler::createClient( - Engine *engine, QString nick,// QString nick_peer_adress, - QHostAddress peer_address, Q_UINT16 peer_port, + Engine *engine, TQString nick,// TQString nick_peer_adress, + TQHostAddress peer_address, Q_UINT16 peer_port, Transfer::Type type, - QString fileName, Q_UINT32 fileSize ) + TQString fileName, Q_UINT32 fileSize ) { Transfer *client = new Transfer( - engine, nick,// QString nick_peer_adress, + engine, nick,// TQString nick_peer_adress, peer_address, peer_port, type, fileName, fileSize, @@ -80,9 +80,9 @@ Transfer *TransferHandler::createClient( } /* -File *DCCHandler::openFile( QString file, int mode = IO_ReadWrite ) +File *DCCHandler::openFile( TQString file, int mode = IO_ReadWrite ) { - QFile *file = new QFile(filename); + TQFile *file = new TQFile(filename); if (!file->open(mode)) { delete file; diff --git a/kopete/protocols/irc/libkirc/kirctransferhandler.h b/kopete/protocols/irc/libkirc/kirctransferhandler.h index 81774c02..de03b810 100644 --- a/kopete/protocols/irc/libkirc/kirctransferhandler.h +++ b/kopete/protocols/irc/libkirc/kirctransferhandler.h @@ -18,7 +18,7 @@ #ifndef KIRCTRANSFERHANDLER_H #define KIRCTRANSFERHANDLER_H -#include +#include #include "kirctransfer.h" #include "kirctransferserver.h" @@ -42,24 +42,24 @@ public: TransferServer *server(); TransferServer *server( Q_UINT16 port, int backlog = 1 ); - TransferServer *createServer(KIRC::Engine *engine, QString m_userName, + TransferServer *createServer(KIRC::Engine *engine, TQString m_userName, Transfer::Type type, - QString fileName, Q_UINT32 fileSize); + TQString fileName, Q_UINT32 fileSize); Transfer *createClient( - KIRC::Engine *engine, QString nick,// QString nick_peer_adress, - QHostAddress peer_address, Q_UINT16 peer_port, + KIRC::Engine *engine, TQString nick,// TQString nick_peer_adress, + TQHostAddress peer_address, Q_UINT16 peer_port, Transfer::Type type, - QString file = QString::null, Q_UINT32 fileSize = 0 ); + TQString file = TQString::null, Q_UINT32 fileSize = 0 ); // void registerServer( DCCServer * ); -// QPtrList getRegisteredServers(); -// static QPtrList getAllRegisteredServers(); +// TQPtrList getRegisteredServers(); +// static TQPtrList getAllRegisteredServers(); // void unregisterServer( DCCServer * ); // void registerClient( DCCClient * ); -// QPtrList getRegisteredClients(); -// static QPtrList getAllRegisteredClients(); +// TQPtrList getRegisteredClients(); +// static TQPtrList getAllRegisteredClients(); // void unregisterClient( DCCClient * ); signals: @@ -70,8 +70,8 @@ private: // TransferHandler(); TransferServer *m_server; -// QPtrList m_servers; -// QPtrList m_clients; +// TQPtrList m_servers; +// TQPtrList m_clients; }; } diff --git a/kopete/protocols/irc/libkirc/kirctransferserver.cpp b/kopete/protocols/irc/libkirc/kirctransferserver.cpp index 96cc66fb..1fbe1629 100644 --- a/kopete/protocols/irc/libkirc/kirctransferserver.cpp +++ b/kopete/protocols/irc/libkirc/kirctransferserver.cpp @@ -25,27 +25,27 @@ using namespace KIRC; /* -TransferServer::TransferServer( QObject *parent, const char *name ) - : QObject( parent, name ), +TransferServer::TransferServer( TQObject *parent, const char *name ) + : TQObject( parent, name ), m_socket( 0 ), m_port( 0 ), m_backlog( 1 ) { } */ -TransferServer::TransferServer(Q_UINT16 port, int backlog, QObject *parent, const char *name) - : QObject( parent, name ), +TransferServer::TransferServer(Q_UINT16 port, int backlog, TQObject *parent, const char *name) + : TQObject( parent, name ), m_socket( 0 ), m_port( port ), m_backlog( backlog ) { } -TransferServer::TransferServer(Engine *engine, QString nick,// QString nick_peer_adress, +TransferServer::TransferServer(Engine *engine, TQString nick,// TQString nick_peer_adress, Transfer::Type type, - QString fileName, Q_UINT32 fileSize, - QObject *parent, const char *name) - : QObject( parent, name ), + TQString fileName, Q_UINT32 fileSize, + TQObject *parent, const char *name) + : TQObject( parent, name ), m_socket(0), m_port(0), m_backlog(1), @@ -68,8 +68,8 @@ bool TransferServer::initServer() { if (!m_socket) { - QObject::connect(this, SIGNAL(incomingNewTransfer(Transfer *)), - TransferHandler::self(), SIGNAL(transferCreated(Transfer *))); + TQObject::connect(this, TQT_SIGNAL(incomingNewTransfer(Transfer *)), + TransferHandler::self(), TQT_SIGNAL(transferCreated(Transfer *))); m_socket = new KExtendedSocket(); @@ -83,10 +83,10 @@ bool TransferServer::initServer() if (!m_socket->setTimeout(2*60)) // FIXME: allow configuration of this. kdDebug(14120) << k_funcinfo << "Failed to set timeout." << endl; - QObject::connect(m_socket, SIGNAL(readyAccept()), - this, SLOT(readyAccept())); - QObject::connect(m_socket, SIGNAL(connectionFailed(int)), - this, SLOT(connectionFailed(int))); + TQObject::connect(m_socket, TQT_SIGNAL(readyAccept()), + this, TQT_SLOT(readyAccept())); + TQObject::connect(m_socket, TQT_SIGNAL(connectionFailed(int)), + this, TQT_SLOT(connectionFailed(int))); m_socket->listen(m_backlog); m_socket->setBlockingMode(true); @@ -137,14 +137,14 @@ void Transfer::initClient() { if(!m_socket) { - connect(m_socket, SIGNAL(connectionClosed()), - this, SLOT(slotConnectionClosed())); - connect(m_socket, SIGNAL(delayedCloseFinished()), - this, SLOT(slotConnectionClosed())); - connect(m_socket, SIGNAL(error(int)), - this, SLOT(slotError(int))); - connect(m_socket, SIGNAL(readyRead()), - this, SLOT(readyReadFileOut)); + connect(m_socket, TQT_SIGNAL(connectionClosed()), + this, TQT_SLOT(slotConnectionClosed())); + connect(m_socket, TQT_SIGNAL(delayedCloseFinished()), + this, TQT_SLOT(slotConnectionClosed())); + connect(m_socket, TQT_SIGNAL(error(int)), + this, TQT_SLOT(slotError(int))); + connect(m_socket, TQT_SIGNAL(readyRead()), + this, TQT_SLOT(readyReadFileOut)); m_socket->enableRead( true ); m_socket->enableWrite( true ); diff --git a/kopete/protocols/irc/libkirc/kirctransferserver.h b/kopete/protocols/irc/libkirc/kirctransferserver.h index 8ac016ef..af7c498d 100644 --- a/kopete/protocols/irc/libkirc/kirctransferserver.h +++ b/kopete/protocols/irc/libkirc/kirctransferserver.h @@ -20,7 +20,7 @@ #include "kirctransfer.h" -#include +#include class KExtendedSocket; @@ -36,12 +36,12 @@ class TransferServer Q_OBJECT public: -// TransferServer(QObject *parent = 0, const char *name = 0); - TransferServer(Q_UINT16 port, int backlog = 1, QObject *parent = 0, const char *name = 0); - TransferServer(KIRC::Engine *engine, QString nick,// QString nick_peer_adress, +// TransferServer(TQObject *parent = 0, const char *name = 0); + TransferServer(Q_UINT16 port, int backlog = 1, TQObject *parent = 0, const char *name = 0); + TransferServer(KIRC::Engine *engine, TQString nick,// TQString nick_peer_adress, Transfer::Type type, - QString fileName, Q_UINT32 fileSize, - QObject *parent = 0, const char *name = 0); + TQString fileName, Q_UINT32 fileSize, + TQObject *parent = 0, const char *name = 0); ~TransferServer(); @@ -71,8 +71,8 @@ private: QString m_fileName; Q_UINT32 m_fileSize; // by - // QPtrList m_pendingTransfers; - // QPtrList m_activeTransfers; + // TQPtrList m_pendingTransfers; + // TQPtrList m_activeTransfers; }; diff --git a/kopete/protocols/irc/libkirc/ksslsocket.cpp b/kopete/protocols/irc/libkirc/ksslsocket.cpp index fb2d5161..afe78fed 100644 --- a/kopete/protocols/irc/libkirc/ksslsocket.cpp +++ b/kopete/protocols/irc/libkirc/ksslsocket.cpp @@ -16,7 +16,7 @@ ************************************************************************* */ -#include +#include #include #include @@ -36,8 +36,8 @@ struct KSSLSocketPrivate mutable KSSL *kssl; KSSLCertificateCache *cc; DCOPClient *dcc; - QMap metaData; - QSocketNotifier *socketNotifier; + TQMap metaData; + TQSocketNotifier *socketNotifier; }; KSSLSocket::KSSLSocket() : KExtendedSocket() @@ -52,9 +52,9 @@ KSSLSocket::KSSLSocket() : KExtendedSocket() setBlockingMode(false); //Connect internal slots - QObject::connect( this, SIGNAL(connectionSuccess()), this, SLOT(slotConnected()) ); - QObject::connect( this, SIGNAL(closed(int)), this, SLOT(slotDisconnected()) ); - QObject::connect( this, SIGNAL(connectionFailed(int)), this, SLOT(slotDisconnected())); + TQObject::connect( this, TQT_SIGNAL(connectionSuccess()), this, TQT_SLOT(slotConnected()) ); + TQObject::connect( this, TQT_SIGNAL(closed(int)), this, TQT_SLOT(slotDisconnected()) ); + TQObject::connect( this, TQT_SIGNAL(connectionFailed(int)), this, TQT_SLOT(slotDisconnected())); } KSSLSocket::~KSSLSocket() @@ -118,7 +118,7 @@ int KSSLSocket::bytesAvailable() const void KSSLSocket::slotReadData() { kdDebug(14120) << k_funcinfo << d->kssl->pending() << endl; - QByteArray buff(512); + TQByteArray buff(512); int bytesRead = d->kssl->read( buff.data(), 512 ); //Fill the read buffer @@ -148,11 +148,11 @@ void KSSLSocket::slotConnected() } //Disconnect the KExtSocket notifier slot, we use our own - QObject::disconnect( readNotifier(), SIGNAL(activated( int )), - this, SLOT(socketActivityRead()) ); + TQObject::disconnect( readNotifier(), TQT_SIGNAL(activated( int )), + this, TQT_SLOT(socketActivityRead()) ); - QObject::connect( readNotifier(), SIGNAL(activated( int )), - this, SLOT(slotReadData()) ); + TQObject::connect( readNotifier(), TQT_SIGNAL(activated( int )), + this, TQT_SLOT(slotReadData()) ); readNotifier()->setEnabled(true); @@ -182,34 +182,34 @@ void KSSLSocket::showInfoDialog() { if (!d->dcc->isApplicationRegistered("kio_uiserver")) { - KApplication::startServiceByDesktopPath("kio_uiserver.desktop",QStringList()); + KApplication::startServiceByDesktopPath("kio_uiserver.desktop",TQStringList()); } - QByteArray data, ignore; - QCString ignoretype; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, ignore; + TQCString ignoretype; + TQDataStream arg(data, IO_WriteOnly); arg << "irc://" + peerAddress()->pretty() + ":" + port() << d->metaData; d->dcc->call("kio_uiserver", "UIServer", - "showSSLInfoDialog(QString,KIO::MetaData)", data, ignoretype, ignore); + "showSSLInfoDialog(TQString,KIO::MetaData)", data, ignoretype, ignore); } } -void KSSLSocket::setMetaData( const QString &key, const QVariant &data ) +void KSSLSocket::setMetaData( const TQString &key, const TQVariant &data ) { - QVariant v = data; + TQVariant v = data; d->metaData[key] = v.asString(); } -bool KSSLSocket::hasMetaData( const QString &key ) +bool KSSLSocket::hasMetaData( const TQString &key ) { return d->metaData.contains(key); } -QString KSSLSocket::metaData( const QString &key ) +TQString KSSLSocket::metaData( const TQString &key ) { if( d->metaData.contains(key) ) return d->metaData[key]; - return QString::null; + return TQString::null; } /* @@ -220,27 +220,27 @@ I basically copied the below from tcpKIO::SlaveBase.hpp, with some modificaions * Copyright (C) 2001 Dawit Alemayehu */ -int KSSLSocket::messageBox( KIO::SlaveBase::MessageBoxType type, const QString &text, const QString &caption, - const QString &buttonYes, const QString &buttonNo ) +int KSSLSocket::messageBox( KIO::SlaveBase::MessageBoxType type, const TQString &text, const TQString &caption, + const TQString &buttonYes, const TQString &buttonNo ) { kdDebug(14120) << "messageBox " << type << " " << text << " - " << caption << buttonYes << buttonNo << endl; - QByteArray data, result; - QCString returnType; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, result; + TQCString returnType; + TQDataStream arg(data, IO_WriteOnly); arg << (int)1 << (int)type << text << caption << buttonYes << buttonNo; if (!d->dcc->isApplicationRegistered("kio_uiserver")) { - KApplication::startServiceByDesktopPath("kio_uiserver.desktop",QStringList()); + KApplication::startServiceByDesktopPath("kio_uiserver.desktop",TQStringList()); } d->dcc->call("kio_uiserver", "UIServer", - "messageBox(int,int,QString,QString,QString,QString)", data, returnType, result); + "messageBox(int,int,TQString,TQString,TQString,TQString)", data, returnType, result); if( returnType == "int" ) { int res; - QDataStream r(result, IO_ReadOnly); + TQDataStream r(result, IO_ReadOnly); r >> res; return res; } @@ -257,10 +257,10 @@ int KSSLSocket::verifyCertificate() bool _IPmatchesCN = false; int result; bool doAddHost = false; - QString ourHost = host(); - QString ourIp = peerAddress()->pretty(); + TQString ourHost = host(); + TQString ourIp = peerAddress()->pretty(); - QString theurl = "irc://" + ourHost + ":" + port(); + TQString theurl = "irc://" + ourHost + ":" + port(); if (!d->cc) d->cc = new KSSLCertificateCache; @@ -284,15 +284,15 @@ int KSSLSocket::verifyCertificate() setMetaData("ssl_cipher", d->kssl->connectionInfo().getCipher()); setMetaData("ssl_cipher_desc", d->kssl->connectionInfo().getCipherDescription()); setMetaData("ssl_cipher_version", d->kssl->connectionInfo().getCipherVersion()); - setMetaData("ssl_cipher_used_bits", QString::number(d->kssl->connectionInfo().getCipherUsedBits())); - setMetaData("ssl_cipher_bits", QString::number(d->kssl->connectionInfo().getCipherBits())); + setMetaData("ssl_cipher_used_bits", TQString::number(d->kssl->connectionInfo().getCipherUsedBits())); + setMetaData("ssl_cipher_bits", TQString::number(d->kssl->connectionInfo().getCipherBits())); setMetaData("ssl_peer_ip", ourIp ); - QString errorStr; + TQString errorStr; for(KSSLCertificate::KSSLValidationList::ConstIterator it = ksvl.begin(); it != ksvl.end(); ++it) { - errorStr += QString::number(*it)+":"; + errorStr += TQString::number(*it)+":"; } setMetaData("ssl_cert_errors", errorStr); @@ -300,8 +300,8 @@ int KSSLSocket::verifyCertificate() if (pc.chain().isValid() && pc.chain().depth() > 1) { - QString theChain; - QPtrList chain = pc.chain().getChain(); + TQString theChain; + TQPtrList chain = pc.chain().getChain(); for (KSSLCertificate *c = chain.first(); c; c = chain.next()) { theChain += c->toString(); @@ -314,7 +314,7 @@ int KSSLSocket::verifyCertificate() setMetaData("ssl_peer_chain", ""); } - setMetaData("ssl_cert_state", QString::number(ksv)); + setMetaData("ssl_cert_state", TQString::number(ksv)); if (ksv == KSSLCertificate::Ok) { @@ -364,7 +364,7 @@ int KSSLSocket::verifyCertificate() { if (ksv == KSSLCertificate::InvalidHost) { - QString msg = i18n("The IP address of the host %1 " + TQString msg = i18n("The IP address of the host %1 " "does not match the one the " "certificate was issued to."); result = messageBox( KIO::SlaveBase::WarningYesNoCancel, @@ -375,7 +375,7 @@ int KSSLSocket::verifyCertificate() } else { - QString msg = i18n("The server certificate failed the " + TQString msg = i18n("The server certificate failed the " "authenticity test (%1)."); result = messageBox( KIO::SlaveBase::WarningYesNoCancel, msg.arg(ourHost), diff --git a/kopete/protocols/irc/libkirc/ksslsocket.h b/kopete/protocols/irc/libkirc/ksslsocket.h index 692d5288..79e3b70b 100644 --- a/kopete/protocols/irc/libkirc/ksslsocket.h +++ b/kopete/protocols/irc/libkirc/ksslsocket.h @@ -20,7 +20,7 @@ ************************************************************************* */ -#include +#include #include #include @@ -53,14 +53,14 @@ class KSSLSocket : public KExtendedSocket private: int verifyCertificate(); - int messageBox( KIO::SlaveBase::MessageBoxType type, const QString &text, - const QString &caption, const QString &buttonYes, const QString &buttonNo ); + int messageBox( KIO::SlaveBase::MessageBoxType type, const TQString &text, + const TQString &caption, const TQString &buttonYes, const TQString &buttonNo ); //Copied frm tcpslavebase to simply integrating their dialog function - void setMetaData( const QString &, const QVariant & ); - bool hasMetaData( const QString & ); - QString metaData( const QString & ); + void setMetaData( const TQString &, const TQVariant & ); + bool hasMetaData( const TQString & ); + TQString metaData( const TQString & ); KSSLSocketPrivate *d; }; -- cgit v1.2.1