diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
commit | 838baf3f99ec5ab81b063eb5449a3381d860f377 (patch) | |
tree | dd31abcfde08ca92e4623b8f50b3d762a87c997a /libkdegames/kgame/kmessageclient.cpp | |
parent | 2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff) | |
download | tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.tar.gz tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.zip |
TQt4 port kdegames
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1236074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdegames/kgame/kmessageclient.cpp')
-rw-r--r-- | libkdegames/kgame/kmessageclient.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/libkdegames/kgame/kmessageclient.cpp b/libkdegames/kgame/kmessageclient.cpp index e490a084..03a39df9 100644 --- a/libkdegames/kgame/kmessageclient.cpp +++ b/libkdegames/kgame/kmessageclient.cpp @@ -40,16 +40,16 @@ public: delete connection; } - Q_UINT32 adminID; - TQValueList <Q_UINT32> clientList; + TQ_UINT32 adminID; + TQValueList <TQ_UINT32> clientList; KMessageIO *connection; bool isLocked; TQValueList <TQByteArray> delayedMessages; }; -KMessageClient::KMessageClient (TQObject *parent, const char *name) - : TQObject (parent, name) +KMessageClient::KMessageClient (TQObject *tqparent, const char *name) + : TQObject (tqparent, name) { d = new KMessageClientPrivate (); d->isLocked = false; @@ -63,7 +63,7 @@ KMessageClient::~KMessageClient () // -- setServer stuff -void KMessageClient::setServer (const TQString &host, Q_UINT16 port) +void KMessageClient::setServer (const TQString &host, TQ_UINT16 port) { setServer (new KMessageSocket (host, port)); } @@ -95,7 +95,7 @@ void KMessageClient::setServer (KMessageIO *connection) // -- id stuff -Q_UINT32 KMessageClient::id () const +TQ_UINT32 KMessageClient::id () const { return (d->connection) ? d->connection->id () : 0; } @@ -105,12 +105,12 @@ bool KMessageClient::isAdmin () const return id() != 0 && id() == adminId(); } -Q_UINT32 KMessageClient::adminId () const +TQ_UINT32 KMessageClient::adminId () const { return d->adminID; } -const TQValueList <Q_UINT32> &KMessageClient::clientList() const +const TQValueList <TQ_UINT32> &KMessageClient::clientList() const { return d->clientList; } @@ -125,14 +125,14 @@ bool KMessageClient::isNetwork () const return isConnected() ? d->connection->isNetwork() : false; } -Q_UINT16 KMessageClient::peerPort () const +TQ_UINT16 KMessageClient::peerPort () const { return d->connection ? d->connection->peerPort() : 0; } TQString KMessageClient::peerName () const { - return d->connection ? d->connection->peerName() : TQString::fromLatin1("localhost"); + return d->connection ? d->connection->peerName() : TQString::tqfromLatin1("localhost"); } // --------------------- Sending messages @@ -154,26 +154,26 @@ void KMessageClient::sendBroadcast (const TQByteArray &msg) buffer.open (IO_WriteOnly); TQDataStream stream (&buffer); - stream << static_cast<Q_UINT32> ( KMessageServer::REQ_BROADCAST ); - buffer.TQIODevice::writeBlock (msg); + stream << static_cast<TQ_UINT32> ( KMessageServer::RETQ_BROADCAST ); + TQT_TQIODEVICE(&buffer)->writeBlock (msg); sendServerMessage (sendBuffer); } -void KMessageClient::sendForward (const TQByteArray &msg, const TQValueList <Q_UINT32> &clients) +void KMessageClient::sendForward (const TQByteArray &msg, const TQValueList <TQ_UINT32> &clients) { TQByteArray sendBuffer; TQBuffer buffer (sendBuffer); buffer.open (IO_WriteOnly); TQDataStream stream (&buffer); - stream << static_cast<Q_UINT32>( KMessageServer::REQ_FORWARD ) << clients; - buffer.TQIODevice::writeBlock (msg); + stream << static_cast<TQ_UINT32>( KMessageServer::RETQ_FORWARD ) << clients; + TQT_TQIODEVICE(&buffer)->writeBlock (msg); sendServerMessage (sendBuffer); } -void KMessageClient::sendForward (const TQByteArray &msg, Q_UINT32 client) +void KMessageClient::sendForward (const TQByteArray &msg, TQ_UINT32 client) { - sendForward (msg, TQValueList <Q_UINT32> () << client); + sendForward (msg, TQValueList <TQ_UINT32> () << client); } @@ -213,13 +213,13 @@ void KMessageClient::processMessage (const TQByteArray &msg) bool unknown = false; - Q_UINT32 messageID; + TQ_UINT32 messageID; in_stream >> messageID; switch (messageID) { case KMessageServer::MSG_BROADCAST: { - Q_UINT32 clientID; + TQ_UINT32 clientID; in_stream >> clientID; emit broadcastReceived (in_buffer.readAll(), clientID); } @@ -227,17 +227,17 @@ void KMessageClient::processMessage (const TQByteArray &msg) case KMessageServer::MSG_FORWARD: { - Q_UINT32 clientID; - TQValueList <Q_UINT32> receivers; - in_stream >> clientID >> receivers; - emit forwardReceived (in_buffer.readAll(), clientID, receivers); + TQ_UINT32 clientID; + TQValueList <TQ_UINT32> tqreceivers; + in_stream >> clientID >> tqreceivers; + emit forwardReceived (in_buffer.readAll(), clientID, tqreceivers); } break; case KMessageServer::ANS_CLIENT_ID: { bool old_admin = isAdmin(); - Q_UINT32 clientID; + TQ_UINT32 clientID; in_stream >> clientID; d->connection->setId (clientID); if (old_admin != isAdmin()) @@ -262,10 +262,10 @@ void KMessageClient::processMessage (const TQByteArray &msg) case KMessageServer::EVNT_CLIENT_CONNECTED: { - Q_UINT32 id; + TQ_UINT32 id; in_stream >> id; - if (d->clientList.contains (id)) + if (d->clientList.tqcontains (id)) kdWarning (11001) << k_funcinfo << ": Adding a client that already existed!" << endl; else d->clientList.append (id); @@ -276,11 +276,11 @@ void KMessageClient::processMessage (const TQByteArray &msg) case KMessageServer::EVNT_CLIENT_DISCONNECTED: { - Q_UINT32 id; - Q_INT8 broken; + TQ_UINT32 id; + TQ_INT8 broken; in_stream >> id >> broken; - if (!d->clientList.contains (id)) + if (!d->clientList.tqcontains (id)) kdWarning (11001) << k_funcinfo << ": Removing a client that doesn't exist!" << endl; else d->clientList.remove (id); |