summaryrefslogtreecommitdiffstats
path: root/kbackgammon/engines/nextgen
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
commit576eb4299a00bc053db35414406f46372a0f70f2 (patch)
tree4c030922d533821db464af566188e7d40cc8848c /kbackgammon/engines/nextgen
parent0718336b6017d1a4fc1d626544180a5a2a29ddec (diff)
downloadtdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz
tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbackgammon/engines/nextgen')
-rw-r--r--kbackgammon/engines/nextgen/kbggame.cpp4
-rw-r--r--kbackgammon/engines/nextgen/kbggame.h4
-rw-r--r--kbackgammon/engines/nextgen/kbgng.cpp78
-rw-r--r--kbackgammon/engines/nextgen/kbgng.h20
-rw-r--r--kbackgammon/engines/nextgen/kbgplayer.cpp4
-rw-r--r--kbackgammon/engines/nextgen/kbgplayer.h6
6 files changed, 58 insertions, 58 deletions
diff --git a/kbackgammon/engines/nextgen/kbggame.cpp b/kbackgammon/engines/nextgen/kbggame.cpp
index 6ee709e1..13ae076a 100644
--- a/kbackgammon/engines/nextgen/kbggame.cpp
+++ b/kbackgammon/engines/nextgen/kbggame.cpp
@@ -31,13 +31,13 @@
/*
* Constructor
*/
-KBgGame::KBgGame(int cookie, QObject *parent)
+KBgGame::KBgGame(int cookie, TQObject *parent)
: KGame(cookie, parent)
{
// do nothing...
}
-bool KBgGame::playerInput(QDataStream &msg,KPlayer *player)
+bool KBgGame::playerInput(TQDataStream &msg,KPlayer *player)
{
Q_INT32 move;
msg >> move;
diff --git a/kbackgammon/engines/nextgen/kbggame.h b/kbackgammon/engines/nextgen/kbggame.h
index fea5f516..1c045433 100644
--- a/kbackgammon/engines/nextgen/kbggame.h
+++ b/kbackgammon/engines/nextgen/kbggame.h
@@ -45,11 +45,11 @@ public:
enum MsgID {Text, Cmd, MaxMsg};
- KBgGame(int cookie = 42, QObject *parent = 0);
+ KBgGame(int cookie = 42, TQObject *parent = 0);
protected:
- virtual bool playerInput(QDataStream &msg,KPlayer *player);
+ virtual bool playerInput(TQDataStream &msg,KPlayer *player);
};
diff --git a/kbackgammon/engines/nextgen/kbgng.cpp b/kbackgammon/engines/nextgen/kbgng.cpp
index 6518147c..302cbb58 100644
--- a/kbackgammon/engines/nextgen/kbgng.cpp
+++ b/kbackgammon/engines/nextgen/kbgng.cpp
@@ -29,19 +29,19 @@
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
-#include <qlayout.h>
+#include <tqlayout.h>
#include <kiconloader.h>
#include <kstdaction.h>
-#include <qbuttongroup.h>
-#include <qcheckbox.h>
+#include <tqbuttongroup.h>
+#include <tqcheckbox.h>
#include <kconfig.h>
#include <klocale.h>
#include <kmainwindow.h>
#include <klineeditdlg.h>
#include <krandomsequence.h>
-#include <qstringlist.h>
-#include <qcstring.h>
-#include <qtextstream.h>
+#include <tqstringlist.h>
+#include <tqcstring.h>
+#include <tqtextstream.h>
#include <version.h>
@@ -51,30 +51,30 @@
/*
* Constructor
*/
-KBgEngineNg::KBgEngineNg(QWidget *parent, QString *name, QPopupMenu *pmenu)
+KBgEngineNg::KBgEngineNg(TQWidget *parent, TQString *name, TQPopupMenu *pmenu)
: KBgEngine(parent, name, pmenu)
{
// get a new game
initGame();
// create actions and menus
- QString label[MaxTypes];
+ TQString label[MaxTypes];
label[Local ] = i18n("Local Games");
label[NetServer] = i18n("Offer Network Games");
label[NetClient] = i18n("Join Network Games");
- QStringList list;
+ TQStringList list;
for (int i = 0; i < MaxTypes; i++)
list.append(label[i]);
- _gameSelect = new KSelectAction(i18n("&Types"), 0, this, SLOT(setGame()), this);
+ _gameSelect = new KSelectAction(i18n("&Types"), 0, this, TQT_SLOT(setGame()), this);
_gameSelect->setItems(list);
_gameSelect->plug(menu);
menu->insertSeparator();
- _connectAction = new KAction(i18n("&Names..."), 0, this, SLOT(changeName()), this);
+ _connectAction = new KAction(i18n("&Names..."), 0, this, TQT_SLOT(changeName()), this);
_connectAction->plug(menu);
// Restore last settings
@@ -123,7 +123,7 @@ void KBgEngineNg::setGame()
// initialize a new game
bool ret = false;
- QString label, port_s, host_s;
+ TQString label, port_s, host_s;
Q_UINT16 port;
switch (_currGame = _gameSelect->currentItem()) {
@@ -140,7 +140,7 @@ void KBgEngineNg::setGame()
"65535.");
port_s.setNum(_port);
do {
- port_s = KLineEditDlg::getText(label, port_s, &ret, (QWidget *)parent());
+ port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)parent());
if (!ret)
return;
port = port_s.toUShort(&ret);
@@ -159,7 +159,7 @@ void KBgEngineNg::setGame()
label = i18n("Type the name of the server you want to connect to:");
host_s = _host;
do {
- host_s = KLineEditDlg::getText(label, host_s, &ret, (QWidget *)parent());
+ host_s = KLineEditDlg::getText(label, host_s, &ret, (TQWidget *)parent());
if (!ret)
return;
} while (host_s.isEmpty());
@@ -168,7 +168,7 @@ void KBgEngineNg::setGame()
"number should be between 1024 and 65535.").arg(host_s);
port_s.setNum(_port);
do {
- port_s = KLineEditDlg::getText(label, port_s, &ret, (QWidget *)parent());
+ port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)parent());
if (!ret)
return;
port = port_s.toUShort(&ret);
@@ -311,7 +311,7 @@ void KBgEngineNg::redo()
* Take the move string and make the changes on the working copy
* of the state.
*/
-void KBgEngineNg::handleMove(QString *s)
+void KBgEngineNg::handleMove(TQString *s)
{
Q_UNUSED(s)
// TODO
@@ -477,10 +477,10 @@ void KBgEngineNg::saveConfig()
* players. Although the message gets the Cmd ID, it is currently
* handled as a regular text message.
*/
-void KBgEngineNg::handleCommand(const QString& text)
+void KBgEngineNg::handleCommand(const TQString& text)
{
- QByteArray msg;
- QTextStream ts(msg, IO_WriteOnly);
+ TQByteArray msg;
+ TQTextStream ts(msg, IO_WriteOnly);
ts << text;
if (!_game->sendMessage(msg, KBgGame::Cmd))
kdDebug(true, PROG_COOKIE) << "couldn't send message: "
@@ -539,17 +539,17 @@ void KBgEngineNg::slotPropertyChanged(KGamePropertyBase *p, KGame *me)
void KBgEngineNg::changeName()
{
bool ok = false;
- QString name;
+ TQString name;
for (int i = 0; i < 2; i++) {
- name = QString::null;
+ name = TQString::null;
while (!_player[i]->isVirtual() && name.isEmpty()) {
if (i == 0)
name = KLineEditDlg::getText(i18n("Type the name of the first player:"),
- _name[i], &ok, (QWidget *)parent());
+ _name[i], &ok, (TQWidget *)parent());
else
name = KLineEditDlg::getText(i18n("Type the name of the second player:"),
- _name[i], &ok, (QWidget *)parent());
+ _name[i], &ok, (TQWidget *)parent());
if (!ok) return;
_player[i]->setName(name);
}
@@ -559,7 +559,7 @@ void KBgEngineNg::changeName()
/*
* Receive data sent via KBgGame::sendMessage(...)
*/
-void KBgEngineNg::slotNetworkData(int msgid, const QByteArray &msg, Q_UINT32 r, Q_UINT32 s)
+void KBgEngineNg::slotNetworkData(int msgid, const TQByteArray &msg, Q_UINT32 r, Q_UINT32 s)
{
Q_UNUSED(r);
Q_UNUSED(s);
@@ -580,7 +580,7 @@ void KBgEngineNg::slotNetworkData(int msgid, const QByteArray &msg, Q_UINT32 r,
/*
* Create the i-th player
*/
-KBgPlayer * KBgEngineNg::createPlayer(int i, QString name)
+KBgPlayer * KBgEngineNg::createPlayer(int i, TQString name)
{
KBgPlayer *p = new KBgPlayer();
@@ -589,8 +589,8 @@ KBgPlayer * KBgEngineNg::createPlayer(int i, QString name)
p->findProperty(KGamePropertyBase::IdName)->setEmittingSignal(true);
- connect(p, SIGNAL(signalPropertyChanged(KGamePropertyBase *, KPlayer *)),
- this, SLOT(slotPropertyChanged(KGamePropertyBase *, KPlayer *)));
+ connect(p, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase *, KPlayer *)),
+ this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase *, KPlayer *)));
return (_player[i] = p);
}
@@ -603,20 +603,20 @@ void KBgEngineNg::initGame()
_game = new KBgGame(PROG_COOKIE);
_game->random()->setSeed(getpid()*time(NULL));
- connect(_game, SIGNAL(signalPlayerJoinedGame(KPlayer *)),
- this, SLOT(slotPlayerJoinedGame(KPlayer *)));
- connect(_game, SIGNAL(signalCreatePlayer(KPlayer *&, int, int, bool, KGame *)),
- this, SLOT(slotCreatePlayer(KPlayer *&, int, int, bool, KGame *)));
+ connect(_game, TQT_SIGNAL(signalPlayerJoinedGame(KPlayer *)),
+ this, TQT_SLOT(slotPlayerJoinedGame(KPlayer *)));
+ connect(_game, TQT_SIGNAL(signalCreatePlayer(KPlayer *&, int, int, bool, KGame *)),
+ this, TQT_SLOT(slotCreatePlayer(KPlayer *&, int, int, bool, KGame *)));
- connect(_game, SIGNAL(signalClientConnected(Q_UINT32)),
- this, SLOT(slotClientConnected(Q_UINT32)));
- connect(_game, SIGNAL(signalClientDisconnected(Q_UINT32, bool)),
- this, SLOT(slotClientDisconnected(Q_UINT32, bool)));
+ connect(_game, TQT_SIGNAL(signalClientConnected(Q_UINT32)),
+ this, TQT_SLOT(slotClientConnected(Q_UINT32)));
+ connect(_game, TQT_SIGNAL(signalClientDisconnected(Q_UINT32, bool)),
+ this, TQT_SLOT(slotClientDisconnected(Q_UINT32, bool)));
- connect(_game, SIGNAL(signalPropertyChanged(KGamePropertyBase *, KGame *)),
- this, SLOT(slotPropertyChanged(KGamePropertyBase *, KGame *)));
- connect(_game, SIGNAL(signalNetworkData(int,const QByteArray &, Q_UINT32, Q_UINT32)),
- this, SLOT(slotNetworkData(int,const QByteArray &, Q_UINT32, Q_UINT32)));
+ connect(_game, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase *, KGame *)),
+ this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase *, KGame *)));
+ connect(_game, TQT_SIGNAL(signalNetworkData(int,const TQByteArray &, Q_UINT32, Q_UINT32)),
+ this, TQT_SLOT(slotNetworkData(int,const TQByteArray &, Q_UINT32, Q_UINT32)));
}
// EOF
diff --git a/kbackgammon/engines/nextgen/kbgng.h b/kbackgammon/engines/nextgen/kbgng.h
index 149f3bf6..99ea82c1 100644
--- a/kbackgammon/engines/nextgen/kbgng.h
+++ b/kbackgammon/engines/nextgen/kbgng.h
@@ -29,10 +29,10 @@
#endif
-#include <qtimer.h>
-#include <qspinbox.h>
+#include <tqtimer.h>
+#include <tqspinbox.h>
#include <kaction.h>
-#include <qdatastream.h>
+#include <tqdatastream.h>
#include <kgameproperty.h>
#include <generic/kbgengine.h>
@@ -57,7 +57,7 @@ public:
/*
* Constructor and destructor
*/
- KBgEngineNg( QWidget *parent = 0, QString *name = 0, QPopupMenu *pmenu = 0);
+ KBgEngineNg( TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0);
virtual ~KBgEngineNg();
/**
@@ -107,7 +107,7 @@ public slots:
* A move has been made on the board - see the board class
* for the format of the string s
*/
- virtual void handleMove(QString *s);
+ virtual void handleMove(TQString *s);
/**
* Undo the last move
@@ -142,7 +142,7 @@ public slots:
/**
* Process the string text
*/
- virtual void handleCommand(const QString& text);
+ virtual void handleCommand(const TQString& text);
/**
* Start a new game.
@@ -152,7 +152,7 @@ public slots:
void slotPlayerJoinedGame(KPlayer *p);
- void slotNetworkData(int msgid, const QByteArray &msg, Q_UINT32 receiver, Q_UINT32 sender);
+ void slotNetworkData(int msgid, const TQByteArray &msg, Q_UINT32 receiver, Q_UINT32 sender);
void slotCreatePlayer(KPlayer *&, int, int, bool, KGame *);
void slotClientDisconnected(Q_UINT32, bool);
@@ -219,7 +219,7 @@ private:
int _nplayers;
- QString _host;
+ TQString _host;
Q_UINT16 _port;
// ************************************************************
@@ -248,13 +248,13 @@ private:
* the player is @ref _player. That means that the players are
* automatically deleted.
*/
- KBgPlayer * createPlayer(int i, QString name = QString::null);
+ KBgPlayer * createPlayer(int i, TQString name = TQString::null);
private:
KBgGame* _game;
- QString _name[2];
+ TQString _name[2];
KBgPlayer* _player[2];
diff --git a/kbackgammon/engines/nextgen/kbgplayer.cpp b/kbackgammon/engines/nextgen/kbgplayer.cpp
index f0b3a7ed..d1d8b998 100644
--- a/kbackgammon/engines/nextgen/kbgplayer.cpp
+++ b/kbackgammon/engines/nextgen/kbgplayer.cpp
@@ -48,13 +48,13 @@ int KBgPlayer::rtti() const
return 10500;
}
-bool KBgPlayer::load(QDataStream &stream)
+bool KBgPlayer::load(TQDataStream &stream)
{
KPlayer::load(stream);
cerr << "-------- KBgPlayer::load" << endl;
return false;
}
-bool KBgPlayer::save(QDataStream &stream)
+bool KBgPlayer::save(TQDataStream &stream)
{
KPlayer::save(stream);
cerr << "-------- KBgPlayer::save" << endl;
diff --git a/kbackgammon/engines/nextgen/kbgplayer.h b/kbackgammon/engines/nextgen/kbgplayer.h
index 7c11d83c..8d6536de 100644
--- a/kbackgammon/engines/nextgen/kbgplayer.h
+++ b/kbackgammon/engines/nextgen/kbgplayer.h
@@ -29,7 +29,7 @@
#endif
#include <kplayer.h>
-#include <qdatastream.h>
+#include <tqdatastream.h>
class KGame;
@@ -49,8 +49,8 @@ public:
virtual int rtti() const;
- virtual bool load(QDataStream &stream);
- virtual bool save(QDataStream &stream);
+ virtual bool load(TQDataStream &stream);
+ virtual bool save(TQDataStream &stream);
};