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 /libksirtet/lib/types.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 'libksirtet/lib/types.cpp')
-rw-r--r-- | libksirtet/lib/types.cpp | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/libksirtet/lib/types.cpp b/libksirtet/lib/types.cpp index ad3dbc9b..86f7bfba 100644 --- a/libksirtet/lib/types.cpp +++ b/libksirtet/lib/types.cpp @@ -20,30 +20,30 @@ TQString cId::errorMessage(const cId &id) const TQString str = i18n("\nServer: \"%1\"\nClient: \"%2\""); switch (state) { - case Accepted: return TQString::null; + case Accepted: return TQString(); case LibIdClash: return i18n("The MultiPlayer library of the server is incompatible") - + str.arg(libId).arg(id.libId); + + str.tqarg(libId).tqarg(id.libId); case GameNameClash: return i18n("Trying to connect a server for another game type") - + str.arg(gameName).arg(id.gameName); + + str.tqarg(gameName).tqarg(id.gameName); case GameIdClash: return i18n("The server game version is incompatible") - + str.arg(gameId).arg(id.gameId); + + str.tqarg(gameId).tqarg(id.gameId); } Q_ASSERT(0); - return TQString::null; + return TQString(); } TQDataStream &operator << (TQDataStream &s, const cId &id) { - s << id.libId << id.gameName << id.gameId << (Q_UINT8)id.state; + s << id.libId << id.gameName << id.gameId << (TQ_UINT8)id.state; return s; } TQDataStream &operator >> (TQDataStream &s, cId &id) { - Q_UINT8 state; + TQ_UINT8 state; s >> id.libId >> id.gameName >> id.gameId >> state; id.state = (cId::State)state; return s; @@ -52,13 +52,13 @@ TQDataStream &operator >> (TQDataStream &s, cId &id) //----------------------------------------------------------------------------- TQDataStream &operator << (TQDataStream &s, const MeetingMsgFlag &f) { - s << (Q_UINT8)f; + s << (TQ_UINT8)f; return s; } TQDataStream &operator >> (TQDataStream &s, MeetingMsgFlag &f) { - Q_UINT8 i; + TQ_UINT8 i; s >> i; f = (MeetingMsgFlag)i; return s; } @@ -66,13 +66,13 @@ TQDataStream &operator >> (TQDataStream &s, MeetingMsgFlag &f) //----------------------------------------------------------------------------- TQDataStream &operator << (TQDataStream &s, const TextInfo &ti) { - s << (Q_UINT32)ti.i << ti.text; + s << (TQ_UINT32)ti.i << ti.text; return s; } TQDataStream &operator >> (TQDataStream &s, TextInfo &ti) { - Q_UINT32 i; + TQ_UINT32 i; s >> i >> ti.text; ti.i = i; return s; } @@ -80,13 +80,13 @@ TQDataStream &operator >> (TQDataStream &s, TextInfo &ti) //----------------------------------------------------------------------------- TQDataStream &operator << (TQDataStream &s, const MeetingCheckBox::Type &t) { - s << (Q_UINT8)t; + s << (TQ_UINT8)t; return s; } TQDataStream &operator >> (TQDataStream &s, MeetingCheckBox::Type &t) { - Q_UINT8 i; + TQ_UINT8 i; s >> i; t = (MeetingCheckBox::Type)i; return s; } @@ -94,13 +94,13 @@ TQDataStream &operator >> (TQDataStream &s, MeetingCheckBox::Type &t) //----------------------------------------------------------------------------- TQDataStream &operator << (TQDataStream &s, const TypeInfo &ti) { - s << (Q_UINT32)ti.i << ti.type; + s << (TQ_UINT32)ti.i << ti.type; return s; } TQDataStream &operator >> (TQDataStream &s, TypeInfo &ti) { - Q_UINT32 i; + TQ_UINT32 i; s >> i >> ti.type; ti.i = i; return s; } @@ -108,13 +108,13 @@ TQDataStream &operator >> (TQDataStream &s, TypeInfo &ti) //----------------------------------------------------------------------------- TQDataStream &operator << (TQDataStream &s, const BoardData &bd) { - s << (Q_UINT8)bd.type << bd.name; + s << (TQ_UINT8)bd.type << bd.name; return s; } TQDataStream &operator >> (TQDataStream &s, BoardData &bd) { - Q_UINT8 i; + TQ_UINT8 i; s >> i >> bd.name; bd.type = (PlayerComboBox::Type)i; return s; @@ -136,13 +136,14 @@ TQDataStream &operator >> (TQDataStream &s, ExtData &ed) //----------------------------------------------------------------------------- TQDataStream &operator << (TQDataStream &s, const MeetingLineData &pld) { - s << pld.ed << (Q_UINT8)pld.own; + s << pld.ed; + s << (TQ_UINT8)pld.own; return s; } TQDataStream &operator >> (TQDataStream &s, MeetingLineData &pld) { - Q_UINT8 b; + TQ_UINT8 b; s >> pld.ed >> b; pld.own = b; return s; } @@ -150,13 +151,13 @@ TQDataStream &operator >> (TQDataStream &s, MeetingLineData &pld) //----------------------------------------------------------------------------- TQDataStream &operator << (TQDataStream &s, const MetaFlag &f) { - s << (Q_UINT8)f; + s << (TQ_UINT8)f; return s; } TQDataStream &operator >> (TQDataStream &s, MetaFlag &f) { - Q_UINT8 i; + TQ_UINT8 i; s >> i; f = (MetaFlag)i; return s; } @@ -168,25 +169,25 @@ Stream::Stream(int _mode) { setDevice(&buf); Q_ASSERT( _mode==IO_ReadOnly || _mode==IO_WriteOnly ); - buf.open(_mode); + buf.open((TQIODevice_OpenModeFlag)_mode); } void Stream::clear() { buf.close(); - buf.open(mode | IO_Truncate); + buf.open((TQIODevice_OpenModeFlag)(mode | IO_Truncate)); } void Stream::setArray(TQByteArray a) { buf.close(); buf.setBuffer(a); - buf.open(mode); + buf.open((TQIODevice_OpenModeFlag)mode); } bool ReadingStream::readOk() { - return ( buf.status()==IO_Ok ); + return ( TQT_TQIODEVICE(&buf)->status()==IO_Ok ); } void ReadingStream::clearRead() |