diff options
Diffstat (limited to 'libkdegames/kgame/kmessageclient.cpp')
-rw-r--r-- | libkdegames/kgame/kmessageclient.cpp | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/libkdegames/kgame/kmessageclient.cpp b/libkdegames/kgame/kmessageclient.cpp index ed9cc966..e490a084 100644 --- a/libkdegames/kgame/kmessageclient.cpp +++ b/libkdegames/kgame/kmessageclient.cpp @@ -20,8 +20,8 @@ #include <kdebug.h> #include <stdio.h> -#include <qbuffer.h> -#include <qtimer.h> +#include <tqbuffer.h> +#include <tqtimer.h> #include "kmessageio.h" #include "kmessageserver.h" @@ -41,15 +41,15 @@ public: } Q_UINT32 adminID; - QValueList <Q_UINT32> clientList; + TQValueList <Q_UINT32> clientList; KMessageIO *connection; bool isLocked; - QValueList <QByteArray> delayedMessages; + TQValueList <TQByteArray> delayedMessages; }; -KMessageClient::KMessageClient (QObject *parent, const char *name) - : QObject (parent, name) +KMessageClient::KMessageClient (TQObject *parent, const char *name) + : TQObject (parent, name) { d = new KMessageClientPrivate (); d->isLocked = false; @@ -63,7 +63,7 @@ KMessageClient::~KMessageClient () // -- setServer stuff -void KMessageClient::setServer (const QString &host, Q_UINT16 port) +void KMessageClient::setServer (const TQString &host, Q_UINT16 port) { setServer (new KMessageSocket (host, port)); } @@ -86,10 +86,10 @@ void KMessageClient::setServer (KMessageIO *connection) d->connection = connection; if (connection ) { - connect (connection, SIGNAL (received(const QByteArray &)), - this, SLOT (processIncomingMessage(const QByteArray &))); - connect (connection, SIGNAL (connectionBroken()), - this, SLOT (removeBrokenConnection ())); + connect (connection, TQT_SIGNAL (received(const TQByteArray &)), + this, TQT_SLOT (processIncomingMessage(const TQByteArray &))); + connect (connection, TQT_SIGNAL (connectionBroken()), + this, TQT_SLOT (removeBrokenConnection ())); } } @@ -110,7 +110,7 @@ Q_UINT32 KMessageClient::adminId () const return d->adminID; } -const QValueList <Q_UINT32> &KMessageClient::clientList() const +const TQValueList <Q_UINT32> &KMessageClient::clientList() const { return d->clientList; } @@ -130,14 +130,14 @@ Q_UINT16 KMessageClient::peerPort () const return d->connection ? d->connection->peerPort() : 0; } -QString KMessageClient::peerName () const +TQString KMessageClient::peerName () const { - return d->connection ? d->connection->peerName() : QString::fromLatin1("localhost"); + return d->connection ? d->connection->peerName() : TQString::fromLatin1("localhost"); } // --------------------- Sending messages -void KMessageClient::sendServerMessage (const QByteArray &msg) +void KMessageClient::sendServerMessage (const TQByteArray &msg) { if (!d->connection) { @@ -147,39 +147,39 @@ void KMessageClient::sendServerMessage (const QByteArray &msg) d->connection->send (msg); } -void KMessageClient::sendBroadcast (const QByteArray &msg) +void KMessageClient::sendBroadcast (const TQByteArray &msg) { - QByteArray sendBuffer; - QBuffer buffer (sendBuffer); + TQByteArray sendBuffer; + TQBuffer buffer (sendBuffer); buffer.open (IO_WriteOnly); - QDataStream stream (&buffer); + TQDataStream stream (&buffer); stream << static_cast<Q_UINT32> ( KMessageServer::REQ_BROADCAST ); - buffer.QIODevice::writeBlock (msg); + buffer.TQIODevice::writeBlock (msg); sendServerMessage (sendBuffer); } -void KMessageClient::sendForward (const QByteArray &msg, const QValueList <Q_UINT32> &clients) +void KMessageClient::sendForward (const TQByteArray &msg, const TQValueList <Q_UINT32> &clients) { - QByteArray sendBuffer; - QBuffer buffer (sendBuffer); + TQByteArray sendBuffer; + TQBuffer buffer (sendBuffer); buffer.open (IO_WriteOnly); - QDataStream stream (&buffer); + TQDataStream stream (&buffer); stream << static_cast<Q_UINT32>( KMessageServer::REQ_FORWARD ) << clients; - buffer.QIODevice::writeBlock (msg); + buffer.TQIODevice::writeBlock (msg); sendServerMessage (sendBuffer); } -void KMessageClient::sendForward (const QByteArray &msg, Q_UINT32 client) +void KMessageClient::sendForward (const TQByteArray &msg, Q_UINT32 client) { - sendForward (msg, QValueList <Q_UINT32> () << client); + sendForward (msg, TQValueList <Q_UINT32> () << client); } // --------------------- Receiving and processing messages -void KMessageClient::processIncomingMessage (const QByteArray &msg) +void KMessageClient::processIncomingMessage (const TQByteArray &msg) { if (d->isLocked) { @@ -189,7 +189,7 @@ void KMessageClient::processIncomingMessage (const QByteArray &msg) if (d->delayedMessages.count() > 0) { d->delayedMessages.append (msg); - QByteArray first = d->delayedMessages.front(); + TQByteArray first = d->delayedMessages.front(); d->delayedMessages.pop_front(); processMessage (first); } @@ -199,16 +199,16 @@ void KMessageClient::processIncomingMessage (const QByteArray &msg) } } -void KMessageClient::processMessage (const QByteArray &msg) +void KMessageClient::processMessage (const TQByteArray &msg) { if (d->isLocked) { // must NOT happen, since we check in processIncomingMessage as well as in processFirstMessage d->delayedMessages.append(msg); return; } - QBuffer in_buffer (msg); + TQBuffer in_buffer (msg); in_buffer.open (IO_ReadOnly); - QDataStream in_stream (&in_buffer); + TQDataStream in_stream (&in_buffer); bool unknown = false; @@ -228,7 +228,7 @@ void KMessageClient::processMessage (const QByteArray &msg) case KMessageServer::MSG_FORWARD: { Q_UINT32 clientID; - QValueList <Q_UINT32> receivers; + TQValueList <Q_UINT32> receivers; in_stream >> clientID >> receivers; emit forwardReceived (in_buffer.readAll(), clientID, receivers); } @@ -313,7 +313,7 @@ void KMessageClient::processFirstMessage() kdDebug(11001) << k_funcinfo << ": no messages delayed" << endl; return; } - QByteArray first = d->delayedMessages.front(); + TQByteArray first = d->delayedMessages.front(); d->delayedMessages.pop_front(); processMessage (first); } @@ -321,8 +321,8 @@ void KMessageClient::processFirstMessage() void KMessageClient::removeBrokenConnection () { kdDebug (11001) << k_funcinfo << ": timer single shot for removeBrokenConnection"<<this << endl; - // MH We cannot directly delete the socket. otherwise QSocket crashes - QTimer::singleShot( 0, this, SLOT(removeBrokenConnection2()) ); + // MH We cannot directly delete the socket. otherwise TQSocket crashes + TQTimer::singleShot( 0, this, TQT_SLOT(removeBrokenConnection2()) ); return; } @@ -361,7 +361,7 @@ void KMessageClient::unlock () d->isLocked = false; for (unsigned int i = 0; i < d->delayedMessages.count(); i++) { - QTimer::singleShot(0, this, SLOT(processFirstMessage())); + TQTimer::singleShot(0, this, TQT_SLOT(processFirstMessage())); } } |