summaryrefslogtreecommitdiffstats
path: root/kbattleship
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 /kbattleship
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 'kbattleship')
-rw-r--r--kbattleship/kbattleship/kbaiplayer.cpp8
-rw-r--r--kbattleship/kbattleship/kbaiplayer.h6
-rw-r--r--kbattleship/kbattleship/kbattlefield.cpp10
-rw-r--r--kbattleship/kbattleship/kbattlefield.h12
-rw-r--r--kbattleship/kbattleship/kbattleship.cpp308
-rw-r--r--kbattleship/kbattleship/kbattleship.h30
-rw-r--r--kbattleship/kbattleship/kbattleshipclient.cpp12
-rw-r--r--kbattleship/kbattleship/kbattleshipclient.h8
-rw-r--r--kbattleship/kbattleship/kbattleshipserver.cpp22
-rw-r--r--kbattleship/kbattleship/kbattleshipserver.h14
-rw-r--r--kbattleship/kbattleship/kbattleshipview.cpp58
-rw-r--r--kbattleship/kbattleship/kbattleshipview.h12
-rw-r--r--kbattleship/kbattleship/kbchooserstrategy.cpp10
-rw-r--r--kbattleship/kbattleship/kbchooserstrategy.h6
-rw-r--r--kbattleship/kbattleship/kbdestroyshipstrategy.cpp10
-rw-r--r--kbattleship/kbattleship/kbdestroyshipstrategy.h10
-rw-r--r--kbattleship/kbattleship/kbdiagonalshotstrategy.cpp14
-rw-r--r--kbattleship/kbattleship/kbdiagonalshotstrategy.h6
-rw-r--r--kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp18
-rw-r--r--kbattleship/kbattleship/kbdiagonalwrapstrategy.h8
-rw-r--r--kbattleship/kbattleship/kbhorizontalstepstrategy.cpp14
-rw-r--r--kbattleship/kbattleship/kbhorizontalstepstrategy.h8
-rw-r--r--kbattleship/kbattleship/kbrandomshotstrategy.cpp12
-rw-r--r--kbattleship/kbattleship/kbrandomshotstrategy.h6
-rw-r--r--kbattleship/kbattleship/kbstrategy.cpp6
-rw-r--r--kbattleship/kbattleship/kbstrategy.h16
-rw-r--r--kbattleship/kbattleship/kbverticalstepstrategy.cpp14
-rw-r--r--kbattleship/kbattleship/kbverticalstepstrategy.h8
-rw-r--r--kbattleship/kbattleship/kchatwidget.cpp20
-rw-r--r--kbattleship/kbattleship/kchatwidget.h22
-rw-r--r--kbattleship/kbattleship/kclientdialog.cpp40
-rw-r--r--kbattleship/kbattleship/kclientdialog.h18
-rw-r--r--kbattleship/kbattleship/kgridwidget.cpp72
-rw-r--r--kbattleship/kbattleship/kgridwidget.h34
-rw-r--r--kbattleship/kbattleship/kmessage.cpp24
-rw-r--r--kbattleship/kbattleship/kmessage.h16
-rw-r--r--kbattleship/kbattleship/konnectionhandling.cpp48
-rw-r--r--kbattleship/kbattleship/konnectionhandling.h14
-rw-r--r--kbattleship/kbattleship/kserverdialog.cpp18
-rw-r--r--kbattleship/kbattleship/kserverdialog.h16
-rw-r--r--kbattleship/kbattleship/kshiplist.cpp6
-rw-r--r--kbattleship/kbattleship/kshiplist.h4
-rw-r--r--kbattleship/kbattleship/kstatdialog.cpp14
-rw-r--r--kbattleship/kbattleship/kstatdialog.h2
-rw-r--r--kbattleship/kbattleship/main.cpp4
45 files changed, 519 insertions, 519 deletions
diff --git a/kbattleship/kbattleship/kbaiplayer.cpp b/kbattleship/kbattleship/kbaiplayer.cpp
index ca95c2da..3381c00c 100644
--- a/kbattleship/kbattleship/kbaiplayer.cpp
+++ b/kbattleship/kbattleship/kbaiplayer.cpp
@@ -45,9 +45,9 @@ void KBAIPlayer::init(KBattleField *battle_field, KShipList *ai_shiplist)
if(m_battleField != 0)
{
- QRect rect = m_battleField->enemyRect();
+ TQRect rect = m_battleField->enemyRect();
int grid = m_battleField->gridSize();
- m_fieldRect = QRect(0, 0, (rect.width() / grid), (rect.height() / grid));
+ m_fieldRect = TQRect(0, 0, (rect.width() / grid), (rect.height() / grid));
}
}
@@ -92,7 +92,7 @@ bool KBAIPlayer::slotRequestShot()
{
if(m_masterStrategy != 0 && m_masterStrategy->hasMoreShots())
{
- QPoint pos = m_masterStrategy->nextShot();
+ TQPoint pos = m_masterStrategy->nextShot();
emit sigShootAt(pos);
m_masterStrategy->shotAt(pos);
return true;
@@ -102,6 +102,6 @@ bool KBAIPlayer::slotRequestShot()
bool KBAIPlayer::shipPlaced(int shiplen, int x, int y, bool vertical)
{
- QRect ship = vertical ? QRect(x, y, 1, shiplen) : QRect(x, y, shiplen, 1);
+ TQRect ship = vertical ? TQRect(x, y, 1, shiplen) : TQRect(x, y, shiplen, 1);
return m_ownShipList->addNewShip(vertical, ship.x(), ship.y());
}
diff --git a/kbattleship/kbattleship/kbaiplayer.h b/kbattleship/kbattleship/kbaiplayer.h
index aebb149d..c5aa3a79 100644
--- a/kbattleship/kbattleship/kbaiplayer.h
+++ b/kbattleship/kbattleship/kbaiplayer.h
@@ -18,7 +18,7 @@
#ifndef KBAIPLAYER_H
#define KBAIPLAYER_H
-#include <qobject.h>
+#include <tqobject.h>
#include <krandomsequence.h>
@@ -41,7 +41,7 @@ public slots:
bool shipPlaced(int shiplen, int x, int y, bool vertical);
signals:
- void sigShootAt(const QPoint pos);
+ void sigShootAt(const TQPoint pos);
void sigReady();
private:
@@ -53,7 +53,7 @@ private:
KBattleField *m_battleField;
KRandomSequence *m_randomSeq;
- QRect m_fieldRect;
+ TQRect m_fieldRect;
};
#endif
diff --git a/kbattleship/kbattleship/kbattlefield.cpp b/kbattleship/kbattleship/kbattlefield.cpp
index 0467ae28..c4a9e422 100644
--- a/kbattleship/kbattleship/kbattlefield.cpp
+++ b/kbattleship/kbattleship/kbattlefield.cpp
@@ -20,7 +20,7 @@
#include "kbattlefield.h"
-KBattleField::KBattleField(QWidget *parent, bool grid) : KGridWidget(parent, grid)
+KBattleField::KBattleField(TQWidget *parent, bool grid) : KGridWidget(parent, grid)
{
m_parent = parent;
m_width = parent->width();
@@ -222,12 +222,12 @@ int KBattleField::rectX()
return 10;
}
-QRect KBattleField::ownRect()
+TQRect KBattleField::ownRect()
{
- return QRect(ownXPosition(), ownYPosition(), m_ownfieldx * gridSize(), m_ownfieldy * gridSize());
+ return TQRect(ownXPosition(), ownYPosition(), m_ownfieldx * gridSize(), m_ownfieldy * gridSize());
}
-QRect KBattleField::enemyRect()
+TQRect KBattleField::enemyRect()
{
- return QRect(enemyXPosition(), enemyYPosition(), m_enemyfieldx * gridSize(), m_enemyfieldy * gridSize());
+ return TQRect(enemyXPosition(), enemyYPosition(), m_enemyfieldx * gridSize(), m_enemyfieldy * gridSize());
}
diff --git a/kbattleship/kbattleship/kbattlefield.h b/kbattleship/kbattleship/kbattlefield.h
index d1e62b3f..94bcf3f5 100644
--- a/kbattleship/kbattleship/kbattlefield.h
+++ b/kbattleship/kbattleship/kbattlefield.h
@@ -18,8 +18,8 @@
#ifndef KBATTLEFIELD_H
#define KBATTLEFIELD_H
-#include <qpainter.h>
-#include <qwidget.h>
+#include <tqpainter.h>
+#include <tqwidget.h>
#include "kgridwidget.h"
@@ -27,7 +27,7 @@ class KBattleField : public KGridWidget
{
public:
enum{FREE, WATER, HIT, DEATH, BORDER, SHIP1P1, SHIP2P1, SHIP2P2, SHIP3P1, SHIP3P2, SHIP3P3, SHIP4P1, SHIP4P2, SHIP4P3, SHIP4P4};
- KBattleField(QWidget *parent, bool grid);
+ KBattleField(TQWidget *parent, bool grid);
void clearOwnField();
void clearEnemyField();
@@ -44,8 +44,8 @@ public:
void setPreviewState(int fieldx, int fieldy, int type, bool rotate);
- QRect ownRect();
- QRect enemyRect();
+ TQRect ownRect();
+ TQRect enemyRect();
int gridSize() { return 32; }
@@ -76,7 +76,7 @@ private:
bool m_canDraw;
- QWidget *m_parent;
+ TQWidget *m_parent;
};
#endif
diff --git a/kbattleship/kbattleship/kbattleship.cpp b/kbattleship/kbattleship/kbattleship.cpp
index b7d38891..32759e28 100644
--- a/kbattleship/kbattleship/kbattleship.cpp
+++ b/kbattleship/kbattleship/kbattleship.cpp
@@ -15,8 +15,8 @@
* *
***************************************************************************/
-#include <qlayout.h>
-#include <qtimer.h>
+#include <tqlayout.h>
+#include <tqtimer.h>
#include <kgamemisc.h>
#include <kinputdialog.h>
@@ -92,16 +92,16 @@ void KBattleshipWindow::initStatusBar()
void KBattleshipWindow::initActions()
{
- KStdAction::configureNotifications(this, SLOT(slotConfigureNotifications()), actionCollection());
- m_gameServerConnect = new KAction(i18n("&Connect to Server..."), "connect_no", Key_F2, this, SLOT(slotServerConnect()), actionCollection(), "game_serverconnect");
- m_gameNewServer = new KAction(i18n("&Start Server..."), "network", Key_F3, this, SLOT(slotNewServer()), actionCollection(), "game_newserver");
- m_gameSingle = new KAction(i18n("S&ingle Player..."), "gear", Key_F4, this, SLOT(slotSinglePlayer()), actionCollection(), "game_singleplayer");
- m_gameQuit = KStdGameAction::quit(this, SLOT(close()), actionCollection());
- KStdGameAction::highscores(this, SLOT(slotHighscore()), actionCollection());
- m_gameEnemyInfo = new KAction(i18n("&Enemy Info"), "view_text", Key_F11, this, SLOT(slotEnemyClientInfo()), actionCollection(), "game_enemyinfo");
+ KStdAction::configureNotifications(this, TQT_SLOT(slotConfigureNotifications()), actionCollection());
+ m_gameServerConnect = new KAction(i18n("&Connect to Server..."), "connect_no", Key_F2, this, TQT_SLOT(slotServerConnect()), actionCollection(), "game_serverconnect");
+ m_gameNewServer = new KAction(i18n("&Start Server..."), "network", Key_F3, this, TQT_SLOT(slotNewServer()), actionCollection(), "game_newserver");
+ m_gameSingle = new KAction(i18n("S&ingle Player..."), "gear", Key_F4, this, TQT_SLOT(slotSinglePlayer()), actionCollection(), "game_singleplayer");
+ m_gameQuit = KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection());
+ KStdGameAction::highscores(this, TQT_SLOT(slotHighscore()), actionCollection());
+ m_gameEnemyInfo = new KAction(i18n("&Enemy Info"), "view_text", Key_F11, this, TQT_SLOT(slotEnemyClientInfo()), actionCollection(), "game_enemyinfo");
m_configSound = new KToggleAction(i18n("&Play Sounds"), 0, actionCollection(), "options_configure_sound");
- m_configGrid = new KToggleAction(i18n("&Show Grid"), 0, this, SLOT(slotShowGrid()), actionCollection(), "options_show_grid");
+ m_configGrid = new KToggleAction(i18n("&Show Grid"), 0, this, TQT_SLOT(slotShowGrid()), actionCollection(), "options_show_grid");
m_configGrid->setCheckedState(i18n("Hide Grid"));
m_gameEnemyInfo->setEnabled(false);
@@ -111,9 +111,9 @@ void KBattleshipWindow::initActions()
void KBattleshipWindow::initChat()
{
- connect(m_chat, SIGNAL(sigSendMessage(const QString &)), this, SLOT(slotSendChatMessage(const QString &)));
- connect(m_chat, SIGNAL(sigChangeEnemyNickname(const QString &)), this, SLOT(slotChangeEnemyPlayer(const QString &)));
- connect(m_chat, SIGNAL(sigChangeOwnNickname(const QString &)), this, SLOT(slotChangedNickCommand(const QString &)));
+ connect(m_chat, TQT_SIGNAL(sigSendMessage(const TQString &)), this, TQT_SLOT(slotSendChatMessage(const TQString &)));
+ connect(m_chat, TQT_SIGNAL(sigChangeEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &)));
+ connect(m_chat, TQT_SIGNAL(sigChangeOwnNickname(const TQString &)), this, TQT_SLOT(slotChangedNickCommand(const TQString &)));
}
void KBattleshipWindow::changeShipPlacementDirection(){
@@ -122,16 +122,16 @@ void KBattleshipWindow::changeShipPlacementDirection(){
void KBattleshipWindow::initShipPlacing()
{
- connect(m_ownshiplist, SIGNAL(sigOwnFieldDataChanged(int, int, int)), this, SLOT(slotChangeOwnFieldData(int, int, int)));
- connect(m_ownshiplist, SIGNAL(sigLastShipAdded()), this, SLOT(slotShipsReady()));
+ connect(m_ownshiplist, TQT_SIGNAL(sigOwnFieldDataChanged(int, int, int)), this, TQT_SLOT(slotChangeOwnFieldData(int, int, int)));
+ connect(m_ownshiplist, TQT_SIGNAL(sigLastShipAdded()), this, TQT_SLOT(slotShipsReady()));
}
void KBattleshipWindow::initView()
{
- QWidget *dummy = new QWidget(this, "dummy");
+ TQWidget *dummy = new TQWidget(this, "dummy");
setCentralWidget(dummy);
- QGridLayout *topLayout = new QGridLayout(dummy, 2, 2, 0, -1, "topLayout");
+ TQGridLayout *topLayout = new TQGridLayout(dummy, 2, 2, 0, -1, "topLayout");
m_chat = new KChatWidget(dummy);
m_view = new KBattleshipView(dummy, "", m_configGrid->isChecked());
@@ -148,10 +148,10 @@ void KBattleshipWindow::initView()
m_view->startDrawing();
setFocusProxy(m_view);
- connect(m_view, SIGNAL(sigEnemyFieldClicked(int, int)), this, SLOT(slotEnemyFieldClick(int, int)));
- connect(m_view, SIGNAL(sigOwnFieldClicked(int, int)), this, SLOT(slotPlaceShip(int, int)));
- connect(m_view, SIGNAL(sigMouseOverField(int, int)), this, SLOT(slotPlaceShipPreview(int, int)));
- connect(m_view, SIGNAL(changeShipPlacementDirection()), this, SLOT(changeShipPlacementDirection()));
+ connect(m_view, TQT_SIGNAL(sigEnemyFieldClicked(int, int)), this, TQT_SLOT(slotEnemyFieldClick(int, int)));
+ connect(m_view, TQT_SIGNAL(sigOwnFieldClicked(int, int)), this, TQT_SLOT(slotPlaceShip(int, int)));
+ connect(m_view, TQT_SIGNAL(sigMouseOverField(int, int)), this, TQT_SLOT(slotPlaceShipPreview(int, int)));
+ connect(m_view, TQT_SIGNAL(changeShipPlacementDirection()), this, TQT_SLOT(changeShipPlacementDirection()));
}
void KBattleshipWindow::slotDeleteAI()
@@ -186,8 +186,8 @@ void KBattleshipWindow::slotEnemyFieldClick(int fieldx, int fieldy)
{
slotStatusMsg(i18n("Sending Message..."));
KMessage *msg = new KMessage(KMessage::SHOOT);
- msg->addField("fieldx", QString::number(fieldx));
- msg->addField("fieldy", QString::number(fieldy));
+ msg->addField("fieldx", TQString::number(fieldx));
+ msg->addField("fieldy", TQString::number(fieldy));
slotSendMessage(msg);
}
@@ -213,7 +213,7 @@ void KBattleshipWindow::slotEnemyFieldClick(int fieldx, int fieldy)
if(showstate == KBattleField::HIT)
{
KShip *ship = m_enemyshiplist->shipAt(fieldx, fieldy);
- typedef QValueList<int> DeathValueList;
+ typedef TQValueList<int> DeathValueList;
DeathValueList deathList;
bool xokay = true, yokay = true;
int tempy = 0, tempx = 0;
@@ -314,14 +314,14 @@ void KBattleshipWindow::slotEnemyFieldClick(int fieldx, int fieldy)
slotStatusMsg(i18n("You won the game :)"));
m_stat->slotAddOwnWon();
slotUpdateHighscore();
- switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"),QString::null,i18n("Restart"),i18n("Do Not Restart")))
+ switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"),TQString::null,i18n("Restart"),i18n("Do Not Restart")))
{
case KMessageBox::Yes:
- QTimer::singleShot(0, this, SLOT(slotRestartAI()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotRestartAI()));
break;
case KMessageBox::No:
- QTimer::singleShot(0, this, SLOT(slotDeleteAI()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotDeleteAI()));
break;
}
return;
@@ -576,9 +576,9 @@ void KBattleshipWindow::slotSendMessage(int fieldx, int fieldy, int state)
if(m_connection != 0)
{
KMessage *msg = new KMessage(KMessage::ANSWER_SHOOT);
- msg->addField(QString("fieldx"), QString::number(fieldx));
- msg->addField(QString("fieldy"), QString::number(fieldy));
- msg->addField(QString("fieldstate"), QString::number(state));
+ msg->addField(TQString("fieldx"), TQString::number(fieldx));
+ msg->addField(TQString("fieldy"), TQString::number(fieldy));
+ msg->addField(TQString("fieldstate"), TQString::number(state));
if(m_connection->type() == KonnectionHandling::SERVER)
m_kbserver->sendMessage(msg);
@@ -598,7 +598,7 @@ void KBattleshipWindow::slotSendMessage(KMessage *msg)
}
}
-void KBattleshipWindow::slotSendChatMessage(const QString &text)
+void KBattleshipWindow::slotSendChatMessage(const TQString &text)
{
if(m_connection != 0 && m_serverHasClient)
{
@@ -608,7 +608,7 @@ void KBattleshipWindow::slotSendChatMessage(const QString &text)
}
}
-void KBattleshipWindow::slotChangedNickCommand(const QString &text)
+void KBattleshipWindow::slotChangedNickCommand(const TQString &text)
{
m_ownNickname = text;
slotChangeOwnPlayer(m_ownNickname);
@@ -642,9 +642,9 @@ void KBattleshipWindow::slotUpdateHighscore()
KScoreDialog::FieldInfo info;
info[KScoreDialog::Name] = m_ownNickname;
- info[KScoreDialog::Custom1] = QString::number(m_stat->shot());
- info[KScoreDialog::Custom2] = QString::number(m_stat->hit());
- info[KScoreDialog::Custom3] = QString::number(m_stat->water());
+ info[KScoreDialog::Custom1] = TQString::number(m_stat->shot());
+ info[KScoreDialog::Custom2] = TQString::number(m_stat->hit());
+ info[KScoreDialog::Custom3] = TQString::number(m_stat->water());
scoreDialog->addScore((int)score, info, false, false);
}
@@ -697,8 +697,8 @@ void KBattleshipWindow::slotServerConnect()
slotStatusMsg(i18n("Loading Connect-Server dialog..."));
m_client = new KClientDialog(this);
- connect(m_client, SIGNAL(sigConnectServer()), this, SLOT(slotConnectToBattleshipServer()));
- connect(m_client, SIGNAL(sigCancelConnect()), this, SLOT(slotDeleteConnectDialog()));
+ connect(m_client, TQT_SIGNAL(sigConnectServer()), this, TQT_SLOT(slotConnectToBattleshipServer()));
+ connect(m_client, TQT_SIGNAL(sigCancelConnect()), this, TQT_SLOT(slotDeleteConnectDialog()));
m_client->show();
slotStatusMsg(i18n("Ready"));
@@ -715,7 +715,7 @@ void KBattleshipWindow::slotDeleteConnectDialog()
void KBattleshipWindow::slotReplayRequest()
{
- switch(KMessageBox::questionYesNo(this, i18n("The client is asking to restart the game. Do you accept?"),QString::null,i18n("Accept Restart"), i18n("Deny Restart")))
+ switch(KMessageBox::questionYesNo(this, i18n("The client is asking to restart the game. Do you accept?"),TQString::null,i18n("Accept Restart"), i18n("Deny Restart")))
{
case KMessageBox::Yes:
if (m_connection)
@@ -735,7 +735,7 @@ void KBattleshipWindow::slotReplayRequest()
void KBattleshipWindow::slotServerReplay()
{
KMessage *msg = new KMessage(KMessage::REPLAY);
- switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"), QString::null, i18n("Restart"), i18n("Do Not Restart")))
+ switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"), TQString::null, i18n("Restart"), i18n("Do Not Restart")))
{
case KMessageBox::Yes:
if (m_connection)
@@ -761,7 +761,7 @@ void KBattleshipWindow::slotServerReplay()
void KBattleshipWindow::slotClientReplay()
{
KMessage *msg = new KMessage(KMessage::REPLAY);
- switch(KMessageBox::questionYesNo(this, i18n("Do you want to ask the server restarting the game?"), QString::null, i18n("Ask to Restart"), i18n("Do Not Ask")))
+ switch(KMessageBox::questionYesNo(this, i18n("Do you want to ask the server restarting the game?"), TQString::null, i18n("Ask to Restart"), i18n("Do Not Ask")))
{
case KMessageBox::Yes:
if (m_connection)
@@ -806,8 +806,8 @@ void KBattleshipWindow::slotNewServer()
slotStatusMsg(i18n("Loading Start-Server dialog..."));
m_server = new KServerDialog(this);
- connect(m_server, SIGNAL(okClicked()), this, SLOT(slotStartBattleshipServer()));
- connect(m_server, SIGNAL(cancelClicked()), this, SLOT(slotDeleteServerDialog()));
+ connect(m_server, TQT_SIGNAL(okClicked()), this, TQT_SLOT(slotStartBattleshipServer()));
+ connect(m_server, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(slotDeleteServerDialog()));
m_server->show();
slotStatusMsg(i18n("Ready"));
@@ -828,7 +828,7 @@ void KBattleshipWindow::slotSendVersion()
msg->versionMessage();
slotSendMessage(msg);
- QTimer::singleShot(150, this, SLOT(slotSendGreet()));
+ TQTimer::singleShot(150, this, TQT_SLOT(slotSendGreet()));
}
void KBattleshipWindow::slotSendGreet()
@@ -837,7 +837,7 @@ void KBattleshipWindow::slotSendGreet()
m_chat->slotAcceptMsg(true);
KMessage *msg = new KMessage(KMessage::GREET);
- msg->addField(QString("nickname"), m_ownNickname);
+ msg->addField(TQString("nickname"), m_ownNickname);
slotSendMessage(msg);
}
@@ -862,49 +862,49 @@ void KBattleshipWindow::slotStartBattleshipServer()
if(m_connection == 0)
{
m_connection = new KonnectionHandling(this, m_kbserver);
- connect(m_connection, SIGNAL(sigStatusBar(const QString &)), this, SLOT(slotStatusMsg(const QString &)));
- connect(m_connection, SIGNAL(sigEnemyNickname(const QString &)), this, SLOT(slotChangeEnemyPlayer(const QString &)));
- connect(m_connection, SIGNAL(sigSendNickname()), this, SLOT(slotSendGreet()));
- connect(m_connection, SIGNAL(sigPlaceShips(bool)), this, SLOT(slotSetPlaceable(bool)));
- connect(m_connection, SIGNAL(sigShootable(bool)), this, SLOT(slotSetShootable(bool)));
- connect(m_connection, SIGNAL(sigSendFieldState(int, int)), this, SLOT(slotSendEnemyFieldState(int, int)));
- connect(m_connection, SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool)));
- connect(m_connection, SIGNAL(sigClientLost()), this, SLOT(slotClientLost()));
- connect(m_connection, SIGNAL(sigAbortNetworkGame()), this, SLOT(slotAbortNetworkGame()));
- connect(m_connection, SIGNAL(sigReplay()), this, SLOT(slotReplayRequest()));
- connect(m_connection, SIGNAL(sigChatMessage(const QString &, const QString &, bool)), m_chat, SLOT(slotReceivedMessage(const QString &, const QString &, bool)));
- connect(m_connection, SIGNAL(sigClientInformation(const QString &, const QString &, const QString &, const QString &)), this, SLOT(slotReceivedClientInformation(const QString &, const QString &, const QString &, const QString &)));
- connect(m_connection, SIGNAL(sigLost(KMessage *)), this, SLOT(slotLost(KMessage *)));
+ connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &)));
+ connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &)));
+ connect(m_connection, TQT_SIGNAL(sigSendNickname()), this, TQT_SLOT(slotSendGreet()));
+ connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool)));
+ connect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool)));
+ connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int)));
+ connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool)));
+ connect(m_connection, TQT_SIGNAL(sigClientLost()), this, TQT_SLOT(slotClientLost()));
+ connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame()));
+ connect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplayRequest()));
+ connect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool)));
+ connect(m_connection, TQT_SIGNAL(sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)), this, TQT_SLOT(slotReceivedClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)));
+ connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *)));
}
else
{
if(m_connection->type() == KonnectionHandling::CLIENT)
{
- disconnect(m_kbclient, SIGNAL(sigConnected()), this, SLOT(slotSendVersion()));
- disconnect(m_connection, SIGNAL(sigAbortNetworkGame()), this, SLOT(slotAbortNetworkGame()));
- disconnect(m_connection, SIGNAL(sigStatusBar(const QString &)), this, SLOT(slotStatusMsg(const QString &)));
- disconnect(m_connection, SIGNAL(sigEnemyNickname(const QString &)), this, SLOT(slotChangeEnemyPlayer(const QString &)));
- disconnect(m_connection, SIGNAL(sigSendFieldState(int, int)), this, SLOT(slotSendEnemyFieldState(int, int)));
- disconnect(m_connection, SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool)));
- disconnect(m_connection, SIGNAL(sigShootable(bool)), this, SLOT(slotSetShootable(bool)));
- disconnect(m_connection, SIGNAL(sigPlaceShips(bool)), this, SLOT(slotSetPlaceable(bool)));
- disconnect(m_connection, SIGNAL(sigServerLost()), this, SLOT(slotServerLost()));
- disconnect(m_connection, SIGNAL(sigReplay()), this, SLOT(slotReplay()));
- disconnect(m_connection, SIGNAL(sigChatMessage(const QString &, const QString &, bool)), m_chat, SLOT(slotReceivedMessage(const QString &, const QString &, bool)));
- disconnect(m_connection, SIGNAL(sigLost(KMessage *)), this, SLOT(slotLost(KMessage *)));
+ disconnect(m_kbclient, TQT_SIGNAL(sigConnected()), this, TQT_SLOT(slotSendVersion()));
+ disconnect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame()));
+ disconnect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &)));
+ disconnect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &)));
+ disconnect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int)));
+ disconnect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool)));
+ disconnect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool)));
+ disconnect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool)));
+ disconnect(m_connection, TQT_SIGNAL(sigServerLost()), this, TQT_SLOT(slotServerLost()));
+ disconnect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplay()));
+ disconnect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool)));
+ disconnect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *)));
m_connection->updateInternal(m_kbserver);
- connect(m_connection, SIGNAL(sigStatusBar(const QString &)), this, SLOT(slotStatusMsg(const QString &)));
- connect(m_connection, SIGNAL(sigEnemyNickname(const QString &)), this, SLOT(slotChangeEnemyPlayer(const QString &)));
- connect(m_connection, SIGNAL(sigSendNickname()), this, SLOT(slotSendGreet()));
- connect(m_connection, SIGNAL(sigPlaceShips(bool)), this, SLOT(slotSetPlaceable(bool)));
- connect(m_connection, SIGNAL(sigShootable(bool)), this, SLOT(slotSetShootable(bool)));
- connect(m_connection, SIGNAL(sigSendFieldState(int, int)), this, SLOT(slotSendEnemyFieldState(int, int)));
- connect(m_connection, SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool)));
- connect(m_connection, SIGNAL(sigClientLost()), this, SLOT(slotClientLost()));
- connect(m_connection, SIGNAL(sigAbortNetworkGame()), this, SLOT(slotAbortNetworkGame()));
- connect(m_connection, SIGNAL(sigReplay()), this, SLOT(slotReplayRequest()));
- connect(m_connection, SIGNAL(sigChatMessage(const QString &, const QString &, bool)), m_chat, SLOT(slotReceivedMessage(const QString &, const QString &, bool)));
- connect(m_connection, SIGNAL(sigLost(KMessage *)), this, SLOT(slotLost(KMessage *)));
+ connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &)));
+ connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &)));
+ connect(m_connection, TQT_SIGNAL(sigSendNickname()), this, TQT_SLOT(slotSendGreet()));
+ connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool)));
+ connect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool)));
+ connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int)));
+ connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool)));
+ connect(m_connection, TQT_SIGNAL(sigClientLost()), this, TQT_SLOT(slotClientLost()));
+ connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame()));
+ connect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplayRequest()));
+ connect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool)));
+ connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *)));
}
else
m_connection->updateInternal(m_kbserver);
@@ -923,7 +923,7 @@ void KBattleshipWindow::slotSendEnemyFieldState(int fieldx, int fieldy)
{
int data, showstate;
bool xokay = false, yokay = false, is_kill = false;
- typedef QValueList<int> DeathValueList;
+ typedef TQValueList<int> DeathValueList;
DeathValueList deathList;
data = m_ownshiplist->shipTypeAt(fieldx, fieldy);
@@ -982,46 +982,46 @@ void KBattleshipWindow::slotSendEnemyFieldState(int fieldx, int fieldy)
}
else if(m_ownshiplist->shipTypeAt(fieldx, fieldy) == 0)
{
- msg->addField(QString("xstart"), QString::number(fieldx));
- msg->addField(QString("xstop"), QString::number(fieldx));
- msg->addField(QString("ystart"), QString::number(fieldy));
- msg->addField(QString("ystop"), QString::number(fieldy));
- msg->addField(QString("death"), QString("true"));
+ msg->addField(TQString("xstart"), TQString::number(fieldx));
+ msg->addField(TQString("xstop"), TQString::number(fieldx));
+ msg->addField(TQString("ystart"), TQString::number(fieldy));
+ msg->addField(TQString("ystop"), TQString::number(fieldy));
+ msg->addField(TQString("death"), TQString("true"));
is_kill = true;
}
}
- msg->addField(QString("fieldx"), QString::number(fieldx));
- msg->addField(QString("fieldy"), QString::number(fieldy));
+ msg->addField(TQString("fieldx"), TQString::number(fieldx));
+ msg->addField(TQString("fieldy"), TQString::number(fieldy));
if(xokay)
{
- msg->addField(QString("xstart"), QString::number(deathList.first()));
- msg->addField(QString("xstop"), QString::number(deathList.last()));
- msg->addField(QString("ystart"), QString::number(fieldy));
- msg->addField(QString("ystop"), QString::number(fieldy));
- msg->addField(QString("death"), QString("true"));
+ msg->addField(TQString("xstart"), TQString::number(deathList.first()));
+ msg->addField(TQString("xstop"), TQString::number(deathList.last()));
+ msg->addField(TQString("ystart"), TQString::number(fieldy));
+ msg->addField(TQString("ystop"), TQString::number(fieldy));
+ msg->addField(TQString("death"), TQString("true"));
is_kill = true;
}
else if(yokay)
{
- msg->addField(QString("xstart"), QString::number(fieldx));
- msg->addField(QString("xstop"), QString::number(fieldx));
- msg->addField(QString("ystart"), QString::number(deathList.first()));
- msg->addField(QString("ystop"), QString::number(deathList.last()));
- msg->addField(QString("death"), QString("true"));
+ msg->addField(TQString("xstart"), TQString::number(fieldx));
+ msg->addField(TQString("xstop"), TQString::number(fieldx));
+ msg->addField(TQString("ystart"), TQString::number(deathList.first()));
+ msg->addField(TQString("ystop"), TQString::number(deathList.last()));
+ msg->addField(TQString("death"), TQString("true"));
is_kill = true;
}
if(is_kill)
// If sunk, reveal ship type
- msg->addField(QString("fieldstate"), QString::number(data));
+ msg->addField(TQString("fieldstate"), TQString::number(data));
else if(showstate == KBattleField::HIT)
// On non-fatal hit, keep ship type secret
- msg->addField(QString("fieldstate"), QString::number(1));
+ msg->addField(TQString("fieldstate"), TQString::number(1));
else /* showstate == KBattleField::WATER */
// Miss
- msg->addField(QString("fieldstate"), QString::number(99));
+ msg->addField(TQString("fieldstate"), TQString::number(99));
if(m_connection->type() == KonnectionHandling::SERVER)
m_kbserver->sendMessage(msg);
@@ -1094,14 +1094,14 @@ void KBattleshipWindow::parseCommandLine() {
void KBattleshipWindow::slotConnectToBattleshipServer()
{
- QString host = m_client->host();
+ TQString host = m_client->host();
int port = m_client->port().toInt();
- QString nickname = m_client->nickname();
+ TQString nickname = m_client->nickname();
delete m_client;
m_client = 0;
slotConnectToBattleshipServer(host, port, nickname);
}
-void KBattleshipWindow::slotConnectToBattleshipServer(const QString &host, int port, const QString &nickname)
+void KBattleshipWindow::slotConnectToBattleshipServer(const TQString &host, int port, const TQString &nickname)
{
m_kbclient = new KBattleshipClient(host, port);
nickname.isEmpty() ? m_ownNickname = "TestUser" : m_ownNickname = nickname;
@@ -1119,51 +1119,51 @@ void KBattleshipWindow::slotConnectToBattleshipServer(const QString &host, int p
if(m_connection == 0)
{
m_connection = new KonnectionHandling(this, m_kbclient);
- connect(m_kbclient, SIGNAL(sigConnected()), this, SLOT(slotSendVersion()));
- connect(m_connection, SIGNAL(sigAbortNetworkGame()), this, SLOT(slotAbortNetworkGame()));
- connect(m_connection, SIGNAL(sigStatusBar(const QString &)), this, SLOT(slotStatusMsg(const QString &)));
- connect(m_connection, SIGNAL(sigEnemyNickname(const QString &)), this, SLOT(slotChangeEnemyPlayer(const QString &)));
- connect(m_connection, SIGNAL(sigSendFieldState(int, int)), this, SLOT(slotSendEnemyFieldState(int, int)));
- connect(m_connection, SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool)));
- connect(m_connection, SIGNAL(sigShootable(bool)), this, SLOT(slotSetShootable(bool)));
- connect(m_connection, SIGNAL(sigPlaceShips(bool)), this, SLOT(slotSetPlaceable(bool)));
- connect(m_connection, SIGNAL(sigServerLost()), this, SLOT(slotServerLost()));
- connect(m_connection, SIGNAL(sigReplay()), this, SLOT(slotReplay()));
- connect(m_connection, SIGNAL(sigChatMessage(const QString &, const QString &, bool)), m_chat, SLOT(slotReceivedMessage(const QString &, const QString &, bool)));
- connect(m_connection, SIGNAL(sigClientInformation(const QString &, const QString &, const QString &, const QString &)), this, SLOT(slotReceivedClientInformation(const QString &, const QString &, const QString &, const QString &)));
- connect(m_connection, SIGNAL(sigLost(KMessage *)), this, SLOT(slotLost(KMessage *)));
+ connect(m_kbclient, TQT_SIGNAL(sigConnected()), this, TQT_SLOT(slotSendVersion()));
+ connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame()));
+ connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &)));
+ connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &)));
+ connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int)));
+ connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool)));
+ connect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool)));
+ connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool)));
+ connect(m_connection, TQT_SIGNAL(sigServerLost()), this, TQT_SLOT(slotServerLost()));
+ connect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplay()));
+ connect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool)));
+ connect(m_connection, TQT_SIGNAL(sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)), this, TQT_SLOT(slotReceivedClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)));
+ connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *)));
}
else
{
if(m_connection->type() == KonnectionHandling::SERVER)
{
- disconnect(m_connection, SIGNAL(sigStatusBar(const QString &)), this, SLOT(slotStatusMsg(const QString &)));
- disconnect(m_connection, SIGNAL(sigEnemyNickname(const QString &)), this, SLOT(slotChangeEnemyPlayer(const QString &)));
- disconnect(m_connection, SIGNAL(sigSendNickname()), this, SLOT(slotSendGreet()));
- disconnect(m_connection, SIGNAL(sigPlaceShips(bool)), this, SLOT(slotSetPlaceable(bool)));
- disconnect(m_connection, SIGNAL(sigShootable(bool)), this, SLOT(slotSetShootable(bool)));
- disconnect(m_connection, SIGNAL(sigSendFieldState(int, int)), this, SLOT(slotSendEnemyFieldState(int, int)));
- disconnect(m_connection, SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool)));
- disconnect(m_connection, SIGNAL(sigClientLost()), this, SLOT(slotClientLost()));
- disconnect(m_connection, SIGNAL(sigAbortNetworkGame()), this, SLOT(slotAbortNetworkGame()));
- disconnect(m_connection, SIGNAL(sigReplay()), this, SLOT(slotReplayRequest()));
- disconnect(m_connection, SIGNAL(sigChatMessage(const QString &, const QString &, bool)), m_chat, SLOT(slotReceivedMessage(const QString &, const QString &, bool)));
- disconnect(m_connection, SIGNAL(sigLost(KMessage *)), this, SLOT(slotLost(KMessage *)));
+ disconnect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &)));
+ disconnect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &)));
+ disconnect(m_connection, TQT_SIGNAL(sigSendNickname()), this, TQT_SLOT(slotSendGreet()));
+ disconnect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool)));
+ disconnect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool)));
+ disconnect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int)));
+ disconnect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool)));
+ disconnect(m_connection, TQT_SIGNAL(sigClientLost()), this, TQT_SLOT(slotClientLost()));
+ disconnect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame()));
+ disconnect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplayRequest()));
+ disconnect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool)));
+ disconnect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *)));
m_connection->updateInternal(m_kbclient);
- connect(m_kbclient, SIGNAL(sigConnected()), this, SLOT(slotSendVersion()));
- connect(m_connection, SIGNAL(sigAbortNetworkGame()), this, SLOT(slotAbortNetworkGame()));
- connect(m_connection, SIGNAL(sigStatusBar(const QString &)), this, SLOT(slotStatusMsg(const QString &)));
- connect(m_connection, SIGNAL(sigEnemyNickname(const QString &)), this, SLOT(slotChangeEnemyPlayer(const QString &)));
- connect(m_connection, SIGNAL(sigSendFieldState(int, int)), this, SLOT(slotSendEnemyFieldState(int, int)));
- connect(m_connection, SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool)));
- connect(m_connection, SIGNAL(sigShootable(bool)), this, SLOT(slotSetShootable(bool)));
- connect(m_connection, SIGNAL(sigPlaceShips(bool)), this, SLOT(slotSetPlaceable(bool)));
- connect(m_connection, SIGNAL(sigServerLost()), this, SLOT(slotServerLost()));
- connect(m_connection, SIGNAL(sigReplay()), this, SLOT(slotReplay()));
- connect(m_connection, SIGNAL(sigChatMessage(const QString &, const QString &, bool)), m_chat, SLOT(slotReceivedMessage(const QString &, const QString &, bool)));
+ connect(m_kbclient, TQT_SIGNAL(sigConnected()), this, TQT_SLOT(slotSendVersion()));
+ connect(m_connection, TQT_SIGNAL(sigAbortNetworkGame()), this, TQT_SLOT(slotAbortNetworkGame()));
+ connect(m_connection, TQT_SIGNAL(sigStatusBar(const TQString &)), this, TQT_SLOT(slotStatusMsg(const TQString &)));
+ connect(m_connection, TQT_SIGNAL(sigEnemyNickname(const TQString &)), this, TQT_SLOT(slotChangeEnemyPlayer(const TQString &)));
+ connect(m_connection, TQT_SIGNAL(sigSendFieldState(int, int)), this, TQT_SLOT(slotSendEnemyFieldState(int, int)));
+ connect(m_connection, TQT_SIGNAL(sigEnemyFieldData(int, int, int, int, int, int, int, bool)), this, TQT_SLOT(slotReceivedEnemyFieldData(int, int, int, int, int, int, int, bool)));
+ connect(m_connection, TQT_SIGNAL(sigShootable(bool)), this, TQT_SLOT(slotSetShootable(bool)));
+ connect(m_connection, TQT_SIGNAL(sigPlaceShips(bool)), this, TQT_SLOT(slotSetPlaceable(bool)));
+ connect(m_connection, TQT_SIGNAL(sigServerLost()), this, TQT_SLOT(slotServerLost()));
+ connect(m_connection, TQT_SIGNAL(sigReplay()), this, TQT_SLOT(slotReplay()));
+ connect(m_connection, TQT_SIGNAL(sigChatMessage(const TQString &, const TQString &, bool)), m_chat, TQT_SLOT(slotReceivedMessage(const TQString &, const TQString &, bool)));
m_kbclient->init();
- connect(m_connection, SIGNAL(sigClientInformation(const QString &, const QString &, const QString &, const QString &)), this, SLOT(slotReceivedClientInformation(const QString &, const QString &, const QString &, const QString &)));
- connect(m_connection, SIGNAL(sigLost(KMessage *)), this, SLOT(slotLost(KMessage *)));
+ connect(m_connection, TQT_SIGNAL(sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)), this, TQT_SLOT(slotReceivedClientInformation(const TQString &, const TQString &, const TQString &, const TQString &)));
+ connect(m_connection, TQT_SIGNAL(sigLost(KMessage *)), this, TQT_SLOT(slotLost(KMessage *)));
}
else
m_connection->updateInternal(m_kbclient);
@@ -1189,19 +1189,19 @@ void KBattleshipWindow::slotShowGrid()
m_view->field()->enableGrid();
}
-void KBattleshipWindow::slotStatusMsg(const QString &text)
+void KBattleshipWindow::slotStatusMsg(const TQString &text)
{
statusBar()->clear();
statusBar()->changeItem(text, ID_STATUS_MSG);
}
-void KBattleshipWindow::slotChangeOwnPlayer(const QString &text)
+void KBattleshipWindow::slotChangeOwnPlayer(const TQString &text)
{
statusBar()->clear();
statusBar()->changeItem(i18n(" Player 1: %1 ").arg(text), ID_PLAYER_OWN);
}
-void KBattleshipWindow::slotChangeEnemyPlayer(const QString &text)
+void KBattleshipWindow::slotChangeEnemyPlayer(const TQString &text)
{
statusBar()->clear();
statusBar()->changeItem(i18n(" Player 2: %1 ").arg(text), ID_PLAYER_ENEMY);
@@ -1234,7 +1234,7 @@ void KBattleshipWindow::slotSinglePlayer()
slotStatusMsg(i18n("Ready"));
m_stat->clear();
m_chat->clear();
- QTimer::singleShot(0, this, SLOT(slotDeleteAI()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotDeleteAI()));
cleanup(false);
}
}
@@ -1269,8 +1269,8 @@ void KBattleshipWindow::slotStartBattleshipGame(bool clearstat)
{
m_aiPlayer = new KBAIPlayer();
m_aiPlayer->init(m_view->field(), m_enemyshiplist);
- connect(m_aiPlayer, SIGNAL(sigReady()), this, SLOT(slotAIReady()));
- connect(m_aiPlayer, SIGNAL(sigShootAt(const QPoint)), this, SLOT(slotAIShootsAt(const QPoint)));
+ connect(m_aiPlayer, TQT_SIGNAL(sigReady()), this, TQT_SLOT(slotAIReady()));
+ connect(m_aiPlayer, TQT_SIGNAL(sigShootAt(const TQPoint)), this, TQT_SLOT(slotAIShootsAt(const TQPoint)));
}
m_aiPlayer->slotRestart();
}
@@ -1281,7 +1281,7 @@ void KBattleshipWindow::slotAIReady()
m_placeable = true;
}
-void KBattleshipWindow::slotAIShootsAt(const QPoint pos)
+void KBattleshipWindow::slotAIShootsAt(const TQPoint pos)
{
if(!m_shootable)
m_shootable = true;
@@ -1317,14 +1317,14 @@ void KBattleshipWindow::slotAIShootsAt(const QPoint pos)
m_stat->slotAddEnemyWon();
slotUpdateHighscore();
m_view->drawEnemyShipsAI(m_enemyshiplist); // let's show ai player ships
- switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"), QString::null, i18n("Restart"), i18n("Do Not Restart")))
+ switch(KMessageBox::questionYesNo(this, i18n("Do you want to restart the game?"), TQString::null, i18n("Restart"), i18n("Do Not Restart")))
{
case KMessageBox::Yes:
- QTimer::singleShot(0, this, SLOT(slotRestartAI()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotRestartAI()));
break;
case KMessageBox::No:
- QTimer::singleShot(0, this, SLOT(slotDeleteAI()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotDeleteAI()));
break;
}
}
@@ -1335,7 +1335,7 @@ void KBattleshipWindow::slotAIShootsAt(const QPoint pos)
}
}
-void KBattleshipWindow::slotReceivedClientInformation(const QString &clientName, const QString &clientVersion, const QString &clientDescription, const QString &protocolVersion)
+void KBattleshipWindow::slotReceivedClientInformation(const TQString &clientName, const TQString &clientVersion, const TQString &clientDescription, const TQString &protocolVersion)
{
m_enemyClient = clientName;
m_enemyClientVersion = clientVersion;
diff --git a/kbattleship/kbattleship/kbattleship.h b/kbattleship/kbattleship/kbattleship.h
index 7e606140..9ba86eac 100644
--- a/kbattleship/kbattleship/kbattleship.h
+++ b/kbattleship/kbattleship/kbattleship.h
@@ -28,7 +28,7 @@
#include <kmessagebox.h>
#include <kstdaction.h>
-#include <qstring.h>
+#include <tqstring.h>
#include "dialogs/infoDlg.h"
@@ -61,11 +61,11 @@ private slots:
void changeShipPlacementDirection();
void slotConfigureNotifications();
void slotLost(KMessage *msg);
- void slotStatusMsg(const QString &text);
+ void slotStatusMsg(const TQString &text);
void slotReceivedEnemyFieldData(int fieldx, int fieldx1, int enemystate, int xstart, int xstop, int ystart, int ystop, bool death);
void slotSendEnemyFieldState(int, int);
- void slotChangeOwnPlayer(const QString &text);
- void slotChangeEnemyPlayer(const QString &text);
+ void slotChangeOwnPlayer(const TQString &text);
+ void slotChangeEnemyPlayer(const TQString &text);
void slotSendVersion();
void slotSendGreet();
void slotShipsReady();
@@ -79,7 +79,7 @@ private slots:
void slotServerReplay();
void slotClientReplay();
void slotAIReady();
- void slotAIShootsAt(const QPoint pos);
+ void slotAIShootsAt(const TQPoint pos);
void slotDeleteAI();
void slotRestartAI();
void slotSinglePlayer();
@@ -96,7 +96,7 @@ private slots:
* Get server to connect to from "Connect to server" dialog.
*/
void slotConnectToBattleshipServer();
- void slotConnectToBattleshipServer(const QString &host, int port, const QString &nickname);
+ void slotConnectToBattleshipServer(const TQString &host, int port, const TQString &nickname);
void slotPlaceShipPreview(int fieldx, int fieldy);
void slotPlaceShip(int fieldx, int fieldy);
void slotChangeOwnFieldData(int fieldx, int fieldy, int type);
@@ -105,10 +105,10 @@ private slots:
void slotAbortNetworkGame();
void slotReplay();
void slotReplayRequest();
- void slotChangedNickCommand(const QString &text);
- void slotSendChatMessage(const QString &text);
+ void slotChangedNickCommand(const TQString &text);
+ void slotSendChatMessage(const TQString &text);
void slotEnemyClientInfo();
- void slotReceivedClientInformation(const QString &client, const QString &clientVersion, const QString &clientInformation, const QString &protocolVersion);
+ void slotReceivedClientInformation(const TQString &client, const TQString &clientVersion, const TQString &clientInformation, const TQString &protocolVersion);
private:
bool shift;
@@ -131,10 +131,10 @@ private:
bool m_lost;
int m_aiHits;
- QString m_enemyClient;
- QString m_enemyClientVersion;
- QString m_enemyClientDescription;
- QString m_enemyProtocolVersion;
+ TQString m_enemyClient;
+ TQString m_enemyClientVersion;
+ TQString m_enemyClientDescription;
+ TQString m_enemyProtocolVersion;
KConfig *m_config;
KBAIPlayer *m_aiPlayer;
@@ -155,8 +155,8 @@ private:
KServerDialog *m_server;
KShipList *m_ownshiplist;
KShipList *m_enemyshiplist;
- QString m_ownNickname;
- QString m_enemyNickname;
+ TQString m_ownNickname;
+ TQString m_enemyNickname;
};
#endif
diff --git a/kbattleship/kbattleship/kbattleshipclient.cpp b/kbattleship/kbattleship/kbattleshipclient.cpp
index d8ae2a75..e7d61638 100644
--- a/kbattleship/kbattleship/kbattleshipclient.cpp
+++ b/kbattleship/kbattleship/kbattleshipclient.cpp
@@ -27,11 +27,11 @@
#include <sys/filio.h>
#endif
#include <sys/ioctl.h>
-#include <qsocketnotifier.h>
+#include <tqsocketnotifier.h>
#include "kmessage.h"
#include "kbattleshipclient.moc"
-KBattleshipClient::KBattleshipClient(const QString &host, int port) : KExtendedSocket(host, port, inetSocket)
+KBattleshipClient::KBattleshipClient(const TQString &host, int port) : KExtendedSocket(host, port, inetSocket)
{
}
@@ -43,14 +43,14 @@ void KBattleshipClient::init()
return;
}
- m_readNotifier = new QSocketNotifier(fd(), QSocketNotifier::Read, this);
- QObject::connect(m_readNotifier, SIGNAL(activated(int)), SLOT(slotReadData()));
+ m_readNotifier = new TQSocketNotifier(fd(), TQSocketNotifier::Read, this);
+ TQObject::connect(m_readNotifier, TQT_SIGNAL(activated(int)), TQT_SLOT(slotReadData()));
emit sigConnected();
}
void KBattleshipClient::sendMessage(KMessage *msg)
{
- QCString post = msg->sendStream().utf8();
+ TQCString post = msg->sendStream().utf8();
writeBlock(post.data(), post.length());
emit sigMessageSent(msg);
}
@@ -70,7 +70,7 @@ void KBattleshipClient::slotReadData()
char *buf = new char[len + 1];
readBlock(buf, len);
buf[len] = 0;
- m_readBuffer += QString::fromUtf8(buf);
+ m_readBuffer += TQString::fromUtf8(buf);
delete []buf;
int pos;
while ((pos = m_readBuffer.find("</kmessage>")) >= 0)
diff --git a/kbattleship/kbattleship/kbattleshipclient.h b/kbattleship/kbattleship/kbattleshipclient.h
index d69ec7f9..1f6bdd96 100644
--- a/kbattleship/kbattleship/kbattleshipclient.h
+++ b/kbattleship/kbattleship/kbattleshipclient.h
@@ -19,14 +19,14 @@
#define KBATTLESHIPCLIENT_H
#include <kextsock.h>
-#include <qsocketnotifier.h>
+#include <tqsocketnotifier.h>
#include "kmessage.h"
class KBattleshipClient : public KExtendedSocket
{
Q_OBJECT
public:
- KBattleshipClient(const QString &host, int port);
+ KBattleshipClient(const TQString &host, int port);
void init();
void sendMessage(KMessage *msg);
@@ -42,8 +42,8 @@ signals:
void sigMessageSent(KMessage *);
private:
- QSocketNotifier *m_readNotifier;
- QString m_readBuffer;
+ TQSocketNotifier *m_readNotifier;
+ TQString m_readBuffer;
};
#endif
diff --git a/kbattleship/kbattleship/kbattleshipserver.cpp b/kbattleship/kbattleship/kbattleshipserver.cpp
index d03bd213..a90533cc 100644
--- a/kbattleship/kbattleship/kbattleshipserver.cpp
+++ b/kbattleship/kbattleship/kbattleshipserver.cpp
@@ -25,13 +25,13 @@
#include <sys/filio.h>
#endif
#include <sys/ioctl.h>
-#include <qtimer.h>
+#include <tqtimer.h>
#include <kmessagebox.h>
#include <klocale.h>
#include "kbattleshipserver.moc"
-KBattleshipServer::KBattleshipServer(int port, const QString& name)
- : KExtendedSocket(QString::null, port, inetSocket | passiveSocket), m_name(name)
+KBattleshipServer::KBattleshipServer(int port, const TQString& name)
+ : KExtendedSocket(TQString::null, port, inetSocket | passiveSocket), m_name(name)
{
m_port = port;
m_serverSocket = 0;
@@ -49,8 +49,8 @@ void KBattleshipServer::init()
m_service.setType(BATTLESHIP_SERVICE);
m_service.setPort(m_port);
m_service.publishAsync();
- m_connectNotifier = new QSocketNotifier(fd(), QSocketNotifier::Read, this);
- QObject::connect(m_connectNotifier, SIGNAL(activated(int)), SLOT(slotNewConnection()));
+ m_connectNotifier = new TQSocketNotifier(fd(), TQSocketNotifier::Read, this);
+ TQObject::connect(m_connectNotifier, TQT_SIGNAL(activated(int)), TQT_SLOT(slotNewConnection()));
}
void KBattleshipServer::slotNewConnection()
@@ -61,8 +61,8 @@ void KBattleshipServer::slotNewConnection()
{
m_service.stop();
m_serverSocket = sock;
- m_readNotifier = new QSocketNotifier(sock->fd(), QSocketNotifier::Read, this);
- QObject::connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(slotReadClient()));
+ m_readNotifier = new TQSocketNotifier(sock->fd(), TQSocketNotifier::Read, this);
+ TQObject::connect(m_readNotifier, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotReadClient()));
emit sigNewConnect();
}
else
@@ -82,7 +82,7 @@ void KBattleshipServer::slotReadClient()
char *buf = new char[len + 1];
m_serverSocket->readBlock(buf, len);
buf[len] = 0;
- m_readBuffer += QString::fromUtf8(buf);
+ m_readBuffer += TQString::fromUtf8(buf);
delete []buf;
int pos;
while ((pos = m_readBuffer.find("</kmessage>")) >= 0)
@@ -97,12 +97,12 @@ void KBattleshipServer::slotReadClient()
void KBattleshipServer::sendMessage(KMessage *msg)
{
- QCString post = msg->sendStream().utf8();
+ TQCString post = msg->sendStream().utf8();
m_serverSocket->writeBlock(post.data(), post.length());
emit sigMessageSent(msg);
}
-void KBattleshipServer::slotDiscardClient(const QString &reason, bool kmversion, bool bemit)
+void KBattleshipServer::slotDiscardClient(const TQString &reason, bool kmversion, bool bemit)
{
KMessage *msg = new KMessage(KMessage::DISCARD);
msg->addField("reason", reason);
@@ -110,7 +110,7 @@ void KBattleshipServer::slotDiscardClient(const QString &reason, bool kmversion,
msg->addField("kmversion", "true");
else
msg->addField("kmversion", "false");
- QCString post = msg->sendStream().utf8();
+ TQCString post = msg->sendStream().utf8();
m_serverSocket->writeBlock(post.data(), post.length());
delete msg;
diff --git a/kbattleship/kbattleship/kbattleshipserver.h b/kbattleship/kbattleship/kbattleshipserver.h
index 46f815e0..bb198db8 100644
--- a/kbattleship/kbattleship/kbattleshipserver.h
+++ b/kbattleship/kbattleship/kbattleshipserver.h
@@ -19,7 +19,7 @@
#define KBATTLESHIPSERVER_H
#include <kextsock.h>
-#include <qsocketnotifier.h>
+#include <tqsocketnotifier.h>
#include <dnssd/publicservice.h>
#include "kmessage.h"
@@ -27,12 +27,12 @@ class KBattleshipServer : public KExtendedSocket
{
Q_OBJECT
public:
- KBattleshipServer(int port, const QString& name);
+ KBattleshipServer(int port, const TQString& name);
void init();
void sendMessage(KMessage *msg);
public slots:
- void slotDiscardClient(const QString &reason, bool kmversion, bool bemit);
+ void slotDiscardClient(const TQString &reason, bool kmversion, bool bemit);
private slots:
void slotNewConnection();
@@ -46,13 +46,13 @@ signals:
void sigMessageSent(KMessage *);
private:
- QSocketNotifier *m_connectNotifier;
- QSocketNotifier *m_readNotifier;
+ TQSocketNotifier *m_connectNotifier;
+ TQSocketNotifier *m_readNotifier;
KExtendedSocket *m_serverSocket;
- QString m_readBuffer;
+ TQString m_readBuffer;
DNSSD::PublicService m_service;
int m_port;
- QString m_name;
+ TQString m_name;
};
#define BATTLESHIP_SERVICE "_kbattleship._tcp"
diff --git a/kbattleship/kbattleship/kbattleshipview.cpp b/kbattleship/kbattleship/kbattleshipview.cpp
index 86e8cbf6..14339d78 100644
--- a/kbattleship/kbattleship/kbattleshipview.cpp
+++ b/kbattleship/kbattleship/kbattleshipview.cpp
@@ -15,15 +15,15 @@
* *
***************************************************************************/
-#include <qlayout.h>
+#include <tqlayout.h>
#include <klocale.h>
#include <kdebug.h>
#include "kbattleship.h"
#include "kbattleshipview.moc"
-KBattleshipView::KBattleshipView(QWidget *parent, const char *name, bool draw)
- : QWidget(parent, name, WResizeNoErase), m_drawGrid(draw)
+KBattleshipView::KBattleshipView(TQWidget *parent, const char *name, bool draw)
+ : TQWidget(parent, name, WResizeNoErase), m_drawGrid(draw)
{
setFixedSize(20 * 32 + 30, 10 * 32 + 20);
setBackgroundMode(NoBackground);
@@ -106,11 +106,11 @@ void KBattleshipView::drawEnemyShipsHuman(KMessage *msg, KShipList *list)
int posx, posy, placedLeft;
bool left;
int i = 3;
- while (!msg->field(QString("ship%1").arg(i)).isNull())
+ while (!msg->field(TQString("ship%1").arg(i)).isNull())
{
- posx = msg->field(QString("ship%1").arg(i)).section(" ", 0, 0).toInt();
- posy = msg->field(QString("ship%1").arg(i)).section(" ", 1, 1).toInt();
- placedLeft = msg->field(QString("ship%1").arg(i)).section(" ", 2, 2).toInt();
+ posx = msg->field(TQString("ship%1").arg(i)).section(" ", 0, 0).toInt();
+ posy = msg->field(TQString("ship%1").arg(i)).section(" ", 1, 1).toInt();
+ placedLeft = msg->field(TQString("ship%1").arg(i)).section(" ", 2, 2).toInt();
if (placedLeft == 0) left = false;
else left = true;
list->addNewShip(!left, posx, posy);
@@ -122,7 +122,7 @@ void KBattleshipView::drawEnemyShipsHuman(KMessage *msg, KShipList *list)
KMessage *KBattleshipView::getAliveShips(KShipList *list)
{
KShip *ship;
- QString shipPos, shipNum;
+ TQString shipPos, shipNum;
int shipType;
int grid = m_battlefield->gridSize();
int width = m_battlefield->enemyRect().width() / grid;
@@ -148,29 +148,29 @@ KMessage *KBattleshipView::getAliveShips(KShipList *list)
return msg;
}
-bool KBattleshipView::eventFilter(QObject *object, QEvent *event)
+bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event)
{
- if(event->type() == QEvent::KeyPress && m_decide)
+ if(event->type() == TQEvent::KeyPress && m_decide)
{
- QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
+ TQKeyEvent *keyEvent = static_cast<TQKeyEvent *>(event);
if(keyEvent->key() == Key_Shift){
emit sigMouseOverField(m_lastX, m_lastY);
emit changeShipPlacementDirection();
}
}
- else if(event->type() == QEvent::KeyRelease && m_decide)
+ else if(event->type() == TQEvent::KeyRelease && m_decide)
{
- QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
+ TQKeyEvent *keyEvent = static_cast<TQKeyEvent *>(event);
if(keyEvent->key() == Key_Shift){
emit sigMouseOverField(m_lastX, m_lastY);
emit changeShipPlacementDirection();
}
}
- else if(event->type() == QEvent::MouseButtonRelease)
+ else if(event->type() == TQEvent::MouseButtonRelease)
{
m_decide = false;
- QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
+ TQMouseEvent *mouseEvent = static_cast<TQMouseEvent *>(event);
if(mouseEvent->button() == RightButton){
emit sigMouseOverField(m_lastX, m_lastY);
@@ -181,11 +181,11 @@ bool KBattleshipView::eventFilter(QObject *object, QEvent *event)
if(mouseEvent->button() != LeftButton)
return false;
- QPoint point(mouseEvent->x(), mouseEvent->y());
- QRect ownRect = m_battlefield->ownRect();
- QRect enemyRect = m_battlefield->enemyRect();
+ TQPoint point(mouseEvent->x(), mouseEvent->y());
+ TQRect ownRect = m_battlefield->ownRect();
+ TQRect enemyRect = m_battlefield->enemyRect();
- QRect newRect;
+ TQRect newRect;
int fieldx = 0;
int fieldy = 0;
@@ -202,7 +202,7 @@ bool KBattleshipView::eventFilter(QObject *object, QEvent *event)
for(int i = newRect.left(); i <= newRect.right(); i += m_battlefield->gridSize())
{
j++;
- QRect tempRect(i, newRect.top(), m_battlefield->gridSize(), newRect.bottom() - newRect.top());
+ TQRect tempRect(i, newRect.top(), m_battlefield->gridSize(), newRect.bottom() - newRect.top());
if(tempRect.contains(point))
{
@@ -216,7 +216,7 @@ bool KBattleshipView::eventFilter(QObject *object, QEvent *event)
for(int i = newRect.top(); i <= newRect.bottom(); i += m_battlefield->gridSize())
{
j++;
- QRect tempRect(newRect.left(), i, newRect.right() - newRect.left(), m_battlefield->gridSize());
+ TQRect tempRect(newRect.left(), i, newRect.right() - newRect.left(), m_battlefield->gridSize());
if(tempRect.contains(point))
{
@@ -232,15 +232,15 @@ bool KBattleshipView::eventFilter(QObject *object, QEvent *event)
return true;
}
- else if(event->type() == QEvent::MouseMove)
+ else if(event->type() == TQEvent::MouseMove)
{
setFocus();
m_decide = true;
- QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
+ TQMouseEvent *mouseEvent = static_cast<TQMouseEvent *>(event);
- QPoint point(mouseEvent->x(), mouseEvent->y());
- QRect ownRect = m_battlefield->ownRect();
+ TQPoint point(mouseEvent->x(), mouseEvent->y());
+ TQRect ownRect = m_battlefield->ownRect();
int fieldx = 0;
int fieldy = 0;
@@ -252,7 +252,7 @@ bool KBattleshipView::eventFilter(QObject *object, QEvent *event)
for(int i = ownRect.left(); i <= ownRect.right(); i += m_battlefield->gridSize())
{
j++;
- QRect tempRect(i, ownRect.top(), m_battlefield->gridSize(), ownRect.bottom() - ownRect.top());
+ TQRect tempRect(i, ownRect.top(), m_battlefield->gridSize(), ownRect.bottom() - ownRect.top());
if(tempRect.contains(point))
{
@@ -266,7 +266,7 @@ bool KBattleshipView::eventFilter(QObject *object, QEvent *event)
for(int i = ownRect.top(); i <= ownRect.bottom(); i += m_battlefield->gridSize())
{
j++;
- QRect tempRect(ownRect.left(), i, ownRect.right() - ownRect.left(), m_battlefield->gridSize());
+ TQRect tempRect(ownRect.left(), i, ownRect.right() - ownRect.left(), m_battlefield->gridSize());
if(tempRect.contains(point))
{
@@ -285,11 +285,11 @@ bool KBattleshipView::eventFilter(QObject *object, QEvent *event)
return true;
}
- else if(event->type() == QEvent::Paint)
+ else if(event->type() == TQEvent::Paint)
{
m_battlefield->drawField();
return true;
}
- return QWidget::eventFilter(object, event);
+ return TQWidget::eventFilter(object, event);
}
diff --git a/kbattleship/kbattleship/kbattleshipview.h b/kbattleship/kbattleship/kbattleshipview.h
index f7f0a953..51d1fcc3 100644
--- a/kbattleship/kbattleship/kbattleshipview.h
+++ b/kbattleship/kbattleship/kbattleshipview.h
@@ -20,10 +20,10 @@
#include <kmainwindow.h>
-#include <qpainter.h>
-#include <qptrlist.h>
-#include <qstring.h>
-#include <qwidget.h>
+#include <tqpainter.h>
+#include <tqptrlist.h>
+#include <tqstring.h>
+#include <tqwidget.h>
#include "kbattlefield.h"
#include "kmessage.h"
@@ -34,7 +34,7 @@ class KBattleshipView : public QWidget
{
Q_OBJECT
public:
- KBattleshipView(QWidget *parent = 0, const char *name = 0, bool draw = false);
+ KBattleshipView(TQWidget *parent = 0, const char *name = 0, bool draw = false);
~KBattleshipView();
KBattleField *field() { return m_battlefield; }
@@ -60,7 +60,7 @@ signals:
void changeShipPlacementDirection();
private:
- bool eventFilter(QObject *object, QEvent *event);
+ bool eventFilter(TQObject *object, TQEvent *event);
KBattleField *m_battlefield;
bool m_drawGrid;
diff --git a/kbattleship/kbattleship/kbchooserstrategy.cpp b/kbattleship/kbattleship/kbchooserstrategy.cpp
index f365c6d1..6473e73b 100644
--- a/kbattleship/kbattleship/kbchooserstrategy.cpp
+++ b/kbattleship/kbattleship/kbchooserstrategy.cpp
@@ -42,7 +42,7 @@ KBChooserStrategy::~KBChooserStrategy()
delete m_random;
}
-void KBChooserStrategy::init(KBattleField *field, const QRect &field_rect)
+void KBChooserStrategy::init(KBattleField *field, const TQRect &field_rect)
{
KBStrategy::init(field, field_rect);
@@ -52,7 +52,7 @@ void KBChooserStrategy::init(KBattleField *field, const QRect &field_rect)
advance();
}
-const QPoint KBChooserStrategy::nextShot()
+const TQPoint KBChooserStrategy::nextShot()
{
if(hasMoreShots())
{
@@ -62,7 +62,7 @@ const QPoint KBChooserStrategy::nextShot()
return m_child->nextShot();
}
- return QPoint(0, 0);
+ return TQPoint(0, 0);
}
bool KBChooserStrategy::advance()
@@ -102,7 +102,7 @@ bool KBChooserStrategy::hasMoreShots()
{
if((!m_destroying) && m_prevShots.count() > 0)
{
- QPoint pos = m_prevShots.last();
+ TQPoint pos = m_prevShots.last();
int state = m_battleField->ownState(pos.x(), pos.y());
if(state == KBattleField::HIT)
{
@@ -132,7 +132,7 @@ bool KBChooserStrategy::hasMoreShots()
return false;
}
-void KBChooserStrategy::shotAt(const QPoint &pos)
+void KBChooserStrategy::shotAt(const TQPoint &pos)
{
m_prevShots.append(pos);
m_child->shotAt(pos);
diff --git a/kbattleship/kbattleship/kbchooserstrategy.h b/kbattleship/kbattleship/kbchooserstrategy.h
index 298cbe68..5ac7d7c2 100644
--- a/kbattleship/kbattleship/kbchooserstrategy.h
+++ b/kbattleship/kbattleship/kbchooserstrategy.h
@@ -28,10 +28,10 @@ public:
KBChooserStrategy(KBStrategy *parent = 0);
virtual ~KBChooserStrategy();
- virtual void init(KBattleField *field, const QRect &field_rect);
- virtual const QPoint nextShot();
+ virtual void init(KBattleField *field, const TQRect &field_rect);
+ virtual const TQPoint nextShot();
virtual bool hasMoreShots();
- virtual void shotAt(const QPoint &pos);
+ virtual void shotAt(const TQPoint &pos);
private:
bool advance();
diff --git a/kbattleship/kbattleship/kbdestroyshipstrategy.cpp b/kbattleship/kbattleship/kbdestroyshipstrategy.cpp
index 714bdd7c..a3882963 100644
--- a/kbattleship/kbattleship/kbdestroyshipstrategy.cpp
+++ b/kbattleship/kbattleship/kbdestroyshipstrategy.cpp
@@ -22,16 +22,16 @@ KBDestroyShipStrategy::KBDestroyShipStrategy(KBStrategy *parent) : KBStrategy(pa
m_working = false;
}
-void KBDestroyShipStrategy::init(KBattleField *field, const QRect &field_rect)
+void KBDestroyShipStrategy::init(KBattleField *field, const TQRect &field_rect)
{
KBStrategy::init(field, field_rect);
m_working = false;
}
-const QPoint KBDestroyShipStrategy::nextShot()
+const TQPoint KBDestroyShipStrategy::nextShot()
{
if(hasMoreShots())
- return QPoint(m_column, m_row);
+ return TQPoint(m_column, m_row);
else
return m_start;
}
@@ -110,12 +110,12 @@ bool KBDestroyShipStrategy::hasMoreShots()
return false;
}
-void KBDestroyShipStrategy::shotAt(const QPoint &pos)
+void KBDestroyShipStrategy::shotAt(const TQPoint &pos)
{
m_prevShots.append(pos);
}
-void KBDestroyShipStrategy::destroyShipAt(const QPoint pos)
+void KBDestroyShipStrategy::destroyShipAt(const TQPoint pos)
{
if(enemyFieldStateAt(pos.x(), pos.y()) == FREE || m_battleField->ownState(pos.x(), pos.y()) == KBattleField::DEATH || m_battleField->ownState(pos.x(), pos.y()) == KBattleField::WATER)
m_working = false;
diff --git a/kbattleship/kbattleship/kbdestroyshipstrategy.h b/kbattleship/kbattleship/kbdestroyshipstrategy.h
index 0fb6ca92..41503be1 100644
--- a/kbattleship/kbattleship/kbdestroyshipstrategy.h
+++ b/kbattleship/kbattleship/kbdestroyshipstrategy.h
@@ -25,18 +25,18 @@ class KBDestroyShipStrategy : public KBStrategy
public:
KBDestroyShipStrategy(KBStrategy *parent = 0);
- virtual void init(KBattleField *field, const QRect &field_rect);
- virtual const QPoint nextShot();
+ virtual void init(KBattleField *field, const TQRect &field_rect);
+ virtual const TQPoint nextShot();
virtual bool hasMoreShots();
- virtual void shotAt(const QPoint &pos);
+ virtual void shotAt(const TQPoint &pos);
- virtual void destroyShipAt(const QPoint pos);
+ virtual void destroyShipAt(const TQPoint pos);
private:
enum {NODIR, VERTICAL, HORIZONTAL};
bool m_working;
- QPoint m_start;
+ TQPoint m_start;
int m_column;
int m_row;
diff --git a/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp b/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp
index f0e0d6c3..db83bc75 100644
--- a/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp
+++ b/kbattleship/kbattleship/kbdiagonalshotstrategy.cpp
@@ -24,12 +24,12 @@ KBDiagonalShotStrategy::KBDiagonalShotStrategy(KBStrategy *parent) : KBStrategy(
m_horizontal = 0;
}
-const QPoint KBDiagonalShotStrategy::nextShot()
+const TQPoint KBDiagonalShotStrategy::nextShot()
{
if(hasMoreShots())
- return QPoint(m_column, m_row);
+ return TQPoint(m_column, m_row);
- return QPoint(0,0);
+ return TQPoint(0,0);
}
bool KBDiagonalShotStrategy::advance()
@@ -50,7 +50,7 @@ bool KBDiagonalShotStrategy::hasMoreShots()
return advance();
}
-void KBDiagonalShotStrategy::shotAt(const QPoint &pos)
+void KBDiagonalShotStrategy::shotAt(const TQPoint &pos)
{
m_prevShots.append(pos);
}
@@ -89,13 +89,13 @@ void KBDiagonalShotStrategy::startAt(int col, int row, Direction dir)
}
}
-QPoint KBDiagonalShotStrategy::endPoint()
+TQPoint KBDiagonalShotStrategy::endPoint()
{
int row = m_row;
int col = m_column;
if(m_vertical == 0 || m_horizontal == 0)
- return QPoint(col, row);
+ return TQPoint(col, row);
while(m_fieldRect.contains(col, row))
{
@@ -106,5 +106,5 @@ QPoint KBDiagonalShotStrategy::endPoint()
row -= m_vertical;
col -= m_horizontal;
- return QPoint(col, row);
+ return TQPoint(col, row);
}
diff --git a/kbattleship/kbattleship/kbdiagonalshotstrategy.h b/kbattleship/kbattleship/kbdiagonalshotstrategy.h
index b7c9b086..e328fad2 100644
--- a/kbattleship/kbattleship/kbdiagonalshotstrategy.h
+++ b/kbattleship/kbattleship/kbdiagonalshotstrategy.h
@@ -25,11 +25,11 @@ public:
enum Direction {LEFTUP, LEFTDOWN, RIGHTUP, RIGHTDOWN};
KBDiagonalShotStrategy(KBStrategy *parent = 0);
- virtual const QPoint nextShot();
+ virtual const TQPoint nextShot();
virtual bool hasMoreShots();
- virtual void shotAt(const QPoint &pos);
+ virtual void shotAt(const TQPoint &pos);
virtual void startAt(int col, int row, Direction dir);
- virtual QPoint endPoint();
+ virtual TQPoint endPoint();
private:
bool advance();
diff --git a/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp b/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp
index 7f88fb54..7055403b 100644
--- a/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp
+++ b/kbattleship/kbattleship/kbdiagonalwrapstrategy.cpp
@@ -39,7 +39,7 @@ KBDiagonalWrapStrategy::~KBDiagonalWrapStrategy()
delete m_destroyer;
}
-void KBDiagonalWrapStrategy::init(KBattleField *field, const QRect &field_rect)
+void KBDiagonalWrapStrategy::init(KBattleField *field, const TQRect &field_rect)
{
KBStrategy::init(field, field_rect);
KRandomSequence rand;
@@ -73,13 +73,13 @@ void KBDiagonalWrapStrategy::init(KBattleField *field, const QRect &field_rect)
m_child->init(field, field_rect);
m_child->startAt(m_column, m_row, m_direction);
- m_start = QPoint(m_column, m_row);
+ m_start = TQPoint(m_column, m_row);
if(m_destroyer != 0)
m_destroyer->init(field, field_rect);
}
-const QPoint KBDiagonalWrapStrategy::nextShot()
+const TQPoint KBDiagonalWrapStrategy::nextShot()
{
if(hasMoreShots())
{
@@ -127,7 +127,7 @@ bool KBDiagonalWrapStrategy::hasMoreShots()
{
if(m_parent == 0 && !m_destroying && m_prevShots.count() > 0)
{
- QPoint pos = m_prevShots.last();
+ TQPoint pos = m_prevShots.last();
int state = m_battleField->ownState(pos.x(), pos.y());
if(state == KBattleField::HIT)
{
@@ -150,7 +150,7 @@ bool KBDiagonalWrapStrategy::hasMoreShots()
return true;
}
-void KBDiagonalWrapStrategy::shotAt(const QPoint &pos)
+void KBDiagonalWrapStrategy::shotAt(const TQPoint &pos)
{
m_prevShots.append(pos);
@@ -183,7 +183,7 @@ bool KBDiagonalWrapStrategy::advanceRightDown()
}
m_column = col;
}
- m_start = QPoint(m_column, m_row);
+ m_start = TQPoint(m_column, m_row);
}
else
{
@@ -224,7 +224,7 @@ bool KBDiagonalWrapStrategy::advanceRightUp()
}
m_row = row;
}
- m_start = QPoint(m_column, m_row);
+ m_start = TQPoint(m_column, m_row);
}
else
{
@@ -264,7 +264,7 @@ bool KBDiagonalWrapStrategy::advanceLeftDown()
}
m_row = row;
}
- m_start = QPoint(m_column, m_row);
+ m_start = TQPoint(m_column, m_row);
}
else
{
@@ -305,7 +305,7 @@ bool KBDiagonalWrapStrategy::advanceLeftUp()
}
m_column = col;
}
- m_start = QPoint(m_column, m_row);
+ m_start = TQPoint(m_column, m_row);
}
else
{
diff --git a/kbattleship/kbattleship/kbdiagonalwrapstrategy.h b/kbattleship/kbattleship/kbdiagonalwrapstrategy.h
index 06ff8f6a..f4a7c28d 100644
--- a/kbattleship/kbattleship/kbdiagonalwrapstrategy.h
+++ b/kbattleship/kbattleship/kbdiagonalwrapstrategy.h
@@ -27,10 +27,10 @@ public:
KBDiagonalWrapStrategy(KBStrategy *parent = 0);
virtual ~KBDiagonalWrapStrategy();
- virtual void init(KBattleField *field, const QRect &field_rect);
- virtual const QPoint nextShot();
+ virtual void init(KBattleField *field, const TQRect &field_rect);
+ virtual const TQPoint nextShot();
virtual bool hasMoreShots();
- virtual void shotAt(const QPoint &pos);
+ virtual void shotAt(const TQPoint &pos);
private:
bool advance();
@@ -42,7 +42,7 @@ private:
int m_row;
int m_column;
- QPoint m_start;
+ TQPoint m_start;
KBDiagonalShotStrategy *m_child;
KBDiagonalShotStrategy::Direction m_direction;
diff --git a/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp b/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp
index 080bc08e..a6e931da 100644
--- a/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp
+++ b/kbattleship/kbattleship/kbhorizontalstepstrategy.cpp
@@ -38,27 +38,27 @@ KBHorizontalStepStrategy::~KBHorizontalStepStrategy()
delete m_destroyer;
}
-void KBHorizontalStepStrategy::init(KBattleField *field, const QRect &field_rect)
+void KBHorizontalStepStrategy::init(KBattleField *field, const TQRect &field_rect)
{
KBStrategy::init(field, field_rect);
KRandomSequence rand;
m_column = (int) rand.getLong(m_fieldRect.width());
m_row = (int) rand.getLong(m_fieldRect.height());
- m_start = QPoint(m_column, m_row);
+ m_start = TQPoint(m_column, m_row);
m_passes = 0;
if(m_destroyer != 0)
m_destroyer->init(field, field_rect);
}
-const QPoint KBHorizontalStepStrategy::nextShot()
+const TQPoint KBHorizontalStepStrategy::nextShot()
{
if(hasMoreShots())
{
if(m_destroying)
return m_destroyer->nextShot();
else if(m_passes == 0)
- return QPoint(m_column, m_row);
+ return TQPoint(m_column, m_row);
else if(m_parent == 0)
return m_child->nextShot();
}
@@ -101,7 +101,7 @@ bool KBHorizontalStepStrategy::advance()
void KBHorizontalStepStrategy::setStart(int col, int row)
{
- m_start = QPoint(col, row);
+ m_start = TQPoint(col, row);
m_column = col;
m_row = row;
}
@@ -131,7 +131,7 @@ bool KBHorizontalStepStrategy::hasMoreShots()
// Parent Strategy
if((!m_destroying) && m_prevShots.count() > 0)
{
- QPoint pos = m_prevShots.last();
+ TQPoint pos = m_prevShots.last();
int state = m_battleField->ownState(pos.x(), pos.y());
if(state == KBattleField::HIT)
{
@@ -202,7 +202,7 @@ bool KBHorizontalStepStrategy::hasMoreShots()
}
}
-void KBHorizontalStepStrategy::shotAt(const QPoint &pos)
+void KBHorizontalStepStrategy::shotAt(const TQPoint &pos)
{
m_prevShots.append(pos);
if(m_child != 0)
diff --git a/kbattleship/kbattleship/kbhorizontalstepstrategy.h b/kbattleship/kbattleship/kbhorizontalstepstrategy.h
index 4e68e4e7..80ec7b72 100644
--- a/kbattleship/kbattleship/kbhorizontalstepstrategy.h
+++ b/kbattleship/kbattleship/kbhorizontalstepstrategy.h
@@ -26,10 +26,10 @@ public:
KBHorizontalStepStrategy(KBStrategy *parent = 0);
virtual ~KBHorizontalStepStrategy();
- virtual void init(KBattleField *field, const QRect &field_rect);
- virtual const QPoint nextShot();
+ virtual void init(KBattleField *field, const TQRect &field_rect);
+ virtual const TQPoint nextShot();
virtual bool hasMoreShots();
- virtual void shotAt(const QPoint &pos);
+ virtual void shotAt(const TQPoint &pos);
private:
bool advance();
@@ -39,7 +39,7 @@ private:
int m_column;
int m_passes;
- QPoint m_start;
+ TQPoint m_start;
KBHorizontalStepStrategy *m_child;
KBDestroyShipStrategy *m_destroyer;
bool m_destroying;
diff --git a/kbattleship/kbattleship/kbrandomshotstrategy.cpp b/kbattleship/kbattleship/kbrandomshotstrategy.cpp
index a3748a69..62416350 100644
--- a/kbattleship/kbattleship/kbrandomshotstrategy.cpp
+++ b/kbattleship/kbattleship/kbrandomshotstrategy.cpp
@@ -27,7 +27,7 @@ KBRandomShotStrategy::~KBRandomShotStrategy()
delete m_destroyer;
}
-void KBRandomShotStrategy::init(KBattleField *field, const QRect &field_rect)
+void KBRandomShotStrategy::init(KBattleField *field, const TQRect &field_rect)
{
KBStrategy::init(field, field_rect);
KRandomSequence rand;
@@ -38,17 +38,17 @@ void KBRandomShotStrategy::init(KBattleField *field, const QRect &field_rect)
m_destroyer->init(field, field_rect);
}
-const QPoint KBRandomShotStrategy::nextShot()
+const TQPoint KBRandomShotStrategy::nextShot()
{
if(hasMoreShots())
{
if(m_destroying)
return m_destroyer->nextShot();
else if(advance())
- return QPoint(m_column, m_row);
+ return TQPoint(m_column, m_row);
}
- return QPoint(0, 0);
+ return TQPoint(0, 0);
}
bool KBRandomShotStrategy::advance()
@@ -67,7 +67,7 @@ bool KBRandomShotStrategy::hasMoreShots()
{
if((!m_destroying) && m_prevShots.count() > 0)
{
- QPoint pos = m_prevShots.last();
+ TQPoint pos = m_prevShots.last();
int state = m_battleField->ownState(pos.x(), pos.y());
if(state == KBattleField::HIT)
{
@@ -96,7 +96,7 @@ bool KBRandomShotStrategy::hasMoreShots()
return false;
}
-void KBRandomShotStrategy::shotAt(const QPoint &pos)
+void KBRandomShotStrategy::shotAt(const TQPoint &pos)
{
m_prevShots.append(pos);
}
diff --git a/kbattleship/kbattleship/kbrandomshotstrategy.h b/kbattleship/kbattleship/kbrandomshotstrategy.h
index 1e93cefa..141961b9 100644
--- a/kbattleship/kbattleship/kbrandomshotstrategy.h
+++ b/kbattleship/kbattleship/kbrandomshotstrategy.h
@@ -28,10 +28,10 @@ public:
KBRandomShotStrategy(KBStrategy *parent = 0);
virtual ~KBRandomShotStrategy();
- virtual void init(KBattleField *field, const QRect &field_rect);
- virtual const QPoint nextShot();
+ virtual void init(KBattleField *field, const TQRect &field_rect);
+ virtual const TQPoint nextShot();
virtual bool hasMoreShots();
- virtual void shotAt(const QPoint &pos);
+ virtual void shotAt(const TQPoint &pos);
private:
bool advance();
diff --git a/kbattleship/kbattleship/kbstrategy.cpp b/kbattleship/kbattleship/kbstrategy.cpp
index f8183cfd..be445559 100644
--- a/kbattleship/kbattleship/kbstrategy.cpp
+++ b/kbattleship/kbattleship/kbstrategy.cpp
@@ -36,18 +36,18 @@ KBStrategy::~KBStrategy()
}
/* Returns the master strategy's shot list. */
-QValueList<QPoint> KBStrategy::masterShotList()
+TQValueList<TQPoint> KBStrategy::masterShotList()
{
return (!m_parent) ? m_prevShots : m_parent->masterShotList();
}
/* the AI player decided to shoot at pos */
-void KBStrategy::shotAt(const QPoint &pos)
+void KBStrategy::shotAt(const TQPoint &pos)
{
m_prevShots.append(pos);
}
-void KBStrategy::init(KBattleField *field, const QRect &field_rect)
+void KBStrategy::init(KBattleField *field, const TQRect &field_rect)
{
m_battleField = field;
m_fieldRect = field_rect;
diff --git a/kbattleship/kbattleship/kbstrategy.h b/kbattleship/kbattleship/kbstrategy.h
index 55707a17..9c4cdf15 100644
--- a/kbattleship/kbattleship/kbstrategy.h
+++ b/kbattleship/kbattleship/kbstrategy.h
@@ -18,8 +18,8 @@
#ifndef KBSTRATEGY_H
#define KBSTRATEGY_H
-#include <qvaluelist.h>
-#include <qpoint.h>
+#include <tqvaluelist.h>
+#include <tqpoint.h>
#include "kbattlefield.h"
class KBStrategy
@@ -29,21 +29,21 @@ public:
KBStrategy(KBStrategy *parent = 0);
virtual ~KBStrategy();
- virtual const QPoint nextShot() = 0;
- virtual void shotAt(const QPoint &pos);
- virtual void init(KBattleField *field, const QRect &field_rect);
+ virtual const TQPoint nextShot() = 0;
+ virtual void shotAt(const TQPoint &pos);
+ virtual void init(KBattleField *field, const TQRect &field_rect);
virtual bool hasMoreShots() = 0;
protected:
- QValueList<QPoint> masterShotList();
+ TQValueList<TQPoint> masterShotList();
int enemyFieldStateAt(int x, int y);
bool* getViableShots();
- QRect m_fieldRect;
+ TQRect m_fieldRect;
bool* m_viableShots;
bool isViablePos(int x, int y);
void setViablePos(int x, int y, bool viable);
- QValueList<QPoint> m_prevShots;
+ TQValueList<TQPoint> m_prevShots;
KBattleField *m_battleField;
KBStrategy *m_parent;
diff --git a/kbattleship/kbattleship/kbverticalstepstrategy.cpp b/kbattleship/kbattleship/kbverticalstepstrategy.cpp
index 736e9ac8..7642ccaf 100644
--- a/kbattleship/kbattleship/kbverticalstepstrategy.cpp
+++ b/kbattleship/kbattleship/kbverticalstepstrategy.cpp
@@ -40,27 +40,27 @@ KBVerticalStepStrategy::~KBVerticalStepStrategy()
delete m_destroyer;
}
-void KBVerticalStepStrategy::init(KBattleField *field, const QRect &field_rect)
+void KBVerticalStepStrategy::init(KBattleField *field, const TQRect &field_rect)
{
KBStrategy::init(field, field_rect);
KRandomSequence rand;
m_column = (int) rand.getLong(m_fieldRect.width());
m_row = (int) rand.getLong(m_fieldRect.height());
- m_start = QPoint(m_column, m_row);
+ m_start = TQPoint(m_column, m_row);
m_passes = 0;
if(m_destroyer != 0)
m_destroyer->init(field, field_rect);
}
-const QPoint KBVerticalStepStrategy::nextShot()
+const TQPoint KBVerticalStepStrategy::nextShot()
{
if(hasMoreShots())
{
if(m_destroying)
return m_destroyer->nextShot();
else if(m_passes == 0)
- return QPoint(m_column, m_row);
+ return TQPoint(m_column, m_row);
else if(m_parent == 0)
return m_child->nextShot();
}
@@ -103,7 +103,7 @@ bool KBVerticalStepStrategy::advance()
void KBVerticalStepStrategy::setStart(int col, int row)
{
- m_start = QPoint(col, row);
+ m_start = TQPoint(col, row);
m_column = col;
m_row = row;
}
@@ -133,7 +133,7 @@ bool KBVerticalStepStrategy::hasMoreShots()
// Parent Strategy
if((!m_destroying) && m_prevShots.count() > 0)
{
- QPoint pos = m_prevShots.last();
+ TQPoint pos = m_prevShots.last();
int state = m_battleField->ownState(pos.x(), pos.y());
if(state == KBattleField::HIT)
{
@@ -206,7 +206,7 @@ bool KBVerticalStepStrategy::hasMoreShots()
}
}
-void KBVerticalStepStrategy::shotAt(const QPoint &pos)
+void KBVerticalStepStrategy::shotAt(const TQPoint &pos)
{
m_prevShots.append(pos);
if(m_child != 0)
diff --git a/kbattleship/kbattleship/kbverticalstepstrategy.h b/kbattleship/kbattleship/kbverticalstepstrategy.h
index 904fa68e..a5d614c6 100644
--- a/kbattleship/kbattleship/kbverticalstepstrategy.h
+++ b/kbattleship/kbattleship/kbverticalstepstrategy.h
@@ -27,10 +27,10 @@ public:
KBVerticalStepStrategy(KBStrategy *parent = 0);
virtual ~KBVerticalStepStrategy();
- virtual void init(KBattleField *field, const QRect &field_rect);
- virtual const QPoint nextShot();
+ virtual void init(KBattleField *field, const TQRect &field_rect);
+ virtual const TQPoint nextShot();
virtual bool hasMoreShots();
- virtual void shotAt(const QPoint &pos);
+ virtual void shotAt(const TQPoint &pos);
private:
bool advance();
@@ -40,7 +40,7 @@ private:
int m_column;
int m_passes;
- QPoint m_start;
+ TQPoint m_start;
KBVerticalStepStrategy *m_child;
KBDestroyShipStrategy *m_destroyer;
bool m_destroying;
diff --git a/kbattleship/kbattleship/kchatwidget.cpp b/kbattleship/kbattleship/kchatwidget.cpp
index 6c4755c6..9d5e12af 100644
--- a/kbattleship/kbattleship/kchatwidget.cpp
+++ b/kbattleship/kbattleship/kchatwidget.cpp
@@ -18,21 +18,21 @@
#include <kapplication.h>
#include "kchatwidget.moc"
-KChatWidget::KChatWidget(QWidget *parent, const char *name) : chatDlg(parent, name)
+KChatWidget::KChatWidget(TQWidget *parent, const char *name) : chatDlg(parent, name)
{
- connect(sendBtn, SIGNAL(clicked()), this, SLOT(slotComputeMessage()));
- connect(commentEdit, SIGNAL(returnPressed()), this, SLOT(slotComputeMessage()));
+ connect(sendBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotComputeMessage()));
+ connect(commentEdit, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotComputeMessage()));
chatView->setFocusProxy(commentEdit);
chatView->setMinimumSize(0, 50);
commentEdit->installEventFilter(this);
- m_currentNickname = QString::null;
+ m_currentNickname = TQString::null;
slotAcceptMsg(false);
}
void KChatWidget::clear()
{
- m_currentNickname = QString::null;
+ m_currentNickname = TQString::null;
slotAcceptMsg(false);
chatView->clear();
commentEdit->clear();
@@ -43,25 +43,25 @@ void KChatWidget::slotAcceptMsg(bool value)
m_acceptMsgs = value;
}
-void KChatWidget::slotReceivedMessage(const QString &nickname, const QString &msg, bool fromenemy)
+void KChatWidget::slotReceivedMessage(const TQString &nickname, const TQString &msg, bool fromenemy)
{
// Niko Z:
// IRC roxxx :)
if(msg.startsWith("/me "))
- chatView->append(QString(" * ") + nickname + QString(" ") + msg.mid(4));
+ chatView->append(TQString(" * ") + nickname + TQString(" ") + msg.mid(4));
else if(msg.startsWith("/nick "))
if(fromenemy)
emit sigChangeEnemyNickname(msg.mid(6));
else
emit sigChangeOwnNickname(msg.mid(6));
else
- chatView->append(nickname + QString(": ") + msg);
+ chatView->append(nickname + TQString(": ") + msg);
chatView->setCursorPosition(chatView->numLines(), 0);
}
-bool KChatWidget::eventFilter(QObject *obj, QEvent *e)
+bool KChatWidget::eventFilter(TQObject *obj, TQEvent *e)
{
- if(obj == commentEdit && e->type() == QEvent::Wheel)
+ if(obj == commentEdit && e->type() == TQEvent::Wheel)
{
kapp->notify(chatView, e);
return true;
diff --git a/kbattleship/kbattleship/kchatwidget.h b/kbattleship/kbattleship/kchatwidget.h
index e9a756a7..7a0f0bed 100644
--- a/kbattleship/kbattleship/kchatwidget.h
+++ b/kbattleship/kbattleship/kchatwidget.h
@@ -18,9 +18,9 @@
#ifndef KCHATWIDGET_H
#define KCHATWIDGET_H
-#include <qpushbutton.h>
-#include <qmultilineedit.h>
-#include <qlineedit.h>
+#include <tqpushbutton.h>
+#include <tqmultilineedit.h>
+#include <tqlineedit.h>
#include "dialogs/chatDlg.h"
#include "kmessage.h"
@@ -28,25 +28,25 @@ class KChatWidget : public chatDlg
{
Q_OBJECT
public:
- KChatWidget(QWidget *parent = 0, const char *name = 0);
+ KChatWidget(TQWidget *parent = 0, const char *name = 0);
void clear();
- void setNickname(const QString &nickname) { m_currentNickname = nickname; }
+ void setNickname(const TQString &nickname) { m_currentNickname = nickname; }
public slots:
void slotAcceptMsg(bool value);
void slotComputeMessage();
- void slotReceivedMessage(const QString &nickname, const QString &msg, bool fromenemy = true);
+ void slotReceivedMessage(const TQString &nickname, const TQString &msg, bool fromenemy = true);
signals:
- void sigSendMessage(const QString &);
- void sigChangeEnemyNickname(const QString &);
- void sigChangeOwnNickname(const QString &);
+ void sigSendMessage(const TQString &);
+ void sigChangeEnemyNickname(const TQString &);
+ void sigChangeOwnNickname(const TQString &);
private:
- virtual bool eventFilter(QObject *, QEvent *);
+ virtual bool eventFilter(TQObject *, TQEvent *);
- QString m_currentNickname;
+ TQString m_currentNickname;
bool m_acceptMsgs;
};
diff --git a/kbattleship/kbattleship/kclientdialog.cpp b/kbattleship/kbattleship/kclientdialog.cpp
index 78fc04de..97015b71 100644
--- a/kbattleship/kbattleship/kclientdialog.cpp
+++ b/kbattleship/kbattleship/kclientdialog.cpp
@@ -15,21 +15,21 @@
* *
***************************************************************************/
-#include <qstring.h>
-#include <qglobal.h>
+#include <tqstring.h>
+#include <tqglobal.h>
#include <kdebug.h>
#include <klocale.h>
#include <kcombobox.h>
#include <kuser.h>
-#include <qlayout.h>
+#include <tqlayout.h>
#include "kbattleshipserver.h" // for BATTLESHIP_SERVICE
#include "kclientdialog.moc"
-KClientDialog::KClientDialog(QWidget *parent, const char *name)
+KClientDialog::KClientDialog(TQWidget *parent, const char *name)
: KDialogBase(Plain, i18n("Connect to Server"), Ok|Cancel, Ok, parent, name, true, false, KGuiItem(i18n("&Connect")))
{
- QFrame* page = plainPage();
- QGridLayout* pageLayout = new QGridLayout(page, 1, 1, 0, 0);
+ TQFrame* page = plainPage();
+ TQGridLayout* pageLayout = new TQGridLayout(page, 1, 1, 0, 0);
m_mainWidget = new clientConnectDlg(page);
pageLayout->addWidget(m_mainWidget, 0, 0);
@@ -38,14 +38,14 @@ KClientDialog::KClientDialog(QWidget *parent, const char *name)
KUser u;
m_mainWidget->nicknameEdit->setText(u.loginName());
- connect(m_mainWidget->serverEdit, SIGNAL(returnPressed(const QString &)), this, SLOT(slotReturnPressed(const QString &)));
- connect(m_mainWidget->serverEdit, SIGNAL(textChanged(const QString &)), this, SLOT(slotCheckEnableOk()));
+ connect(m_mainWidget->serverEdit, TQT_SIGNAL(returnPressed(const TQString &)), this, TQT_SLOT(slotReturnPressed(const TQString &)));
+ connect(m_mainWidget->serverEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotCheckEnableOk()));
m_config->setGroup("History");
- m_browser = new DNSSD::ServiceBrowser(QString::fromLatin1(BATTLESHIP_SERVICE));
- connect(m_browser,SIGNAL(finished()),SLOT(nextBatch()));
+ m_browser = new DNSSD::ServiceBrowser(TQString::fromLatin1(BATTLESHIP_SERVICE));
+ connect(m_browser,TQT_SIGNAL(finished()),TQT_SLOT(nextBatch()));
m_browser->startBrowse();
- connect(m_mainWidget->lanBox,SIGNAL(activated(int)),SLOT(gameSelected(int)));
+ connect(m_mainWidget->lanBox,TQT_SIGNAL(activated(int)),TQT_SLOT(gameSelected(int)));
m_mainWidget->serverEdit->completionObject()->setItems(m_config->readListEntry("CompletionList"));
m_mainWidget->serverEdit->setMaxCount(5);
@@ -70,7 +70,7 @@ void KClientDialog::slotCheckEnableOk()
void KClientDialog::slotOk()
{
- QString server = m_mainWidget->serverEdit->currentText().stripWhiteSpace();
+ TQString server = m_mainWidget->serverEdit->currentText().stripWhiteSpace();
if(!server.isEmpty())
{
hide();
@@ -81,7 +81,7 @@ void KClientDialog::slotOk()
m_mainWidget->serverEdit->clearEdit();
}
-void KClientDialog::slotReturnPressed(const QString &hostname)
+void KClientDialog::slotReturnPressed(const TQString &hostname)
{
if(!hostname.stripWhiteSpace().isEmpty())
m_mainWidget->serverEdit->addToHistory(hostname);
@@ -95,17 +95,17 @@ void KClientDialog::slotCancel()
emit sigCancelConnect();
}
-QString KClientDialog::port() const
+TQString KClientDialog::port() const
{
- return QString::number(m_mainWidget->portEdit->value());
+ return TQString::number(m_mainWidget->portEdit->value());
}
-QString KClientDialog::host() const
+TQString KClientDialog::host() const
{
return m_mainWidget->serverEdit->currentText();
}
-QString KClientDialog::nickname() const
+TQString KClientDialog::nickname() const
{
return m_mainWidget->nicknameEdit->text();
}
@@ -115,9 +115,9 @@ void KClientDialog::nextBatch()
bool autoselect=false;
if (!m_mainWidget->lanBox->count()) autoselect=true;
m_mainWidget->lanBox->clear();
- QStringList names;
- QValueList<DNSSD::RemoteService::Ptr>::ConstIterator itEnd = m_browser->services().end();
- for (QValueList<DNSSD::RemoteService::Ptr>::ConstIterator it = m_browser->services().begin();
+ TQStringList names;
+ TQValueList<DNSSD::RemoteService::Ptr>::ConstIterator itEnd = m_browser->services().end();
+ for (TQValueList<DNSSD::RemoteService::Ptr>::ConstIterator it = m_browser->services().begin();
it!=itEnd; ++it) names << (*it)->serviceName();
m_mainWidget->lanBox->insertStringList(names);
if (autoselect && m_mainWidget->lanBox->count()) gameSelected(0);
diff --git a/kbattleship/kbattleship/kclientdialog.h b/kbattleship/kbattleship/kclientdialog.h
index e3dbf341..f424baf6 100644
--- a/kbattleship/kbattleship/kclientdialog.h
+++ b/kbattleship/kbattleship/kclientdialog.h
@@ -22,10 +22,10 @@
#include <kconfig.h>
#include <dnssd/servicebrowser.h>
#include <dnssd/remoteservice.h>
-#include <qstring.h>
-#include <qpushbutton.h>
-#include <qlineedit.h>
-#include <qspinbox.h>
+#include <tqstring.h>
+#include <tqpushbutton.h>
+#include <tqlineedit.h>
+#include <tqspinbox.h>
#include <kdialogbase.h>
#include "dialogs/connectDlg.h"
@@ -33,17 +33,17 @@ class KClientDialog : public KDialogBase
{
Q_OBJECT
public:
- KClientDialog(QWidget *parent = 0, const char *name = 0);
+ KClientDialog(TQWidget *parent = 0, const char *name = 0);
~KClientDialog();
- QString port() const;
- QString host() const;
- QString nickname() const;
+ TQString port() const;
+ TQString host() const;
+ TQString nickname() const;
public slots:
virtual void slotOk();
virtual void slotCancel();
- void slotReturnPressed(const QString &hostname);
+ void slotReturnPressed(const TQString &hostname);
void nextBatch();
void gameSelected(int);
void slotCheckEnableOk();
diff --git a/kbattleship/kbattleship/kgridwidget.cpp b/kbattleship/kbattleship/kgridwidget.cpp
index 49a6d106..6cc660d7 100644
--- a/kbattleship/kbattleship/kgridwidget.cpp
+++ b/kbattleship/kbattleship/kgridwidget.cpp
@@ -15,9 +15,9 @@
* *
***************************************************************************/
-#include <qapplication.h>
-#include <qimage.h>
-#include <qpainter.h>
+#include <tqapplication.h>
+#include <tqimage.h>
+#include <tqpainter.h>
#include <kstandarddirs.h>
#include <kimageeffect.h>
@@ -26,9 +26,9 @@
#include "kbattlefield.h"
#include "kgridwidget.h"
-KGridWidget::KGridWidget(QWidget *parent, bool draw) : m_drawGrid(draw)
+KGridWidget::KGridWidget(TQWidget *parent, bool draw) : m_drawGrid(draw)
{
- m_doubleBuffer = new QPixmap(parent->width(), parent->height());
+ m_doubleBuffer = new TQPixmap(parent->width(), parent->height());
m_parent = parent;
cleanBuffer();
@@ -42,31 +42,31 @@ KGridWidget::~KGridWidget()
void KGridWidget::cacheImages()
{
- seaPng = QPixmap(findIcon("sea.png"));
- waterPng = QPixmap(findIcon("water.png"));
- hitPng = QPixmap(findIcon("hit.png"));
- borderPng = QPixmap(findIcon("border.png"));
- deathPng = QPixmap(findIcon("death.png"));
- ship1p1Png = QPixmap(findIcon("ship1-1.png"));
- ship1p1rPng = QPixmap(findIcon("ship1-1-r.png"));
- ship2p1Png = QPixmap(findIcon("ship2-1.png"));
- ship2p1rPng = QPixmap(findIcon("ship2-1-r.png"));
- ship2p2Png = QPixmap(findIcon("ship2-2.png"));
- ship2p2rPng = QPixmap(findIcon("ship2-2-r.png"));
- ship3p1Png = QPixmap(findIcon("ship3-1.png"));
- ship3p1rPng = QPixmap(findIcon("ship3-1-r.png"));
- ship3p2Png = QPixmap(findIcon("ship3-2.png"));
- ship3p2rPng = QPixmap(findIcon("ship3-2-r.png"));
- ship3p3Png = QPixmap(findIcon("ship3-3.png"));
- ship3p3rPng = QPixmap(findIcon("ship3-3-r.png"));
- ship4p1Png = QPixmap(findIcon("ship4-1.png"));
- ship4p1rPng = QPixmap(findIcon("ship4-1-r.png"));
- ship4p2Png = QPixmap(findIcon("ship4-2.png"));
- ship4p2rPng = QPixmap(findIcon("ship4-2-r.png"));
- ship4p3Png = QPixmap(findIcon("ship4-3.png"));
- ship4p3rPng = QPixmap(findIcon("ship4-3-r.png"));
- ship4p4Png = QPixmap(findIcon("ship4-4.png"));
- ship4p4rPng = QPixmap(findIcon("ship4-4-r.png"));
+ seaPng = TQPixmap(findIcon("sea.png"));
+ waterPng = TQPixmap(findIcon("water.png"));
+ hitPng = TQPixmap(findIcon("hit.png"));
+ borderPng = TQPixmap(findIcon("border.png"));
+ deathPng = TQPixmap(findIcon("death.png"));
+ ship1p1Png = TQPixmap(findIcon("ship1-1.png"));
+ ship1p1rPng = TQPixmap(findIcon("ship1-1-r.png"));
+ ship2p1Png = TQPixmap(findIcon("ship2-1.png"));
+ ship2p1rPng = TQPixmap(findIcon("ship2-1-r.png"));
+ ship2p2Png = TQPixmap(findIcon("ship2-2.png"));
+ ship2p2rPng = TQPixmap(findIcon("ship2-2-r.png"));
+ ship3p1Png = TQPixmap(findIcon("ship3-1.png"));
+ ship3p1rPng = TQPixmap(findIcon("ship3-1-r.png"));
+ ship3p2Png = TQPixmap(findIcon("ship3-2.png"));
+ ship3p2rPng = TQPixmap(findIcon("ship3-2-r.png"));
+ ship3p3Png = TQPixmap(findIcon("ship3-3.png"));
+ ship3p3rPng = TQPixmap(findIcon("ship3-3-r.png"));
+ ship4p1Png = TQPixmap(findIcon("ship4-1.png"));
+ ship4p1rPng = TQPixmap(findIcon("ship4-1-r.png"));
+ ship4p2Png = TQPixmap(findIcon("ship4-2.png"));
+ ship4p2rPng = TQPixmap(findIcon("ship4-2-r.png"));
+ ship4p3Png = TQPixmap(findIcon("ship4-3.png"));
+ ship4p3rPng = TQPixmap(findIcon("ship4-3-r.png"));
+ ship4p4Png = TQPixmap(findIcon("ship4-4.png"));
+ ship4p4rPng = TQPixmap(findIcon("ship4-4-r.png"));
}
void KGridWidget::setValues(int x, int y, int size)
@@ -365,14 +365,14 @@ void KGridWidget::drawShipIcon(int ship, int part, bool rotate, bool hit)
}
}
-void KGridWidget::drawIcon(const QPixmap &icon, bool hitBlend, bool waterBlend, bool rotate)
+void KGridWidget::drawIcon(const TQPixmap &icon, bool hitBlend, bool waterBlend, bool rotate)
{
- QPainter painter;
+ TQPainter painter;
painter.begin(m_doubleBuffer);
if(!hitBlend && waterBlend)
{
- QImage first = icon.convertToImage();
- QImage second = seaPng.convertToImage();
+ TQImage first = icon.convertToImage();
+ TQImage second = seaPng.convertToImage();
painter.drawPixmap(m_x, m_y, seaPng);
if(rotate)
painter.drawImage(m_x, m_y, KImageEffect::blend(first, second, KImageEffect::VerticalGradient, 30, 30));
@@ -399,7 +399,7 @@ void KGridWidget::drawIcon(const QPixmap &icon, bool hitBlend, bool waterBlend,
}
}
-QString KGridWidget::findIcon(const QString &name) const
+TQString KGridWidget::findIcon(const TQString &name) const
{
return locate("data", "kbattleship/pictures/" + name);
}
@@ -412,5 +412,5 @@ void KGridWidget::finished()
void KGridWidget::cleanBuffer()
{
- m_doubleBuffer->fill(QApplication::palette().color(QPalette::Normal, QColorGroup::Background));
+ m_doubleBuffer->fill(TQApplication::palette().color(TQPalette::Normal, TQColorGroup::Background));
}
diff --git a/kbattleship/kbattleship/kgridwidget.h b/kbattleship/kbattleship/kgridwidget.h
index 91f48eb0..1026695b 100644
--- a/kbattleship/kbattleship/kgridwidget.h
+++ b/kbattleship/kbattleship/kgridwidget.h
@@ -18,12 +18,12 @@
#ifndef KGRIDWIDGET_H
#define KGRIDWIDGET_H
-#include <qpixmap.h>
+#include <tqpixmap.h>
class KGridWidget
{
public:
- KGridWidget(QWidget *parent, bool draw);
+ KGridWidget(TQWidget *parent, bool draw);
~KGridWidget();
void enableGrid() { m_drawGrid = true; }
@@ -43,24 +43,24 @@ protected:
private:
void cacheImages();
- void drawIcon(const QPixmap &icon, bool hitBlend = false, bool waterBlend = false, bool rotate = false);
- QString findIcon(const QString &name) const;
+ void drawIcon(const TQPixmap &icon, bool hitBlend = false, bool waterBlend = false, bool rotate = false);
+ TQString findIcon(const TQString &name) const;
bool m_drawGrid;
int m_x, m_y, m_size;
- QPixmap *m_doubleBuffer;
- QPixmap seaPng, waterPng, hitPng, borderPng,deathPng;
- QPixmap ship1p1Png, ship1p1rPng;
- QPixmap ship2p1Png, ship2p1rPng;
- QPixmap ship2p2Png, ship2p2rPng;
- QPixmap ship3p1Png, ship3p1rPng;
- QPixmap ship3p2Png, ship3p2rPng;
- QPixmap ship3p3Png, ship3p3rPng;
- QPixmap ship4p1Png, ship4p1rPng;
- QPixmap ship4p2Png, ship4p2rPng;
- QPixmap ship4p3Png, ship4p3rPng;
- QPixmap ship4p4Png, ship4p4rPng;
- QWidget *m_parent;
+ TQPixmap *m_doubleBuffer;
+ TQPixmap seaPng, waterPng, hitPng, borderPng,deathPng;
+ TQPixmap ship1p1Png, ship1p1rPng;
+ TQPixmap ship2p1Png, ship2p1rPng;
+ TQPixmap ship2p2Png, ship2p2rPng;
+ TQPixmap ship3p1Png, ship3p1rPng;
+ TQPixmap ship3p2Png, ship3p2rPng;
+ TQPixmap ship3p3Png, ship3p3rPng;
+ TQPixmap ship4p1Png, ship4p1rPng;
+ TQPixmap ship4p2Png, ship4p2rPng;
+ TQPixmap ship4p3Png, ship4p3rPng;
+ TQPixmap ship4p4Png, ship4p4rPng;
+ TQWidget *m_parent;
};
#endif
diff --git a/kbattleship/kbattleship/kmessage.cpp b/kbattleship/kbattleship/kmessage.cpp
index 5eccacd2..a316b314 100644
--- a/kbattleship/kbattleship/kmessage.cpp
+++ b/kbattleship/kbattleship/kmessage.cpp
@@ -32,10 +32,10 @@ const char *protocolVersion = "0.1.0";
KMessage::KMessage(int type)
{
- m_xmlDocument = QDomDocument("kmessage");
+ m_xmlDocument = TQDomDocument("kmessage");
m_xmlDocument.appendChild(m_xmlDocument.createElement("kmessage"));
m_messageType = type;
- addField("msgtype", QString::number(type));
+ addField("msgtype", TQString::number(type));
}
KMessage::KMessage(KMessage *msg)
@@ -46,18 +46,18 @@ KMessage::KMessage(KMessage *msg)
KMessage::KMessage()
{
- m_xmlDocument = QDomDocument("kmessage");
+ m_xmlDocument = TQDomDocument("kmessage");
}
-void KMessage::addField(const QString &name, const QString &content)
+void KMessage::addField(const TQString &name, const TQString &content)
{
- QDomElement xmlElement = m_xmlDocument.createElement(name);
- QDomText xmlText = m_xmlDocument.createTextNode(content);
+ TQDomElement xmlElement = m_xmlDocument.createElement(name);
+ TQDomText xmlText = m_xmlDocument.createTextNode(content);
xmlElement.appendChild(xmlText);
m_xmlDocument.documentElement().appendChild(xmlElement);
}
-void KMessage::setDataStream(const QString &stream)
+void KMessage::setDataStream(const TQString &stream)
{
m_xmlDocument.setContent(stream);
#ifdef XMLDUMP
@@ -65,7 +65,7 @@ void KMessage::setDataStream(const QString &stream)
#endif
}
-QString KMessage::sendStream() const
+TQString KMessage::sendStream() const
{
#ifdef XMLDUMP
kdDebug() << "*** XML OUT ***" << endl << m_xmlDocument.toString() << endl << "*** END ***" << endl;
@@ -73,12 +73,12 @@ QString KMessage::sendStream() const
return m_xmlDocument.toString();
}
-QString KMessage::field(const QString &name) const
+TQString KMessage::field(const TQString &name) const
{
- QDomNode xmlNode = m_xmlDocument.documentElement().namedItem(name);
+ TQDomNode xmlNode = m_xmlDocument.documentElement().namedItem(name);
if(!xmlNode.isNull())
return (xmlNode.toElement()).text();
- return QString::null;
+ return TQString::null;
}
int KMessage::type()
@@ -86,7 +86,7 @@ int KMessage::type()
return field("msgtype").toInt();
}
-void KMessage::chatMessage(const QString &nickname, const QString &message)
+void KMessage::chatMessage(const TQString &nickname, const TQString &message)
{
addField("nickname", nickname);
addField("chat", message);
diff --git a/kbattleship/kbattleship/kmessage.h b/kbattleship/kbattleship/kmessage.h
index f1d6a0b5..fca32c1b 100644
--- a/kbattleship/kbattleship/kmessage.h
+++ b/kbattleship/kbattleship/kmessage.h
@@ -18,8 +18,8 @@
#ifndef KMESSAGE_H
#define KMESSAGE_H
-#include <qdom.h>
-#include <qstring.h>
+#include <tqdom.h>
+#include <tqstring.h>
class KMessage
{
@@ -32,17 +32,17 @@ public:
int type();
- void addField(const QString &name, const QString &content);
- QString field(const QString &name) const;
+ void addField(const TQString &name, const TQString &content);
+ TQString field(const TQString &name) const;
- void setDataStream(const QString &stream);
- QString sendStream() const;
+ void setDataStream(const TQString &stream);
+ TQString sendStream() const;
- void chatMessage(const QString &nickname, const QString &message);
+ void chatMessage(const TQString &nickname, const TQString &message);
void versionMessage();
private:
- QDomDocument m_xmlDocument;
+ TQDomDocument m_xmlDocument;
int m_messageType;
};
diff --git a/kbattleship/kbattleship/konnectionhandling.cpp b/kbattleship/kbattleship/konnectionhandling.cpp
index bcfefe04..5d5c1026 100644
--- a/kbattleship/kbattleship/konnectionhandling.cpp
+++ b/kbattleship/kbattleship/konnectionhandling.cpp
@@ -19,27 +19,27 @@
extern const char *protocolVersion;
-KonnectionHandling::KonnectionHandling(QWidget *parent, KBattleshipServer *server) : QObject(parent)
+KonnectionHandling::KonnectionHandling(TQWidget *parent, KBattleshipServer *server) : TQObject(parent)
{
m_kbserver = server;
m_kbclient = 0;
m_type = KonnectionHandling::SERVER;
- connect(server, SIGNAL(sigServerFailure()), this, SIGNAL(sigAbortNetworkGame()));
- connect(server, SIGNAL(sigNewConnect()), this, SLOT(slotNewClient()));
- connect(server, SIGNAL(sigEndConnect()), this, SLOT(slotLostClient()));
- connect(server, SIGNAL(sigNewMessage(KMessage *)), this, SLOT(slotNewMessage(KMessage *)));
- connect(server, SIGNAL(sigMessageSent(KMessage *)), this, SLOT(slotMessageSent(KMessage *)));
+ connect(server, TQT_SIGNAL(sigServerFailure()), this, TQT_SIGNAL(sigAbortNetworkGame()));
+ connect(server, TQT_SIGNAL(sigNewConnect()), this, TQT_SLOT(slotNewClient()));
+ connect(server, TQT_SIGNAL(sigEndConnect()), this, TQT_SLOT(slotLostClient()));
+ connect(server, TQT_SIGNAL(sigNewMessage(KMessage *)), this, TQT_SLOT(slotNewMessage(KMessage *)));
+ connect(server, TQT_SIGNAL(sigMessageSent(KMessage *)), this, TQT_SLOT(slotMessageSent(KMessage *)));
}
-KonnectionHandling::KonnectionHandling(QWidget *parent, KBattleshipClient *client) : QObject(parent)
+KonnectionHandling::KonnectionHandling(TQWidget *parent, KBattleshipClient *client) : TQObject(parent)
{
m_kbclient = client;
m_kbserver = 0;
m_type = KonnectionHandling::CLIENT;
- connect(client, SIGNAL(sigEndConnect()), this, SLOT(slotLostServer()));
- connect(client, SIGNAL(sigSocketFailure(int)), this, SLOT(slotSocketError(int)));
- connect(client, SIGNAL(sigNewMessage(KMessage *)), this, SLOT(slotNewMessage(KMessage *)));
- connect(client, SIGNAL(sigMessageSent(KMessage *)), this, SLOT(slotMessageSent(KMessage *)));
+ connect(client, TQT_SIGNAL(sigEndConnect()), this, TQT_SLOT(slotLostServer()));
+ connect(client, TQT_SIGNAL(sigSocketFailure(int)), this, TQT_SLOT(slotSocketError(int)));
+ connect(client, TQT_SIGNAL(sigNewMessage(KMessage *)), this, TQT_SLOT(slotNewMessage(KMessage *)));
+ connect(client, TQT_SIGNAL(sigMessageSent(KMessage *)), this, TQT_SLOT(slotMessageSent(KMessage *)));
}
void KonnectionHandling::updateInternal(KBattleshipServer *server)
@@ -47,11 +47,11 @@ void KonnectionHandling::updateInternal(KBattleshipServer *server)
m_kbserver = server;
m_kbclient = 0;
m_type = KonnectionHandling::SERVER;
- connect(server, SIGNAL(sigServerFailure()), this, SIGNAL(sigAbortNetworkGame()));
- connect(server, SIGNAL(sigNewConnect()), this, SLOT(slotNewClient()));
- connect(server, SIGNAL(sigEndConnect()), this, SLOT(slotLostClient()));
- connect(server, SIGNAL(sigNewMessage(KMessage *)), this, SLOT(slotNewMessage(KMessage *)));
- connect(server, SIGNAL(sigMessageSent(KMessage *)), this, SLOT(slotMessageSent(KMessage *)));
+ connect(server, TQT_SIGNAL(sigServerFailure()), this, TQT_SIGNAL(sigAbortNetworkGame()));
+ connect(server, TQT_SIGNAL(sigNewConnect()), this, TQT_SLOT(slotNewClient()));
+ connect(server, TQT_SIGNAL(sigEndConnect()), this, TQT_SLOT(slotLostClient()));
+ connect(server, TQT_SIGNAL(sigNewMessage(KMessage *)), this, TQT_SLOT(slotNewMessage(KMessage *)));
+ connect(server, TQT_SIGNAL(sigMessageSent(KMessage *)), this, TQT_SLOT(slotMessageSent(KMessage *)));
}
void KonnectionHandling::updateInternal(KBattleshipClient *client)
@@ -59,10 +59,10 @@ void KonnectionHandling::updateInternal(KBattleshipClient *client)
m_kbclient = client;
m_kbserver = 0;
m_type = KonnectionHandling::CLIENT;
- connect(client, SIGNAL(sigEndConnect()), this, SLOT(slotLostServer()));
- connect(client, SIGNAL(sigSocketFailure(int)), this, SLOT(slotSocketError(int)));
- connect(client, SIGNAL(sigNewMessage(KMessage *)), this, SLOT(slotNewMessage(KMessage *)));
- connect(client, SIGNAL(sigMessageSent(KMessage *)), this, SLOT(slotMessageSent(KMessage *)));
+ connect(client, TQT_SIGNAL(sigEndConnect()), this, TQT_SLOT(slotLostServer()));
+ connect(client, TQT_SIGNAL(sigSocketFailure(int)), this, TQT_SLOT(slotSocketError(int)));
+ connect(client, TQT_SIGNAL(sigNewMessage(KMessage *)), this, TQT_SLOT(slotNewMessage(KMessage *)));
+ connect(client, TQT_SIGNAL(sigMessageSent(KMessage *)), this, TQT_SLOT(slotMessageSent(KMessage *)));
}
void KonnectionHandling::slotNewClient()
@@ -92,7 +92,7 @@ void KonnectionHandling::slotNewMessage(KMessage *msg)
{
// First possible message
case KMessage::DISCARD:
- if(msg->field("kmversion") == QString("true"))
+ if(msg->field("kmversion") == TQString("true"))
{
KMessageBox::error(0L, i18n("Connection dropped by enemy. The client's protocol implementation (%1) is not compatible with our (%2) version.").arg(msg->field("reason")).arg(protocolVersion));
emit sigAbortNetworkGame();
@@ -128,7 +128,7 @@ void KonnectionHandling::slotNewMessage(KMessage *msg)
// The server gave us the field data of our last shot
case KMessage::ANSWER_SHOOT:
emit sigShootable(false);
- emit sigEnemyFieldData(msg->field("fieldx").toInt(), msg->field("fieldy").toInt(), msg->field("fieldstate").toInt(), msg->field("xstart").toInt(), msg->field("xstop").toInt(), msg->field("ystart").toInt(), msg->field("ystop").toInt(), (msg->field("death") == QString("true")));
+ emit sigEnemyFieldData(msg->field("fieldx").toInt(), msg->field("fieldy").toInt(), msg->field("fieldstate").toInt(), msg->field("xstart").toInt(), msg->field("xstop").toInt(), msg->field("ystart").toInt(), msg->field("ystop").toInt(), (msg->field("death") == TQString("true")));
break;
// The server starts a new game
@@ -156,7 +156,7 @@ void KonnectionHandling::slotNewMessage(KMessage *msg)
{
// First message....got client information
case KMessage::GETVERSION:
- if(msg->field("protocolVersion") != QString::fromLatin1(protocolVersion))
+ if(msg->field("protocolVersion") != TQString::fromLatin1(protocolVersion))
{
m_kbserver->slotDiscardClient(protocolVersion, true, false);
KMessageBox::error(0L, i18n("Connection to client dropped. The client's protocol implementation (%1) is not compatible with our (%2) version.").arg(msg->field("protocolVersion")).arg(protocolVersion));
@@ -183,7 +183,7 @@ void KonnectionHandling::slotNewMessage(KMessage *msg)
// The client gave us the field data of our last shot
case KMessage::ANSWER_SHOOT:
emit sigShootable(false);
- emit sigEnemyFieldData(msg->field("fieldx").toInt(), msg->field("fieldy").toInt(), msg->field("fieldstate").toInt(), msg->field("xstart").toInt(), msg->field("xstop").toInt(), msg->field("ystart").toInt(), msg->field("ystop").toInt(), (msg->field("death") == QString("true")));
+ emit sigEnemyFieldData(msg->field("fieldx").toInt(), msg->field("fieldy").toInt(), msg->field("fieldstate").toInt(), msg->field("xstart").toInt(), msg->field("xstop").toInt(), msg->field("ystart").toInt(), msg->field("ystop").toInt(), (msg->field("death") == TQString("true")));
break;
// The client shot and wants the field state
diff --git a/kbattleship/kbattleship/konnectionhandling.h b/kbattleship/kbattleship/konnectionhandling.h
index baa823df..95615d66 100644
--- a/kbattleship/kbattleship/konnectionhandling.h
+++ b/kbattleship/kbattleship/konnectionhandling.h
@@ -21,7 +21,7 @@
#include <klocale.h>
#include <kmessagebox.h>
-#include <qobject.h>
+#include <tqobject.h>
#include "kbattleshipclient.h"
#include "kbattleshipserver.h"
@@ -32,8 +32,8 @@ class KonnectionHandling : public QObject
Q_OBJECT
public:
enum{SERVER, CLIENT};
- KonnectionHandling(QWidget *parent, KBattleshipServer *server);
- KonnectionHandling(QWidget *parent, KBattleshipClient *client);
+ KonnectionHandling(TQWidget *parent, KBattleshipServer *server);
+ KonnectionHandling(TQWidget *parent, KBattleshipClient *client);
int type() { return m_type; }
@@ -49,10 +49,10 @@ public slots:
void slotSocketError(int error);
signals:
- void sigStatusBar(const QString &);
- void sigEnemyNickname(const QString &);
+ void sigStatusBar(const TQString &);
+ void sigEnemyNickname(const TQString &);
void sigEnemyFieldData(int, int, int, int, int, int, int, bool);
- void sigClientInformation(const QString &, const QString &, const QString &, const QString &);
+ void sigClientInformation(const TQString &, const TQString &, const TQString &, const TQString &);
void sigSendNickname();
void sigSendFieldState(int, int);
void sigPlaceShips(bool);
@@ -62,7 +62,7 @@ signals:
void sigReplay();
void sigLost(KMessage *);
void sigAbortNetworkGame();
- void sigChatMessage(const QString &, const QString &, bool);
+ void sigChatMessage(const TQString &, const TQString &, bool);
private:
KBattleshipServer *m_kbserver;
diff --git a/kbattleship/kbattleship/kserverdialog.cpp b/kbattleship/kbattleship/kserverdialog.cpp
index 3936bebf..d8fa1b1d 100644
--- a/kbattleship/kbattleship/kserverdialog.cpp
+++ b/kbattleship/kbattleship/kserverdialog.cpp
@@ -17,22 +17,22 @@
#include <klocale.h>
#include <kuser.h>
-#include <qlayout.h>
+#include <tqlayout.h>
#include "kserverdialog.h"
-KServerDialog::KServerDialog(QWidget *parent, const char *name) :
+KServerDialog::KServerDialog(TQWidget *parent, const char *name) :
KDialogBase(Plain, i18n("Start Server"), Ok|Cancel, Ok, parent, name, true, false, KGuiItem(i18n("&Start")))
{
- QFrame* page = plainPage();
- QGridLayout* pageLayout = new QGridLayout(page, 1, 1, 0, 0);
+ TQFrame* page = plainPage();
+ TQGridLayout* pageLayout = new TQGridLayout(page, 1, 1, 0, 0);
m_mainWidget = new serverStartDlg(page);
pageLayout->addWidget(m_mainWidget, 0, 0);
KUser u;
m_mainWidget->nicknameEdit->setText(u.loginName());
- QString gamename = u.fullName();
+ TQString gamename = u.fullName();
if(gamename.isEmpty()) gamename = u.loginName();
m_mainWidget->gamenameEdit->setText(gamename);
}
@@ -49,17 +49,17 @@ void KServerDialog::slotCancel()
emit cancelClicked();
}
-QString KServerDialog::port() const
+TQString KServerDialog::port() const
{
- return QString::number(m_mainWidget->portEdit->value());
+ return TQString::number(m_mainWidget->portEdit->value());
}
-QString KServerDialog::nickname() const
+TQString KServerDialog::nickname() const
{
return m_mainWidget->nicknameEdit->text();
}
-QString KServerDialog::gamename() const
+TQString KServerDialog::gamename() const
{
return m_mainWidget->gamenameEdit->text();
}
diff --git a/kbattleship/kbattleship/kserverdialog.h b/kbattleship/kbattleship/kserverdialog.h
index e6655c1a..ca455509 100644
--- a/kbattleship/kbattleship/kserverdialog.h
+++ b/kbattleship/kbattleship/kserverdialog.h
@@ -18,10 +18,10 @@
#ifndef KSERVERDIALOG_H
#define KSERVERDIALOG_H
-#include <qstring.h>
-#include <qpushbutton.h>
-#include <qlineedit.h>
-#include <qspinbox.h>
+#include <tqstring.h>
+#include <tqpushbutton.h>
+#include <tqlineedit.h>
+#include <tqspinbox.h>
#include <kdialogbase.h>
@@ -32,11 +32,11 @@ class KServerDialog : public KDialogBase
{
Q_OBJECT
public:
- KServerDialog(QWidget *parent = 0, const char *name = 0);
+ KServerDialog(TQWidget *parent = 0, const char *name = 0);
- QString port() const;
- QString nickname() const;
- QString gamename() const;
+ TQString port() const;
+ TQString nickname() const;
+ TQString gamename() const;
public slots:
virtual void slotOk();
diff --git a/kbattleship/kbattleship/kshiplist.cpp b/kbattleship/kbattleship/kshiplist.cpp
index 8a17ad37..6a3463af 100644
--- a/kbattleship/kbattleship/kshiplist.cpp
+++ b/kbattleship/kbattleship/kshiplist.cpp
@@ -19,7 +19,7 @@
#include "kshiplist.moc"
#include <kdebug.h>
-KShipList::KShipList() : QObject()
+KShipList::KShipList() : TQObject()
{
m_shiplist.setAutoDelete(true);
m_shipsadded = 4;
@@ -124,8 +124,8 @@ void KShipList::addNewShip(int button, int fieldx, int fieldy)
bool KShipList::addNewShip(bool vertical, int fieldx, int fieldy)
{
- QRect ship = vertical ? QRect(fieldx, fieldy, 1, m_shipsadded) : QRect(fieldx, fieldy, m_shipsadded, 1);
- QRect field = QRect(0, 0, m_fieldx, m_fieldy);
+ TQRect ship = vertical ? TQRect(fieldx, fieldy, 1, m_shipsadded) : TQRect(fieldx, fieldy, m_shipsadded, 1);
+ TQRect field = TQRect(0, 0, m_fieldx, m_fieldy);
if(!field.contains(ship))
return false;
diff --git a/kbattleship/kbattleship/kshiplist.h b/kbattleship/kbattleship/kshiplist.h
index 59915a5b..e27705b6 100644
--- a/kbattleship/kbattleship/kshiplist.h
+++ b/kbattleship/kbattleship/kshiplist.h
@@ -21,7 +21,7 @@
#include <kmessagebox.h>
#include <klocale.h>
-#include <qptrlist.h>
+#include <tqptrlist.h>
#include "kbattlefield.h"
#include "kship.h"
@@ -51,7 +51,7 @@ signals:
void sigOwnFieldDataChanged(int, int, int);
private:
- QPtrList<KShip> m_shiplist;
+ TQPtrList<KShip> m_shiplist;
int m_shipsadded;
};
diff --git a/kbattleship/kbattleship/kstatdialog.cpp b/kbattleship/kbattleship/kstatdialog.cpp
index 9db2afe4..03bc7d41 100644
--- a/kbattleship/kbattleship/kstatdialog.cpp
+++ b/kbattleship/kbattleship/kstatdialog.cpp
@@ -15,22 +15,22 @@
* *
***************************************************************************/
-#include <qlcdnumber.h>
-#include <qlabel.h>
+#include <tqlcdnumber.h>
+#include <tqlabel.h>
#include "kstatdialog.moc"
-KStatDialog::KStatDialog(QWidget *parent, const char *name) : statDlg(parent, name)
+KStatDialog::KStatDialog(TQWidget *parent, const char *name) : statDlg(parent, name)
{
}
void KStatDialog::slotAddOwnWon()
{
- OwnLabel->setText(QString::number(OwnLabel->text().toInt() + 1));
+ OwnLabel->setText(TQString::number(OwnLabel->text().toInt() + 1));
}
void KStatDialog::slotAddEnemyWon()
{
- EnemyLabel->setText(QString::number(EnemyLabel->text().toInt() + 1));
+ EnemyLabel->setText(TQString::number(EnemyLabel->text().toInt() + 1));
}
void KStatDialog::setShot()
@@ -72,8 +72,8 @@ void KStatDialog::clear()
void KStatDialog::clearWon()
{
- OwnLabel->setText(QString::number(0));
- EnemyLabel->setText(QString::number(0));
+ OwnLabel->setText(TQString::number(0));
+ EnemyLabel->setText(TQString::number(0));
}
int KStatDialog::shot()
diff --git a/kbattleship/kbattleship/kstatdialog.h b/kbattleship/kbattleship/kstatdialog.h
index fd9b3dd7..5657fccd 100644
--- a/kbattleship/kbattleship/kstatdialog.h
+++ b/kbattleship/kbattleship/kstatdialog.h
@@ -24,7 +24,7 @@ class KStatDialog : public statDlg
{
Q_OBJECT
public:
- KStatDialog(QWidget *parent = 0, const char *name = 0);
+ KStatDialog(TQWidget *parent = 0, const char *name = 0);
void setShot();
void setShot(int shot);
diff --git a/kbattleship/kbattleship/main.cpp b/kbattleship/kbattleship/main.cpp
index 2fdba01e..2ce685d8 100644
--- a/kbattleship/kbattleship/main.cpp
+++ b/kbattleship/kbattleship/main.cpp
@@ -51,8 +51,8 @@ int main(int argc, char *argv[])
KApplication app;
KGlobal::locale()->insertCatalogue("libkdegames");
- QString picDirCheck = locate("data", "kbattleship/pictures/");
- QString onePicCheck = locate("data", "kbattleship/pictures/hit.png");
+ TQString picDirCheck = locate("data", "kbattleship/pictures/");
+ TQString onePicCheck = locate("data", "kbattleship/pictures/hit.png");
if(picDirCheck.isEmpty() || onePicCheck.isEmpty())
{
KMessageBox::error(0, i18n("You don't have KBattleship pictures installed. The game cannot run without them!"));