summaryrefslogtreecommitdiffstats
path: root/ksnake/game.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
commit838baf3f99ec5ab81b063eb5449a3381d860f377 (patch)
treedd31abcfde08ca92e4623b8f50b3d762a87c997a /ksnake/game.cpp
parent2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff)
downloadtdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.tar.gz
tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.zip
TQt4 port kdegames
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1236074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksnake/game.cpp')
-rw-r--r--ksnake/game.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/ksnake/game.cpp b/ksnake/game.cpp
index 4817b3af..9a9e978f 100644
--- a/ksnake/game.cpp
+++ b/ksnake/game.cpp
@@ -54,7 +54,7 @@
#define SCORE 1
#define LIVES 2
-Game::Game(TQWidget *parent, const char *name) : KMainWindow(parent,name)
+Game::Game(TQWidget *tqparent, const char *name) : KMainWindow(tqparent,name)
{
// create statusbar
statusBar()->insertItem(i18n("Score: 0"), SCORE);
@@ -88,17 +88,17 @@ Game::~Game()
}
void Game::scoreChanged(int score){
- statusBar()->changeItem(i18n("Score: %1").arg(score), SCORE);
+ statusBar()->changeItem(i18n("Score: %1").tqarg(score), SCORE);
}
void Game::setTrys(int tries){
- statusBar()->changeItem(i18n("Lives: %1").arg(tries), LIVES);
+ statusBar()->changeItem(i18n("Lives: %1").tqarg(tries), LIVES);
}
void Game::gameEnd(int score){
KScoreDialog di(KScoreDialog::Name | KScoreDialog::Score | KScoreDialog::Date, this);
KScoreDialog::FieldInfo scoreInfo;
- TQString date = TQDateTime::currentDateTime().toString();
+ TQString date = TQDateTime::tqcurrentDateTime().toString();
scoreInfo.insert(KScoreDialog::Date, date);
if (di.addScore(score, scoreInfo, true))
di.exec();
@@ -120,12 +120,12 @@ void Game::createMenu()
actionCollection()->setAutoConnectShortcuts(true);
rattler->setActionCollection(actionCollection());
- KStdGameAction::gameNew(rattler, TQT_SLOT(restart()), actionCollection());
- pause = KStdGameAction::pause(rattler, TQT_SLOT(pause()), actionCollection());
- KStdGameAction::highscores(this, TQT_SLOT(showHighScores()), actionCollection());
- KStdGameAction::quit( this, TQT_SLOT(close()), actionCollection());
+ KStdGameAction::gameNew(TQT_TQOBJECT(rattler), TQT_SLOT(restart()), actionCollection());
+ pause = KStdGameAction::pause(TQT_TQOBJECT(rattler), TQT_SLOT(pause()), actionCollection());
+ KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighScores()), actionCollection());
+ KStdGameAction::quit( TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection());
- KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection());
+ KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(showSettings()), actionCollection());
// TODO change and make custom function that pauses game or
// modify widget to pause when loosing focus and remove this
@@ -163,7 +163,7 @@ void Game::showSettings(){
// since the filename may contain underscore, they
// are replaced with spaces in the menu entry
TQString s = TQFileInfo( *it ).baseName();
- s = s.replace(TQRegExp("_"), " ");
+ s = s.tqreplace(TQRegExp("_"), " ");
list.append(s);
}
}