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 | |
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')
28 files changed, 166 insertions, 146 deletions
diff --git a/libksirtet/lib/defines.cpp b/libksirtet/lib/defines.cpp index baf91083..3b3ec229 100644 --- a/libksirtet/lib/defines.cpp +++ b/libksirtet/lib/defines.cpp @@ -2,12 +2,12 @@ #include <klocale.h> -void errorBox(const TQString &msg1, const TQString &msg2, TQWidget *parent) +void errorBox(const TQString &msg1, const TQString &msg2, TQWidget *tqparent) { TQString str; if ( msg2.isNull() ) str = msg1; - else str = i18n("%1:\n%2").arg(msg1).arg(msg2); - KMessageBox::error(parent, str); + else str = i18n("%1:\n%2").tqarg(msg1).tqarg(msg2); + KMessageBox::error(tqparent, str); } TQString socketError(const KExtendedSocket *socket) @@ -16,9 +16,9 @@ TQString socketError(const KExtendedSocket *socket) } bool checkSocket(int res, const KExtendedSocket *socket, - const TQString &msg, TQWidget *parent) + const TQString &msg, TQWidget *tqparent) { if ( res==0 ) return false; - errorBox(msg, socketError(socket), parent); + errorBox(msg, socketError(socket), tqparent); return true; } diff --git a/libksirtet/lib/defines.h b/libksirtet/lib/defines.h index a6728a38..db936b10 100644 --- a/libksirtet/lib/defines.h +++ b/libksirtet/lib/defines.h @@ -16,10 +16,10 @@ #define MP_SERVER_ADDRESS "Server address" #define MP_PORT "Port" -void errorBox(const TQString &msg1, const TQString &msg2, TQWidget *parent); +void errorBox(const TQString &msg1, const TQString &msg2, TQWidget *tqparent); TQString socketError(const KExtendedSocket *socket); bool checkSocket(int res, const KExtendedSocket *, - const TQString &msg, TQWidget *parent); + const TQString &msg, TQWidget *tqparent); #define R_ERROR_BOX(msg1, msg2) { \ errorBox(msg1, msg2, this); \ diff --git a/libksirtet/lib/internal.cpp b/libksirtet/lib/internal.cpp index f8b34085..1622a2fa 100644 --- a/libksirtet/lib/internal.cpp +++ b/libksirtet/lib/internal.cpp @@ -111,7 +111,7 @@ TQString Network::playerName(uint i) const if ( i<(l+ll) ) return remotes[k].names[i-l]; l += ll; } - return TQString::null; // dummy + return TQString(); // dummy } IOBuffer *Network::ioBuffer(uint i) const diff --git a/libksirtet/lib/internal.h b/libksirtet/lib/internal.h index cc74fbc4..038656eb 100644 --- a/libksirtet/lib/internal.h +++ b/libksirtet/lib/internal.h @@ -59,6 +59,7 @@ class Server class Network : public TQObject, public Local { Q_OBJECT + TQ_OBJECT public: Network(MPInterface *_interface, TQValueList<MPInterface::Data> &_boards, @@ -93,6 +94,7 @@ class Network : public TQObject, public Local class LocalServer : public TQObject, public Local, public Server { Q_OBJECT + TQ_OBJECT public: LocalServer(MPInterface *_interface, @@ -112,6 +114,7 @@ class LocalServer : public TQObject, public Local, public Server class NetworkServer : public Network, public Server { Q_OBJECT + TQ_OBJECT public: NetworkServer(MPInterface *_interface, @@ -137,6 +140,7 @@ class NetworkServer : public Network, public Server class Client : public Network { Q_OBJECT + TQ_OBJECT public: Client(MPInterface *_interface, TQValueList<MPInterface::Data> &_boards, diff --git a/libksirtet/lib/keys.cpp b/libksirtet/lib/keys.cpp index 8433503f..fadb8e5f 100644 --- a/libksirtet/lib/keys.cpp +++ b/libksirtet/lib/keys.cpp @@ -7,8 +7,8 @@ KeyData::KeyData(uint maxNb, uint nbActions, const ActionData *data, - TQObject *parent) - : TQObject(parent), _maxNb(maxNb) + TQObject *tqparent) + : TQObject(tqparent), _maxNb(maxNb) { _data.duplicate(data, nbActions); @@ -46,10 +46,10 @@ void KeyData::createActionCollection(uint index, TQWidget *receiver) _cols[index] = new KActionCollection(receiver, this); for (uint k=0; k<_data.size(); k++) { TQString label = i18n(_data[k].label); - TQString name = TQString("%2 %3").arg(index+1).arg(_data[k].name); + TQString name = TQString("%2 %3").tqarg(index+1).tqarg(_data[k].name); const char *slot = (_data[k].slotRelease ? 0 : _data[k].slot); KAction *a = new KAction(label, _keycodes[_cols.size()-1][index][k], - receiver, slot, _cols[index], name.utf8()); + TQT_TQOBJECT(receiver), slot, _cols[index], name.utf8()); a->setEnabled(false); if ( slot==0 ) { SpecialData data; @@ -68,7 +68,7 @@ void KeyData::setEnabled(uint index, bool enabled) { for (uint k=0; k<_cols[index]->count(); k++) { TQMap<KAction *, SpecialData>::Iterator it = - _specActions.find(_cols[index]->action(k)); + _specActions.tqfind(_cols[index]->action(k)); if ( it==_specActions.end() ) _cols[index]->action(k)->setEnabled(enabled); else (*it).enabled = enabled; @@ -78,8 +78,8 @@ void KeyData::setEnabled(uint index, bool enabled) void KeyData::addKeys(KKeyDialog &d) { for (uint i=0; i<_cols.size(); i++) - d.insert(_cols[i], i18n("Shortcuts for player #%1/%2").arg(i+1) - .arg(_cols.size())); + d.insert(_cols[i], i18n("Shortcuts for player #%1/%2").tqarg(i+1) + .tqarg(_cols.size())); } void KeyData::save() diff --git a/libksirtet/lib/keys.h b/libksirtet/lib/keys.h index 62bb818c..16e25118 100644 --- a/libksirtet/lib/keys.h +++ b/libksirtet/lib/keys.h @@ -7,12 +7,13 @@ #include "mp_interface.h" -class KeyData : public QObject +class KeyData : public TQObject { Q_OBJECT + TQ_OBJECT public: KeyData(uint maxNb, uint nbActions, const ActionData *, - TQObject *parent); + TQObject *tqparent); void setKeycodes(uint nb, uint i, const int *keycodes); void setCurrentNb(uint nb); @@ -36,7 +37,7 @@ class KeyData : public QObject TQMap<KAction *, SpecialData> _specActions; TQString group() const - { return TQString("Keys (%1 humans)").arg(_cols.size()); } + { return TQString("Keys (%1 humans)").tqarg(_cols.size()); } }; #endif // KEYS_H diff --git a/libksirtet/lib/meeting.cpp b/libksirtet/lib/meeting.cpp index 71df0e4d..8730fb96 100644 --- a/libksirtet/lib/meeting.cpp +++ b/libksirtet/lib/meeting.cpp @@ -14,16 +14,16 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, MPOptionWidget *option, - bool _server, TQWidget *parent, const char * name) + bool _server, TQWidget *tqparent, const char * name) : KDialogBase(Plain, i18n("Network Meeting"), (_server ? Ok|Cancel|Help : Cancel|Help), - (_server ? Ok : Cancel), parent, name), + (_server ? Ok : Cancel), tqparent, name), server(_server), ow(option), id(_id), socketRemoved(FALSE) { sm.append(socket, SocketManager::ReadWrite); sm[0]->notifier()->setEnabled(TRUE); -/* top layout */ +/* top tqlayout */ TQVBoxLayout *top = new TQVBoxLayout(plainPage(), spacingHint()); top->setResizeMode(TQLayout::Fixed); @@ -37,7 +37,7 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, top->addWidget(wl); labWait = new TQLabel(i18n("Waiting for clients"), plainPage()); - labWait->setAlignment(AlignCenter); + labWait->tqsetAlignment(AlignCenter); top->addWidget(labWait); // options widget @@ -68,7 +68,7 @@ void NetMeeting::appendLine(const MeetingLineData &pld, bool server) if (pld.own) connect(pl, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(textChanged(const TQString &))); else message(i18n("A new client has just arrived (#%1)") - .arg(wl->size()+1)); + .tqarg(wl->size()+1)); pl->setData(pld.ed); connect(pl, TQT_SIGNAL(typeChanged(MeetingCheckBox::Type)), TQT_SLOT(typeChanged(MeetingCheckBox::Type))); @@ -136,7 +136,7 @@ void NetMeeting::cleanReject(const TQString &str) // Read incoming data void NetMeeting::readNotifier(int fd) { - int i = sm.find(fd); + int i = sm.tqfind(fd); Q_ASSERT( i!=-1 ); switch ( sm[i]->read() ) { case -1: readError(i); break; @@ -213,8 +213,8 @@ void NetMeeting::message(const TQString &str) /** ServerNetMeeting *********************************************************/ ServerNetMeeting::ServerNetMeeting(const cId &id, const RemoteHostData &r, MPOptionWidget *option, - TQPtrList<RemoteHostData> &arhd, TQWidget *parent, const char * name) -: NetMeeting(id, r.socket, option, TRUE, parent, name), rhd(arhd) + TQPtrList<RemoteHostData> &arhd, TQWidget *tqparent, const char * name) +: NetMeeting(id, r.socket, option, TRUE, tqparent, name), rhd(arhd) { connect(sm[0]->notifier(), TQT_SIGNAL(activated(int)), TQT_SLOT(newHost(int))); players.append(Accepted); // server @@ -241,7 +241,7 @@ void ServerNetMeeting::writeToAll(uint i) void ServerNetMeeting::netError(uint i, const TQString &type) { Q_ASSERT( i!=0 ); - disconnectHost(i, i18n("%1 client #%2: disconnect it").arg(type).arg(i)); + disconnectHost(i, i18n("%1 client #%2: disconnect it").tqarg(type).tqarg(i)); } void ServerNetMeeting::disconnectHost(uint i, const TQString &str) @@ -265,7 +265,7 @@ void ServerNetMeeting::newHost(int) int res = sm[0]->accept(s); if ( res!=0 ) { message(i18n("Failed to accept incoming client:\n%1") - .arg(socketError(s))); + .tqarg(socketError(s))); return; } players.append(NewPlayer); @@ -301,7 +301,7 @@ void ServerNetMeeting::idFlag(uint i) void ServerNetMeeting::endFlag(uint i) { - disconnectHost(i, i18n("Client #%1 has left").arg(i)); + disconnectHost(i, i18n("Client #%1 has left").tqarg(i)); } void ServerNetMeeting::newFlag(uint i) @@ -421,7 +421,7 @@ void ServerNetMeeting::accept() // send play message to client (Play flag // + bool [accepted/rejected]) - sm[0]->writingStream() << PlayFlag << (Q_UINT8)willPlay; + sm[0]->writingStream() << PlayFlag << (TQ_UINT8)willPlay; // if write failed and the client is not playing : silently // put it aside ... if ( !sm[0]->write() && willPlay ) { @@ -448,8 +448,8 @@ void ServerNetMeeting::optionsChanged() /** ClientNetMeeting *********************************************************/ ClientNetMeeting::ClientNetMeeting(const cId &id, const RemoteHostData &rhd, MPOptionWidget *option, - TQWidget *parent, const char * name) -: NetMeeting(id, rhd.socket, option, FALSE, parent, name), bds(rhd.bds) + TQWidget *tqparent, const char * name) +: NetMeeting(id, rhd.socket, option, FALSE, tqparent, name), bds(rhd.bds) { connect(sm[0]->notifier(), TQT_SIGNAL(activated(int)), TQT_SLOT(readNotifier(int))); @@ -462,7 +462,7 @@ ClientNetMeeting::ClientNetMeeting(const cId &id, void ClientNetMeeting::netError(uint, const TQString &str) { - cleanReject(i18n("%1 server: aborting connection.").arg(str)); + cleanReject(i18n("%1 server: aborting connection.").tqarg(str)); } void ClientNetMeeting::writeToAll(uint) @@ -529,7 +529,7 @@ void ClientNetMeeting::delFlag(uint) sm[0]->readingStream() >> k; CHECK_READ(0); removeLine(k-1); - message(i18n("Client %1 has left").arg(k)); + message(i18n("Client %1 has left").tqarg(k)); } void ClientNetMeeting::textChanged(const TQString &text) @@ -549,7 +549,7 @@ void ClientNetMeeting::typeChanged(MeetingCheckBox::Type type) void ClientNetMeeting::playFlag(uint) { // receive accept or reject (bool) - Q_UINT8 i; + TQ_UINT8 i; sm[0]->readingStream() >> i; CHECK_READ(0); sm[0]->notifier()->setEnabled(false); diff --git a/libksirtet/lib/meeting.h b/libksirtet/lib/meeting.h index 1e9ba267..cc8356fc 100644 --- a/libksirtet/lib/meeting.h +++ b/libksirtet/lib/meeting.h @@ -13,12 +13,13 @@ class MPOptionWidget; class NetMeeting : public KDialogBase { Q_OBJECT + TQ_OBJECT public: // "gameName" and "gameId" are TQByteArray because they are // used for ID comparing between games. NetMeeting(const cId &id, Socket *, MPOptionWidget *option, bool server, - TQWidget *parent = 0, const char * name = 0); + TQWidget *tqparent = 0, const char * name = 0); virtual ~NetMeeting(); protected slots: @@ -44,7 +45,7 @@ class NetMeeting : public KDialogBase void setType(const TypeInfo &ti); void setText(const TextInfo &ti); - void cleanReject(const TQString &str = TQString::null); + void cleanReject(const TQString &str = TQString()); bool checkState(uint i, PlayerState s); bool checkAndSetState(uint i, PlayerState os, PlayerState ns); bool ready() const; @@ -77,12 +78,13 @@ class NetMeeting : public KDialogBase class ServerNetMeeting : public NetMeeting { Q_OBJECT + TQ_OBJECT public: ServerNetMeeting(const cId &id, const RemoteHostData &rhd, MPOptionWidget *options, TQPtrList<RemoteHostData> &arhd, - TQWidget *parent = 0, const char * name = 0); + TQWidget *tqparent = 0, const char * name = 0); private slots: void newHost(int); @@ -108,11 +110,12 @@ class ServerNetMeeting : public NetMeeting class ClientNetMeeting : public NetMeeting { Q_OBJECT + TQ_OBJECT public: ClientNetMeeting(const cId &id, const RemoteHostData &rhd, MPOptionWidget *options, - TQWidget *parent = 0, const char * name = 0); + TQWidget *tqparent = 0, const char * name = 0); private slots: void textChanged(const TQString &text); diff --git a/libksirtet/lib/miscui.cpp b/libksirtet/lib/miscui.cpp index dde70adb..7bc8e48b 100644 --- a/libksirtet/lib/miscui.cpp +++ b/libksirtet/lib/miscui.cpp @@ -8,8 +8,8 @@ //----------------------------------------------------------------------------- MeetingCheckBox::MeetingCheckBox(Type type, bool owner, bool server, - TQWidget *parent) - : TQWidget(parent, "meeting_check_box") + TQWidget *tqparent) + : TQWidget(tqparent, "meeting_check_box") { TQVBoxLayout *vbox = new TQVBoxLayout(this); @@ -46,8 +46,8 @@ void MeetingCheckBox::changedSlot() //----------------------------------------------------------------------------- PlayerComboBox::PlayerComboBox(Type type, bool canBeEmpty, bool acceptAI, - TQWidget *parent) - : TQComboBox(parent, "player_combo_box") + TQWidget *tqparent) + : TQComboBox(tqparent, "player_combo_box") { insertItem(i18n("Human")); if (acceptAI) insertItem(i18n("AI")); diff --git a/libksirtet/lib/miscui.h b/libksirtet/lib/miscui.h index fb40e0ec..3bc7fd32 100644 --- a/libksirtet/lib/miscui.h +++ b/libksirtet/lib/miscui.h @@ -6,12 +6,13 @@ //----------------------------------------------------------------------------- -class MeetingCheckBox : public QWidget +class MeetingCheckBox : public TQWidget { Q_OBJECT + TQ_OBJECT public: enum Type { Ready, NotReady, Excluded }; - MeetingCheckBox(Type, bool owner, bool server, TQWidget *parent); + MeetingCheckBox(Type, bool owner, bool server, TQWidget *tqparent); void setType(Type); Type type() const; @@ -27,12 +28,13 @@ class MeetingCheckBox : public QWidget }; //----------------------------------------------------------------------------- -class PlayerComboBox : public QComboBox +class PlayerComboBox : public TQComboBox { Q_OBJECT + TQ_OBJECT public: enum Type { Human = 0, AI, None }; - PlayerComboBox(Type, bool canBeNone, bool acceptAI, TQWidget *parent); + PlayerComboBox(Type, bool canBeNone, bool acceptAI, TQWidget *tqparent); Type type() const { return (Type)currentItem(); } diff --git a/libksirtet/lib/mp_board.h b/libksirtet/lib/mp_board.h index 5e84825c..2578e927 100644 --- a/libksirtet/lib/mp_board.h +++ b/libksirtet/lib/mp_board.h @@ -7,13 +7,14 @@ * The MP_Board class is the base widget from which each individual * board should inheritate ; you must implement its virtual methods. */ -class MPBoard : public QWidget +class MPBoard : public TQWidget { Q_OBJECT + TQ_OBJECT public: - MPBoard(TQWidget *parent, const char *name=0) - : TQWidget(parent, name) {} + MPBoard(TQWidget *tqparent, const char *name=0) + : TQWidget(tqparent, name) {} virtual ~MPBoard() {} /** diff --git a/libksirtet/lib/mp_interface.cpp b/libksirtet/lib/mp_interface.cpp index cfe06cd0..6683ba00 100644 --- a/libksirtet/lib/mp_interface.cpp +++ b/libksirtet/lib/mp_interface.cpp @@ -21,15 +21,15 @@ /*****************************************************************************/ MPInterface::MPInterface(const MPGameInfo &_gameInfo, uint nbActions, const ActionData *data, - TQWidget *parent, const char *name) -: TQWidget(parent, name), internal(0), gameInfo(_gameInfo), nbLocalHumans(0) + TQWidget *tqparent, const char *name) +: TQWidget(tqparent, name), internal(0), gameInfo(_gameInfo), nbLocalHumans(0) { Q_ASSERT( gameInfo.maxNbLocalPlayers>=1 ); hbl = new TQHBoxLayout(this, 0, 5); hbl->setResizeMode( TQLayout::Fixed ); - _keyData = new KeyData(gameInfo.maxNbLocalPlayers, nbActions, data, this); + _keyData = new KeyData(gameInfo.maxNbLocalPlayers, nbActions, data, TQT_TQOBJECT(this)); } MPInterface::~MPInterface() @@ -98,16 +98,16 @@ void MPInterface::specialLocalGame(uint nbHumans, uint nbAIs) KConfigGroupSaver cg(kapp->config(), MP_GROUP); for (uint i=0; i<(nbHumans+nbAIs); i++) { bd.type = (i<nbHumans ? PlayerComboBox::Human : PlayerComboBox::AI); - bd.name = TQString::null; + bd.name = TQString(); t = (PlayerComboBox::Type) - cg.config()->readNumEntry(TQString(MP_PLAYER_TYPE).arg(i), + cg.config()->readNumEntry(TQString(MP_PLAYER_TYPE).tqarg(i), PlayerComboBox::None); if ( bd.type==t ) - bd.name = cg.config()->readEntry(TQString(MP_PLAYER_NAME).arg(i), - TQString::null); + bd.name = cg.config()->readEntry(TQString(MP_PLAYER_NAME).tqarg(i), + TQString()); if ( bd.name.isNull() ) - bd.name = (i<nbHumans ? i18n("Human %1").arg(i+1) - : i18n("AI %1").arg(i-nbHumans+1)); + bd.name = (i<nbHumans ? i18n("Human %1").tqarg(i+1) + : i18n("AI %1").tqarg(i-nbHumans+1)); cd.rhd.bds += bd; } cd.server = TRUE; @@ -252,7 +252,7 @@ void MPInterface::immediateWrite() void MPInterface::hostDisconnected(uint, const TQString &msg) { - errorBox(msg, TQString::null, this); + errorBox(msg, TQString(), this); if ( !disconnected ) { // to avoid multiple calls disconnected = TRUE; diff --git a/libksirtet/lib/mp_interface.h b/libksirtet/lib/mp_interface.h index dbd26869..ea70736f 100644 --- a/libksirtet/lib/mp_interface.h +++ b/libksirtet/lib/mp_interface.h @@ -73,16 +73,17 @@ typedef struct { * easily with threads but I have no experience with thread programming * and not all people have thread libraries and a thread-safe system. */ -class MPInterface : public QWidget +class MPInterface : public TQWidget { Q_OBJECT + TQ_OBJECT public: /** Constructor which takes a MPGameInfo struct as parameter. */ MPInterface(const MPGameInfo &gameInfo, uint nbActions, const ActionData *data, - TQWidget *parent = 0, const char *name = 0); + TQWidget *tqparent = 0, const char *name = 0); virtual ~MPInterface(); public slots: diff --git a/libksirtet/lib/mp_option.h b/libksirtet/lib/mp_option.h index 2db2eacf..3d7468b5 100644 --- a/libksirtet/lib/mp_option.h +++ b/libksirtet/lib/mp_option.h @@ -28,17 +28,18 @@ * changed. In addition you'll need to implement the method @ref #saveData * to save the configuration in the config file ; so that it will be available * for the initialisation of @ref LocalBoard. - * It seems a good idea that the widget have the same layout + * It seems a good idea that the widget have the same tqlayout * on both (server and client) sides but with the inner widgets all disabled * on the client side. */ -class MPOptionWidget : public QWidget +class MPOptionWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - MPOptionWidget(bool Server, TQWidget *parent = 0, const char *name = 0) - : TQWidget(parent, name), server(Server) {} + MPOptionWidget(bool Server, TQWidget *tqparent = 0, const char *name = 0) + : TQWidget(tqparent, name), server(Server) {} virtual ~MPOptionWidget() {} bool isServer() const { return server; } diff --git a/libksirtet/lib/mp_simple_board.h b/libksirtet/lib/mp_simple_board.h index d9a681f7..24a7654f 100644 --- a/libksirtet/lib/mp_simple_board.h +++ b/libksirtet/lib/mp_simple_board.h @@ -9,10 +9,11 @@ class KDE_EXPORT MPSimpleBoard : public MPBoard { Q_OBJECT + TQ_OBJECT public: - MPSimpleBoard(TQWidget *parent = 0, const char *name = 0) - : MPBoard(parent, name) {} + MPSimpleBoard(TQWidget *tqparent = 0, const char *name = 0) + : MPBoard(tqparent, name) {} virtual ~MPSimpleBoard() {} void init(bool AI, bool multiplayers, bool server, bool first, diff --git a/libksirtet/lib/mp_simple_interface.cpp b/libksirtet/lib/mp_simple_interface.cpp index 1b83be40..e863b069 100644 --- a/libksirtet/lib/mp_simple_interface.cpp +++ b/libksirtet/lib/mp_simple_interface.cpp @@ -9,12 +9,12 @@ #define PAUSE_ACTION \ - ((KToggleAction *)((KMainWindow *)topLevelWidget())->action("game_pause")) + ((KToggleAction *)((KMainWindow *)tqtopLevelWidget())->action("game_pause")) MPSimpleInterface::MPSimpleInterface(const MPGameInfo &gi, uint nbActions, const ActionData *data, - TQWidget *parent, const char *name) -: MPInterface(gi, nbActions, data, parent, name), state(SS_Standby) + TQWidget *tqparent, const char *name) +: MPInterface(gi, nbActions, data, tqparent, name), state(SS_Standby) {} void MPSimpleInterface::init() diff --git a/libksirtet/lib/mp_simple_interface.h b/libksirtet/lib/mp_simple_interface.h index d366dafd..04cb014c 100644 --- a/libksirtet/lib/mp_simple_interface.h +++ b/libksirtet/lib/mp_simple_interface.h @@ -7,11 +7,12 @@ class MPSimpleInterface : public MPInterface { Q_OBJECT + TQ_OBJECT public: MPSimpleInterface(const MPGameInfo &gi, uint nbActions, const ActionData *data, - TQWidget *parent = 0, const char *name = 0); + TQWidget *tqparent = 0, const char *name = 0); bool isPaused() const { return state==SS_Pause; } diff --git a/libksirtet/lib/mp_simple_types.cpp b/libksirtet/lib/mp_simple_types.cpp index c2a9dc27..142c1d15 100644 --- a/libksirtet/lib/mp_simple_types.cpp +++ b/libksirtet/lib/mp_simple_types.cpp @@ -1,6 +1,6 @@ #include "mp_simple_types.h" TQDataStream &operator <<(TQDataStream &s, const EnumClass &ec) - { s << (Q_UINT8)ec.f; return s; } + { s << (TQ_UINT8)ec.f; return s; } TQDataStream &operator >>(TQDataStream &s, EnumClass &ec) - { Q_UINT8 t; s >> t; ec.f = (int)t; return s; } + { TQ_UINT8 t; s >> t; ec.f = (int)t; return s; } diff --git a/libksirtet/lib/pline.cpp b/libksirtet/lib/pline.cpp index 86fde398..94e9c50e 100644 --- a/libksirtet/lib/pline.cpp +++ b/libksirtet/lib/pline.cpp @@ -9,12 +9,12 @@ #define THIN_BORDER 4 MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, - TQWidget *parent, const char *name) -: TQFrame(parent, name) + TQWidget *tqparent, const char *name) +: TQFrame(tqparent, name) { setFrameStyle(Panel | (serverLine ? Raised : Plain)); - // Top layout + // Top tqlayout hbl = new TQHBoxLayout(this, THIN_BORDER + frameWidth()); /* TriCheckBox */ @@ -26,7 +26,7 @@ MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, /* Name */ lname = new TQLabel(" ", this); - lname->setAlignment(AlignCenter); + lname->tqsetAlignment(AlignCenter); lname->setFrameStyle(TQFrame::Panel | TQFrame::Sunken); lname->setLineWidth(2); lname->setMidLineWidth(3); @@ -34,7 +34,7 @@ MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, f.setBold(TRUE); lname->setFont(f); lname->setFixedSize(lname->fontMetrics().maxWidth()*NAME_MAX_LENGTH, - lname->sizeHint().height()); + lname->tqsizeHint().height()); hbl->addWidget(lname); hbl->addStretch(1); @@ -51,7 +51,7 @@ MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, qle->setMaxLength(TALKER_MAX_LENGTH); qle->setFont( TQFont("fixed", 12, TQFont::Bold) ); qle->setFixedSize(qle->fontMetrics().maxWidth()*TALKER_MAX_LENGTH, - qle->sizeHint().height()); + qle->tqsizeHint().height()); connect(qle, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(_textChanged(const TQString &))); qle->setEnabled(isOwner); @@ -66,8 +66,8 @@ void MeetingLine::setData(const ExtData &ed) if ( bds[i].type==PlayerComboBox::Human ) nbh++; else if ( bds[i].type==PlayerComboBox::AI ) nba++; } - labH->setText(i18n("Hu=%1").arg(nbh)); - labAI->setText(i18n("AI=%1").arg(nba)); + labH->setText(i18n("Hu=%1").tqarg(nbh)); + labAI->setText(i18n("AI=%1").tqarg(nba)); lname->setText(bds[0].name); setType(ed.type); setText(ed.text); @@ -84,12 +84,12 @@ void MeetingLine::data(ExtData &ed) const PlayerLine::PlayerLine(PlayerComboBox::Type type, const TQString &txt, bool humanSetting, bool AISetting, bool canBeEmpty, bool acceptAI, - TQWidget *parent, const char *name) -: TQFrame(parent, name), hs(humanSetting), as(AISetting) + TQWidget *tqparent, const char *name) +: TQFrame(tqparent, name), hs(humanSetting), as(AISetting) { setFrameStyle(Panel | Raised); - // Top layout + // Top tqlayout TQHBoxLayout *hbl; hbl = new TQHBoxLayout(this, THIN_BORDER + frameWidth()); @@ -102,7 +102,7 @@ PlayerLine::PlayerLine(PlayerComboBox::Type type, const TQString &txt, edit = new TQLineEdit(txt, this); edit->setMaxLength(NAME_MAX_LENGTH); edit->setFixedSize(edit->fontMetrics().maxWidth()*(NAME_MAX_LENGTH+2), - edit->sizeHint().height()); + edit->tqsizeHint().height()); hbl->addWidget(edit); /* settings button */ @@ -128,8 +128,8 @@ void PlayerLine::setSlot() } /*****************************************************************************/ -GWidgetList::GWidgetList(uint interval, TQWidget *parent, const char * name) - : TQWidget(parent, name), vbl(this, interval) +GWidgetList::GWidgetList(uint interval, TQWidget *tqparent, const char * name) + : TQWidget(tqparent, name), vbl(this, interval) { widgets.setAutoDelete(TRUE); } diff --git a/libksirtet/lib/pline.h b/libksirtet/lib/pline.h index d9969264..9cef8d29 100644 --- a/libksirtet/lib/pline.h +++ b/libksirtet/lib/pline.h @@ -13,13 +13,14 @@ class TQPushButton; /** Internal class : display a "player line" in netmeeting. */ -class MeetingLine : public QFrame +class MeetingLine : public TQFrame { Q_OBJECT + TQ_OBJECT public: MeetingLine(bool isOwner, bool readerIsServer, bool serverLine, - TQWidget *parent, const char *name = 0); + TQWidget *tqparent, const char *name = 0); MeetingCheckBox::Type type() const { return tcb->type(); } void setType(MeetingCheckBox::Type type) { tcb->setType(type); } @@ -48,15 +49,16 @@ class MeetingLine : public QFrame TQLineEdit *qle; }; -class PlayerLine : public QFrame +class PlayerLine : public TQFrame { Q_OBJECT + TQ_OBJECT public: PlayerLine(PlayerComboBox::Type type, const TQString &txt, bool humanSetting, bool AISetting, bool canBeEmpty, bool acceptAI, - TQWidget *parent = 0, const char *name = 0); + TQWidget *tqparent = 0, const char *name = 0); PlayerComboBox::Type type() const { return pcb->type(); } TQString name() const { return edit->text(); } @@ -78,18 +80,19 @@ class PlayerLine : public QFrame }; /** Internal class : scrolable list of widgets. */ -class GWidgetList : public QWidget +class GWidgetList : public TQWidget { Q_OBJECT + TQ_OBJECT public: - GWidgetList(uint interval, TQWidget *parent = 0, const char * name = 0); + GWidgetList(uint interval, TQWidget *tqparent = 0, const char * name = 0); void remove(uint i); uint size() const { return widgets.count(); } protected: - /** The widget must be created with this widget as parent. */ + /** The widget must be created with this widget as tqparent. */ void append(TQWidget *); TQWidget *widget(uint i) { return widgets.at(i); } @@ -102,8 +105,8 @@ template <class Type> class WidgetList : public GWidgetList { public: - WidgetList(uint interval, TQWidget *parent=0, const char *name=0) - : GWidgetList(interval, parent, name) {} + WidgetList(uint interval, TQWidget *tqparent=0, const char *name=0) + : GWidgetList(interval, tqparent, name) {} void append(Type *w) { GWidgetList::append(w); } Type *widget(uint i) { return (Type *)GWidgetList::widget(i); } diff --git a/libksirtet/lib/smanager.cpp b/libksirtet/lib/smanager.cpp index f6588546..ba2afd89 100644 --- a/libksirtet/lib/smanager.cpp +++ b/libksirtet/lib/smanager.cpp @@ -31,7 +31,7 @@ void SocketManager::clean() sockets.resize(0); } -int SocketManager::find(int fd) +int SocketManager::tqfind(int fd) { for(uint i=0; i<sockets.size(); i++) if ( sockets[i]->fd()==fd ) return i; @@ -44,7 +44,7 @@ uint SocketManager::append(Socket *socket, SocketProperty sp) sockets.resize(s+1); sockets[s] = socket; - max_fd = QMAX(max_fd, socket->fd()); + max_fd = TQMAX(max_fd, socket->fd()); if ( sp==ReadWrite || sp==ReadOnly ) FD_SET(socket->fd(), &read_set); if ( sp==ReadWrite || sp==WriteOnly ) { @@ -65,7 +65,7 @@ void SocketManager::remove(uint i, bool del) max_fd = 0; for(uint j=0; j<s; j++) - max_fd = QMAX(max_fd, sockets[j]->fd()); + max_fd = TQMAX(max_fd, sockets[j]->fd()); int fd = so->fd(); if ( FD_ISSET(fd, &read_set) ) FD_CLR(fd, &read_set); diff --git a/libksirtet/lib/smanager.h b/libksirtet/lib/smanager.h index 59dd0edb..8541934e 100644 --- a/libksirtet/lib/smanager.h +++ b/libksirtet/lib/smanager.h @@ -40,7 +40,7 @@ class SocketManager Socket *operator [](uint i) { return sockets[i]; } /** @return the index of the socket (-1 if not present). */ - int find(int fd); + int tqfind(int fd); /** * Append a socket at the end of the array of sockets. diff --git a/libksirtet/lib/socket.cpp b/libksirtet/lib/socket.cpp index 6defc94b..7dd74f74 100644 --- a/libksirtet/lib/socket.cpp +++ b/libksirtet/lib/socket.cpp @@ -21,13 +21,13 @@ #endif Socket::Socket(KExtendedSocket *s, bool createNotifier, - TQObject *parent, const char *name) + TQObject *tqparent, const char *name) : _socket(s), _notifier(0) { Q_ASSERT(s); if (createNotifier) { _notifier = new TQSocketNotifier(s->fd(), TQSocketNotifier::Read, - parent, name); + tqparent, name); _notifier->setEnabled(FALSE); } } diff --git a/libksirtet/lib/socket.h b/libksirtet/lib/socket.h index 01dac726..75538670 100644 --- a/libksirtet/lib/socket.h +++ b/libksirtet/lib/socket.h @@ -12,7 +12,7 @@ class Socket { public: Socket(KExtendedSocket *, bool createNotifier = FALSE, - TQObject *parent = 0, const char *name = 0); + TQObject *tqparent = 0, const char *name = 0); /** close the socket */ ~Socket(); 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() diff --git a/libksirtet/lib/types.h b/libksirtet/lib/types.h index ee5867fa..3e294073 100644 --- a/libksirtet/lib/types.h +++ b/libksirtet/lib/types.h @@ -126,7 +126,7 @@ TQDataStream &operator << (TQDataStream &s, const MetaFlag &f); TQDataStream &operator >> (TQDataStream &s, MetaFlag &f); /** Internal class : encapsulate read/write TQBuffer. */ -class Stream : public QDataStream +class Stream : public TQDataStream { public: Stream(int mode); @@ -134,8 +134,8 @@ class Stream : public QDataStream void clear(); void setArray(TQByteArray a); - TQByteArray buffer() const { return buf.buffer(); } - uint size() const { return buf.buffer().size(); } + TQByteArray buffer() /*const*/ { return buf.buffer(); } + uint size() /*const*/ { return buf.buffer().size(); } protected: TQBuffer buf; diff --git a/libksirtet/lib/wizard.cpp b/libksirtet/lib/wizard.cpp index 19d9de34..a059cfa2 100644 --- a/libksirtet/lib/wizard.cpp +++ b/libksirtet/lib/wizard.cpp @@ -32,8 +32,8 @@ #define MAX_USER_PORT 65535 MPWizard::MPWizard(const MPGameInfo &gi, ConnectionData &_cd, - TQWidget *parent, const char *name) -: KWizard(parent, name, TRUE), cd(_cd) + TQWidget *tqparent, const char *name) +: KWizard(tqparent, name, TRUE), cd(_cd) { // setupTypePage(); // #### REMOVE NETWORK GAMES UNTIL FIXED type = Local; @@ -81,10 +81,10 @@ void MPWizard::setupLocalPage(const MPGameInfo &gi) localPage->setMargin(KDialogBase::marginHint()); wl = new WidgetList<PlayerLine>(5, localPage); - TQSignalMapper *husm = new TQSignalMapper(this); + TQSignalMapper *husm = new TQSignalMapper(TQT_TQOBJECT(this)); if (gi.humanSettingSlot) connect(husm, TQT_SIGNAL(mapped(int)), gi.humanSettingSlot); - TQSignalMapper *aism = new TQSignalMapper(this); + TQSignalMapper *aism = new TQSignalMapper(TQT_TQOBJECT(this)); if (gi.AISettingSlot) connect(aism, TQT_SIGNAL(mapped(int)), gi.AISettingSlot); KConfigGroupSaver cg(kapp->config(), MP_GROUP); @@ -94,17 +94,17 @@ void MPWizard::setupLocalPage(const MPGameInfo &gi) Q_ASSERT( gi.maxNbLocalPlayers>0 ); for (uint i=0; i<gi.maxNbLocalPlayers; i++) { type = (PlayerComboBox::Type) - cg.config()->readNumEntry(TQString(MP_PLAYER_TYPE).arg(i), + cg.config()->readNumEntry(TQString(MP_PLAYER_TYPE).tqarg(i), (i==0 ? PlayerComboBox::Human : PlayerComboBox::None)); - n = cg.config()->readEntry(TQString(MP_PLAYER_NAME).arg(i), - i18n("Player #%1").arg(i)); + n = cg.config()->readEntry(TQString(MP_PLAYER_NAME).tqarg(i), + i18n("Player #%1").tqarg(i)); pl = new PlayerLine(type, n, gi.humanSettingSlot, gi.AISettingSlot, i!=0, gi.AIAllowed, wl); connect(pl, TQT_SIGNAL(typeChanged(int)), TQT_SLOT(lineTypeChanged(int))); - husm->setMapping(pl, i); + husm->setMapping(TQT_TQOBJECT(pl), i); connect(pl, TQT_SIGNAL(setHuman()), husm, TQT_SLOT(map())); - aism->setMapping(pl, i); + aism->setMapping(TQT_TQOBJECT(pl), i); connect(pl, TQT_SIGNAL(setAI()), aism, TQT_SLOT(map())); wl->append(pl); } @@ -122,7 +122,7 @@ void MPWizard::setupLocalPage(const MPGameInfo &gi) TQString MPWizard::name(uint i) const { TQString s = wl->widget(i)->name(); - if ( s.length()==0 ) s = i18n("Player #%1").arg(i); + if ( s.length()==0 ) s = i18n("Player #%1").tqarg(i); return s; } @@ -177,7 +177,7 @@ void MPWizard::accept() // do lookup int res = socket->lookup(); if ( checkSocket(res, socket, i18n("Error looking up for \"%1\"") - .arg(host), this) ) { + .tqarg(host), this) ) { delete socket; return; } @@ -206,9 +206,9 @@ void MPWizard::accept() cg.config()->writeEntry(MP_GAMETYPE, (int)type); for (uint i=0; i<wl->size(); i++) { - cg.config()->writeEntry(TQString(MP_PLAYER_TYPE).arg(i), + cg.config()->writeEntry(TQString(MP_PLAYER_TYPE).tqarg(i), (int)wl->widget(i)->type()); - cg.config()->writeEntry(TQString(MP_PLAYER_NAME).arg(i), name(i)); + cg.config()->writeEntry(TQString(MP_PLAYER_NAME).tqarg(i), name(i)); } KWizard::accept(); diff --git a/libksirtet/lib/wizard.h b/libksirtet/lib/wizard.h index fd90a3b8..42623ec7 100644 --- a/libksirtet/lib/wizard.h +++ b/libksirtet/lib/wizard.h @@ -19,10 +19,11 @@ class ConnectionData; class MPWizard : public KWizard { Q_OBJECT + TQ_OBJECT public: MPWizard(const MPGameInfo &gi, ConnectionData &cd, - TQWidget *parent = 0, const char *name = 0); + TQWidget *tqparent = 0, const char *name = 0); void showPage(TQWidget *page); |