diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-18 18:31:10 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-18 18:31:10 -0600 |
commit | 0e2b76239f354a9eead0b4e37d86d390ec57ffa9 (patch) | |
tree | cd20202507f54f61a4e58ae64fcd7cdb894abe19 /kbackgammon | |
parent | 84ace1135cac57993b72fee7105b92def1638d32 (diff) | |
download | tdegames-0e2b76239f354a9eead0b4e37d86d390ec57ffa9.tar.gz tdegames-0e2b76239f354a9eead0b4e37d86d390ec57ffa9.zip |
Rename old tq methods that no longer need a unique name
Diffstat (limited to 'kbackgammon')
-rw-r--r-- | kbackgammon/engines/fibs/kbgfibs.cpp | 46 | ||||
-rw-r--r-- | kbackgammon/engines/fibs/kbgfibs.h | 8 | ||||
-rw-r--r-- | kbackgammon/engines/fibs/kbgfibschat.cpp | 2 | ||||
-rw-r--r-- | kbackgammon/engines/fibs/kbginvite.cpp | 4 | ||||
-rw-r--r-- | kbackgammon/engines/fibs/kplayerlist.cpp | 26 | ||||
-rw-r--r-- | kbackgammon/engines/fibs/kplayerlist.h | 6 | ||||
-rw-r--r-- | kbackgammon/engines/generic/kbgengine.h | 6 | ||||
-rw-r--r-- | kbackgammon/engines/gnubg/kbggnubg.cpp | 6 | ||||
-rw-r--r-- | kbackgammon/engines/nextgen/kbgng.cpp | 2 | ||||
-rw-r--r-- | kbackgammon/engines/offline/kbgoffline.cpp | 2 | ||||
-rw-r--r-- | kbackgammon/kbg.cpp | 8 | ||||
-rw-r--r-- | kbackgammon/kbgboard.cpp | 48 | ||||
-rw-r--r-- | kbackgammon/kbgboard.h | 18 | ||||
-rw-r--r-- | kbackgammon/kbgstatus.cpp | 66 | ||||
-rw-r--r-- | kbackgammon/kbgstatus.h | 16 |
15 files changed, 132 insertions, 132 deletions
diff --git a/kbackgammon/engines/fibs/kbgfibs.cpp b/kbackgammon/engines/fibs/kbgfibs.cpp index 57eb6666..9a08c8d1 100644 --- a/kbackgammon/engines/fibs/kbgfibs.cpp +++ b/kbackgammon/engines/fibs/kbgfibs.cpp @@ -947,7 +947,7 @@ void KBgEngineFIBS::connected() /* * Initialize the rx state machine */ - rxtqStatus = RxConnect; + rxStatus = RxConnect; rxCollect = ""; /* @@ -992,7 +992,7 @@ void KBgEngineFIBS::newAccount() if (!queryConnection(true)) return; - rxtqStatus = RxNewLogin; + rxStatus = RxNewLogin; rxCollect = ""; login = false; connectFIBS(); @@ -1289,7 +1289,7 @@ void KBgEngineFIBS::handleServerData(TQString &line) */ line.replace(pat[TabChar], " "); - switch (rxtqStatus) { + switch (rxStatus) { case RxConnect: handleMessageConnect(line, rawline); @@ -1345,7 +1345,7 @@ void KBgEngineFIBS::handleMessageWhois(const TQString &line) { rxCollect += "<br> " + line; if (line.contains(pat[WhoisE1]) || line.contains(pat[WhoisE2])) { - rxtqStatus = RxNormal; + rxStatus = RxNormal; emit infoText("<font color=\"darkgreen\">" + rxCollect + "<br></font>"); } } @@ -1358,7 +1358,7 @@ void KBgEngineFIBS::handleMessageRating(const TQString &line) rxCollect += "<br>" + line; if (line.contains(pat[EndRate]) && ++rxCount == 2) { emit infoText("<font color=\"blue\">" + rxCollect + "<br></font>"); - rxtqStatus = RxNormal; + rxStatus = RxNormal; } } @@ -1368,7 +1368,7 @@ void KBgEngineFIBS::handleMessageRating(const TQString &line) void KBgEngineFIBS::handleMessageMotd(const TQString &line) { if (line.contains(pat[MotdEnd])) { - rxtqStatus = RxNormal; + rxStatus = RxNormal; emit infoText("<font color=\"blue\"><pre>" + rxCollect + "</pre></font>"); /* * just to be on the safe side, we set the value of boardstyle. @@ -1398,7 +1398,7 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r * This can only happen if the password/login is wrong. */ if (rxCollect.isEmpty()) { - rxtqStatus = RxIgnore; + rxStatus = RxIgnore; int ret = KMessageBox::warningContinueCancel ((TQWidget *)parent(), i18n("There was a problem with " "your login and password. " @@ -1411,9 +1411,9 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r infoFIBS[FIBSUser] = ""; infoFIBS[FIBSPswd] = ""; login = true; - connectFIBS(); // will reset the rxtqStatus + connectFIBS(); // will reset the rxStatus } else { - rxtqStatus = RxConnect; + rxStatus = RxConnect; emit serverString(""); emit serverString(""); } @@ -1473,7 +1473,7 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r */ if (line.contains(pat[OwnInfo])) { - rxtqStatus = RxNormal; + rxStatus = RxNormal; int fibsOptions[NumFIBSOpt]; @@ -1538,7 +1538,7 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r * The beginning of a new login procedure starts starts here */ if (line.contains(pat[OneName])) { - rxtqStatus = RxNewLogin; + rxStatus = RxNewLogin; emit infoText(TQString("<font color=\"red\">") + rxCollect + "</font>"); rxCollect = ""; TQString tmp = rawline; @@ -1613,7 +1613,7 @@ void KBgEngineFIBS::handleMessageNewLogin(const TQString &line) "playing backgammon on FIBS.").tqarg(infoFIBS[FIBSUser]); emit infoText("<br><hr><font color=\"blue\">" + text + "</font><br><hr>"); emit serverString("bye"); - rxtqStatus = RxNormal; + rxStatus = RxNormal; rxCollect = ""; return; } @@ -1717,7 +1717,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) /* * Save the board string and create a new game state */ - KBgtqStatus *st = new KBgtqStatus(currBoard = rawline); + KBgStatus *st = new KBgStatus(currBoard = rawline); /* * Save important state data and stop the timeout @@ -1779,13 +1779,13 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) */ else if (line.contains(pat[YouAway])) { - emit changePlayertqStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, true); + emit changePlayerStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, true); actBack->setEnabled(true); line += "<br><pre> </pre>" + i18n("(or use the corresponding menu entry to join the match)"); } else if (line.contains(pat[YouBack])) { - emit changePlayertqStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, false); + emit changePlayerStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, false); actBack->setEnabled(false); actAway->setEnabled(true); } @@ -1863,23 +1863,23 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) // - rx status changes ------------------------------------------------------------ else if (line.contains(pat[WhoisBG])) { - rxtqStatus = RxWhois; + rxStatus = RxWhois; rxCollect = TQString("<br><u>") + line + "</u>"; return; } else if (line.contains(pat[MotdBeg])) { - rxtqStatus = RxMotd; + rxStatus = RxMotd; rxCollect = ""; return; } else if (line.contains(pat[BegRate])) { - rxtqStatus = RxRating; + rxStatus = RxRating; rxCount = 0; rxCollect = "<br>" + line; return; } else if (line.contains(pat[Goodbye])) { - rxtqStatus = RxGoodbye; + rxStatus = RxGoodbye; rxCollect = "<br><hr><br>"; handleServerData(rawline); // danger: recursion! return; @@ -1944,13 +1944,13 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline) else if (line.contains(pat[BegBlnd])) { rawline.replace(pat[BegBlnd], ""); rawline.truncate(rawline.length()-1); - emit changePlayertqStatus(rawline, KFibsPlayerList::Blind, true); + emit changePlayerStatus(rawline, KFibsPlayerList::Blind, true); line = "<font color=\"red\">" + line + "</font>"; } else if (line.contains(pat[EndBlnd])) { rawline.replace(pat[EndBlnd], ""); rawline.truncate(rawline.length()-1); - emit changePlayertqStatus(rawline, KFibsPlayerList::Blind, false); + emit changePlayerStatus(rawline, KFibsPlayerList::Blind, false); line = "<font color=\"red\">" + line + "</font>"; } /* @@ -2128,8 +2128,8 @@ KBgEngineFIBS::KBgEngineFIBS(TQWidget *parent, TQString *name, TQPopupMenu *pmen connect(this, TQT_SIGNAL(fibsLogout (const TQString &)), playerlist, TQT_SLOT(deletePlayer(const TQString &))); connect(this, TQT_SIGNAL(fibsWhoEnd()), playerlist, TQT_SLOT(stopUpdate())); connect(this, TQT_SIGNAL(fibsConnectionClosed()), playerlist, TQT_SLOT(stopUpdate())); - connect(this, TQT_SIGNAL(changePlayertqStatus(const TQString &, int, bool)), - playerlist, TQT_SLOT(changePlayertqStatus(const TQString &, int, bool))); + connect(this, TQT_SIGNAL(changePlayerStatus(const TQString &, int, bool)), + playerlist, TQT_SLOT(changePlayerStatus(const TQString &, int, bool))); connect(playerlist, TQT_SIGNAL(fibsCommand(const TQString &)), this, TQT_SLOT(handleCommand(const TQString &))); connect(playerlist, TQT_SIGNAL(fibsInvite(const TQString &)), this, TQT_SLOT(fibsRequestInvitation(const TQString &))); diff --git a/kbackgammon/engines/fibs/kbgfibs.h b/kbackgammon/engines/fibs/kbgfibs.h index 24555ef2..db79ce51 100644 --- a/kbackgammon/engines/fibs/kbgfibs.h +++ b/kbackgammon/engines/fibs/kbgfibs.h @@ -175,7 +175,7 @@ signals: void fibsConnectionClosed(); - void changePlayertqStatus(const TQString &, int, bool); + void changePlayerStatus(const TQString &, int, bool); void chatMessage(const TQString &msg); @@ -199,7 +199,7 @@ private: TQString currBoard, caption; - //KBgtqStatus *currBoard + //KBgStatus *currBoard //KBgFIBSBoard *boardHandler; TQStringList invitations; @@ -400,10 +400,10 @@ protected slots: protected: - enum RxtqStatus {RxIgnore, RxConnect, RxWhois, RxMotd, RxRating, + enum RxStatus {RxIgnore, RxConnect, RxWhois, RxMotd, RxRating, RxNewLogin, RxGoodbye, RxNormal}; - int rxtqStatus, rxCount; + int rxStatus, rxCount; TQString rxCollect; diff --git a/kbackgammon/engines/fibs/kbgfibschat.cpp b/kbackgammon/engines/fibs/kbgfibschat.cpp index c3490cec..246e390d 100644 --- a/kbackgammon/engines/fibs/kbgfibschat.cpp +++ b/kbackgammon/engines/fibs/kbgfibschat.cpp @@ -123,7 +123,7 @@ protected: */ virtual void paint(TQPainter *p) { - t->draw(p, 1, 1, TQRegion(p->viewport()), w->tqcolorGroup()); + t->draw(p, 1, 1, TQRegion(p->viewport()), w->colorGroup()); } private: diff --git a/kbackgammon/engines/fibs/kbginvite.cpp b/kbackgammon/engines/fibs/kbginvite.cpp index 3870a6d2..f43c3b6a 100644 --- a/kbackgammon/engines/fibs/kbginvite.cpp +++ b/kbackgammon/engines/fibs/kbginvite.cpp @@ -103,9 +103,9 @@ KBgInvite::KBgInvite(const char *name) * Adjust widget sizes and resize the dialog */ KDialog::resizeLayout(this, marginHint(), spacingHint()); - setMinimumSize(tqchildrenRect().size()); + setMinimumSize(childrenRect().size()); vbox->activate(); - resize(tqminimumSize()); + resize(minimumSize()); /* * Set focus and default buttons diff --git a/kbackgammon/engines/fibs/kplayerlist.cpp b/kbackgammon/engines/fibs/kplayerlist.cpp index 62fb9a95..87d7ab22 100644 --- a/kbackgammon/engines/fibs/kplayerlist.cpp +++ b/kbackgammon/engines/fibs/kplayerlist.cpp @@ -101,7 +101,7 @@ public: case KFibsPlayerList::Watches: case KFibsPlayerList::Client: case KFibsPlayerList::Email: - case KFibsPlayerList::tqStatus: + case KFibsPlayerList::Status: case KFibsPlayerList::Host: s = s.lower(); break; @@ -175,7 +175,7 @@ public: /* * Short abbreviations for Blind, Ready, and Away. */ - TQString mAbrv[KFibsPlayerList::MaxtqStatus]; + TQString mAbrv[KFibsPlayerList::MaxStatus]; /* * Name of the last selected player - for internal purposes @@ -218,7 +218,7 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) d->mCol[Player]->name = i18n("Player"); d->mCol[Opponent]->name = i18n("Opponent"); d->mCol[Watches]->name = i18n("Watches"); - d->mCol[tqStatus]->name = i18n("Status"); + d->mCol[Status]->name = i18n("Status"); d->mCol[Rating]->name = i18n("Rating"); d->mCol[Experience]->name = i18n("Exp."); d->mCol[Idle]->name = i18n("Idle"); @@ -231,7 +231,7 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name) d->mCol[Player]->key = "player"; d->mCol[Opponent]->key = "opponent"; d->mCol[Watches]->key = "watches"; - d->mCol[tqStatus]->key = "status"; + d->mCol[Status]->key = "status"; d->mCol[Rating]->key = "rating"; d->mCol[Experience]->key = "experience"; d->mCol[Idle]->key = "idle"; @@ -592,9 +592,9 @@ void KFibsPlayerList::showContextMenu(KListView *, TQListViewItem *i, const TQPo d->mMail = (i && d->mCol[Email]->show ? i->text(d->mCol[Email]->index) : TQString()); d->mAct[KFibsPlayerListPrivate::Mail]->setEnabled(!d->mMail.isEmpty()); - if (i && d->mCol[tqStatus]->show) + if (i && d->mCol[Status]->show) d->mAct[KFibsPlayerListPrivate::BlindAct]->setText - ((i->text(d->mCol[tqStatus]->index).contains(d->mAbrv[Blind])) ? + ((i->text(d->mCol[Status]->index).contains(d->mAbrv[Blind])) ? i18n("Unblind %1").tqarg(d->mUser) : i18n("Blind %1").tqarg(d->mUser)); else d->mAct[KFibsPlayerListPrivate::BlindAct]->setText(i18n("Blind")); @@ -721,7 +721,7 @@ void KFibsPlayerList::changePlayer(const TQString &line) TQDateTime fromEpoch; TQString str_entry[LVEnd], tmp; - entry[tqStatus][0] = '\0'; + entry[Status][0] = '\0'; // the line comes from FIBS and is 7 bit ASCII sscanf(line.latin1(), "%99s %99s %99s %1s %1s %99s %99s %99s %99s %99s %99s %99s", entry[Player], entry[Opponent], @@ -738,9 +738,9 @@ void KFibsPlayerList::changePlayer(const TQString &line) if ((str_entry[j] = entry[j]) == "-") str_entry[j] = ""; } - str_entry[tqStatus].replace(Ready, 1, ready[0] == '0' ? "-" : d->mAbrv[Ready]); - str_entry[tqStatus].replace(Away, 1, away [0] == '0' ? "-" : d->mAbrv[Away ]); - str_entry[tqStatus].replace(Blind, 1, "-"); + str_entry[Status].replace(Ready, 1, ready[0] == '0' ? "-" : d->mAbrv[Ready]); + str_entry[Status].replace(Away, 1, away [0] == '0' ? "-" : d->mAbrv[Away ]); + str_entry[Status].replace(Blind, 1, "-"); // disable drawing until the end of update setUpdatesEnabled(false); @@ -771,7 +771,7 @@ void KFibsPlayerList::changePlayer(const TQString &line) found: // getting here means the player is in the list - update private status - str_entry[tqStatus].replace(Blind,1,i->text(tqStatus).contains + str_entry[Status].replace(Blind,1,i->text(Status).contains (d->mAbrv[Blind]) ? d->mAbrv[Blind] : "-"); update: @@ -808,7 +808,7 @@ void KFibsPlayerList::deletePlayer(const TQString &player) /* * Set/Unset the status stat in the corresponding column of the list */ -void KFibsPlayerList::changePlayertqStatus(const TQString &player, int stat, bool flag) +void KFibsPlayerList::changePlayerStatus(const TQString &player, int stat, bool flag) { TQListViewItem *i = 0; @@ -827,7 +827,7 @@ void KFibsPlayerList::changePlayertqStatus(const TQString &player, int stat, boo /* * Update the status flag */ - i->setText(tqStatus, i->text(tqStatus).replace(stat, 1, (flag) ? d->mAbrv[stat] : "-")); + i->setText(Status, i->text(Status).replace(stat, 1, (flag) ? d->mAbrv[stat] : "-")); } diff --git a/kbackgammon/engines/fibs/kplayerlist.h b/kbackgammon/engines/fibs/kplayerlist.h index 793e1b39..63724e06 100644 --- a/kbackgammon/engines/fibs/kplayerlist.h +++ b/kbackgammon/engines/fibs/kplayerlist.h @@ -53,12 +53,12 @@ public: /** * Enumerate player status */ - enum PtqStatus {Ready, Away, Blind, MaxtqStatus}; + enum PStatus {Ready, Away, Blind, MaxStatus}; /** * Enumerate the different columns of the list */ - enum {Player, Opponent, Watches, tqStatus, Rating, Experience, + enum {Player, Opponent, Watches, Status, Rating, Experience, Idle, Time, Host, Client, Email, LVEnd}; /** @@ -111,7 +111,7 @@ public slots: /** * Change the status of a player */ - void changePlayertqStatus(const TQString &player, int stat, bool flag); + void changePlayerStatus(const TQString &player, int stat, bool flag); /** * Fills the playerlist page into the notebook diff --git a/kbackgammon/engines/generic/kbgengine.h b/kbackgammon/engines/generic/kbgengine.h index 48855265..af74dc4b 100644 --- a/kbackgammon/engines/generic/kbgengine.h +++ b/kbackgammon/engines/generic/kbgengine.h @@ -35,7 +35,7 @@ class TQPopupMenu; class KDialogBase; -class KBgtqStatus; +class KBgStatus; /** * @@ -249,12 +249,12 @@ signals: /** * Emit the most recent game state */ - void newState (const KBgtqStatus &); + void newState (const KBgStatus &); /** * Tell the board that we need the current state of the board. */ - void getState (KBgtqStatus *); + void getState (KBgStatus *); /** * Starts/ends the edit mode of the board diff --git a/kbackgammon/engines/gnubg/kbggnubg.cpp b/kbackgammon/engines/gnubg/kbggnubg.cpp index 3ad42dd7..e8985a2c 100644 --- a/kbackgammon/engines/gnubg/kbggnubg.cpp +++ b/kbackgammon/engines/gnubg/kbggnubg.cpp @@ -117,7 +117,7 @@ void KBgEngineGNU::handleLine(const TQString &l) // redoubles mess up the game counter "turn" - //KBgtqStatus st(board); + //KBgStatus st(board); //st.setCube(32, BOTH); //emit newState(st); @@ -128,7 +128,7 @@ void KBgEngineGNU::handleLine(const TQString &l) // can be shared between all engines #if 0 - KBgtqStatus st(board); + KBgStatus st(board); int ret = KMessageBox::warningYesNoCancel (0, i18n("gnubg doubles the cube to %1.").tqarg(2*st.cube(THEM)), @@ -164,7 +164,7 @@ void KBgEngineGNU::handleLine(const TQString &l) */ if (line.contains(TQRegExp("^board:"))) { - KBgtqStatus st(line); + KBgStatus st(line); /* * Do preliminary analysis of board diff --git a/kbackgammon/engines/nextgen/kbgng.cpp b/kbackgammon/engines/nextgen/kbgng.cpp index e0c1aed5..d081e9a8 100644 --- a/kbackgammon/engines/nextgen/kbgng.cpp +++ b/kbackgammon/engines/nextgen/kbgng.cpp @@ -202,7 +202,7 @@ void KBgEngineNg::setGame() // we are still having problems with player creation... - // FIXME - which status _game->setGametqStatus(KGame::End); + // FIXME - which status _game->setGameStatus(KGame::End); } void KBgEngineNg::slotPlayerJoinedGame(KPlayer *p) diff --git a/kbackgammon/engines/offline/kbgoffline.cpp b/kbackgammon/engines/offline/kbgoffline.cpp index 604d196e..2c5cd260 100644 --- a/kbackgammon/engines/offline/kbgoffline.cpp +++ b/kbackgammon/engines/offline/kbgoffline.cpp @@ -60,7 +60,7 @@ public: /* * Store two copies of the game: one backup and a working copy */ - KBgtqStatus mGame[2]; + KBgStatus mGame[2]; /* * Use the standard method of obtaining random numbers diff --git a/kbackgammon/kbg.cpp b/kbackgammon/kbg.cpp index 0c01d8f1..98bf16c5 100644 --- a/kbackgammon/kbg.cpp +++ b/kbackgammon/kbg.cpp @@ -293,8 +293,8 @@ void KBg::setupEngine() connect(engine[currEngine], TQT_SIGNAL(redoMove()), board, TQT_SLOT(redoMove())); connect(engine[currEngine], TQT_SIGNAL(setEditMode(const bool)), board, TQT_SLOT(setEditMode(const bool))); connect(engine[currEngine], TQT_SIGNAL(allowMoving(const bool)), board, TQT_SLOT(allowMoving(const bool))); - connect(engine[currEngine], TQT_SIGNAL(getState(KBgtqStatus *)), board, TQT_SLOT(getState(KBgtqStatus *))); - connect(engine[currEngine], TQT_SIGNAL(newState(const KBgtqStatus &)), board, TQT_SLOT(setState(const KBgtqStatus &))); + connect(engine[currEngine], TQT_SIGNAL(getState(KBgStatus *)), board, TQT_SLOT(getState(KBgStatus *))); + connect(engine[currEngine], TQT_SIGNAL(newState(const KBgStatus &)), board, TQT_SLOT(setState(const KBgStatus &))); // now that all signals are connected, start the engine engine[currEngine]->start(); @@ -575,7 +575,7 @@ void KBg::setupDlg() TQGridLayout *gle = new TQGridLayout(gbe, 1, 1, nb->spacingHint()); KURLLabel *lab = new KURLLabel("kcmshell kcmnotify", i18n("Klick here to configure the event notification"), gbe); - lab->setMaximumSize(lab->tqsizeHint()); + lab->setMaximumSize(lab->sizeHint()); gle->addWidget(lab, 0, 0); connect(lab, TQT_SIGNAL(leftClickedURL(const TQString &)), TQT_SLOT(startKCM(const TQString &))); @@ -622,7 +622,7 @@ void KBg::setupDlg() connect(nb, TQT_SIGNAL(finished()), TQT_TQOBJECT(this), TQT_SLOT(setupDone())); - nb->resize(nb->tqminimumSize()); + nb->resize(nb->minimumSize()); nb->show(); } diff --git a/kbackgammon/kbgboard.cpp b/kbackgammon/kbgboard.cpp index ba2d1829..1e983335 100644 --- a/kbackgammon/kbgboard.cpp +++ b/kbackgammon/kbgboard.cpp @@ -196,7 +196,7 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb) "move a checker the shortest possible distance.")); for (int i = 0; i < 3; i++) { - rbMove[i]->setMinimumSize(rbMove[i]->tqsizeHint()); + rbMove[i]->setMinimumSize(rbMove[i]->sizeHint()); blm->addWidget(rbMove[i]); rbMove[i]->setChecked(i == getShortMoveMode()); } @@ -360,7 +360,7 @@ void KBgBoard::setFont(const TQFont& f) */ void KBgBoard::queryCube() { - KBgtqStatus *st = new KBgtqStatus(); + KBgStatus *st = new KBgStatus(); getState(st); KBgBoardQCube *dlg = new KBgBoardQCube(abs(st->cube()), (st->cube(US) > 0), (st->cube(THEM) > 0)); @@ -395,7 +395,7 @@ KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them) "double. Note that a face value of 1 automatically allows both\n" "players to double.")); - info->setMinimumSize(info->tqsizeHint()); + info->setMinimumSize(info->sizeHint()); vbox->addWidget(info, 0); @@ -454,17 +454,17 @@ KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them) else if (them) cb[1]->setCurrentItem(THEM); - cb[0]->setMinimumSize(cb[0]->tqsizeHint()); - cb[1]->setMinimumSize(cb[1]->tqsizeHint()); + cb[0]->setMinimumSize(cb[0]->sizeHint()); + cb[1]->setMinimumSize(cb[1]->sizeHint()); - ok->setMinimumSize(ok->tqsizeHint()); - cancel->setMinimumSize(cancel->tqsizeHint()); + ok->setMinimumSize(ok->sizeHint()); + cancel->setMinimumSize(cancel->sizeHint()); - setMinimumSize(tqchildrenRect().size()); + setMinimumSize(childrenRect().size()); vbox->activate(); - resize(tqminimumSize()); + resize(minimumSize()); ok->setAutoDefault (true); ok->setDefault(true); @@ -544,7 +544,7 @@ KBgBoardQDice::KBgBoardQDice(const char *name) info->setText(i18n("Set the face values of the selected dice. The other player's\n" "dice will be cleared and it will be the dice's owner's turn.")); - info->setMinimumSize(info->tqsizeHint()); + info->setMinimumSize(info->sizeHint()); vbox->addWidget(info, 0); @@ -560,17 +560,17 @@ KBgBoardQDice::KBgBoardQDice(const char *name) hbox_2->addWidget(ok); hbox_2->addWidget(cancel); - sb[0]->setMinimumSize(sb[0]->tqsizeHint()); - sb[1]->setMinimumSize(sb[1]->tqsizeHint()); + sb[0]->setMinimumSize(sb[0]->sizeHint()); + sb[1]->setMinimumSize(sb[1]->sizeHint()); - ok->setMinimumSize(ok->tqsizeHint()); - cancel->setMinimumSize(cancel->tqsizeHint()); + ok->setMinimumSize(ok->sizeHint()); + cancel->setMinimumSize(cancel->sizeHint()); - setMinimumSize(tqchildrenRect().size()); + setMinimumSize(childrenRect().size()); vbox->activate(); - resize(tqminimumSize()); + resize(minimumSize()); ok->setAutoDefault (true); ok->setDefault(true); @@ -628,10 +628,10 @@ bool KBgBoard::getEditMode() const } /* - * This function takes a KBgtqStatus object and fills it with the current + * This function takes a KBgStatus object and fills it with the current * board status. */ -KBgtqStatus* KBgBoard::getState(KBgtqStatus *st) const +KBgStatus* KBgBoard::getState(KBgStatus *st) const { st->setColor(color); st->setDirection(direction); @@ -1337,7 +1337,7 @@ void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e) KBgBoardQDice *dlg = new KBgBoardQDice(); if (dlg->exec()) { - KBgtqStatus *st = new KBgtqStatus(); + KBgStatus *st = new KBgStatus(); board->getState(st); st->setDice(w, 0, dlg->getDice(0)); st->setDice(w, 1, dlg->getDice(1)); @@ -2085,7 +2085,7 @@ bool KBgBoard::diceAllowMove(int src, int dest) * This is the most important of all members of the board class. It takes * a single board status object and initializes the internal status. */ -void KBgBoard::setState(const KBgtqStatus &st) +void KBgBoard::setState(const KBgStatus &st) { color = st.color(); direction = st.direction(); @@ -2820,7 +2820,7 @@ void KBgBoard::getRollDice(const int w) * This is the constructor of the KBgBoard class. It creates * a backgammon board with an initial distribution of checkers, empty * dice and a cube with face value 1. The initial board is not usable! - * You have to change the status by passing a KBgtqStatus + * You have to change the status by passing a KBgStatus * object to setState(...) before you can play! */ KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu) @@ -2868,7 +2868,7 @@ KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu) * Get the default seeting of the board and initialize the * state of it. */ - KBgtqStatus *st = new KBgtqStatus(); + KBgStatus *st = new KBgStatus(); st->setCube(1, true, true); st->setDirection(+1); @@ -2907,12 +2907,12 @@ KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu) setFont(TQApplication::font()); } -TQSize KBgBoard::tqminimumSizeHint() const +TQSize KBgBoard::minimumSizeHint() const { return TQSize(MINIMUM_CHECKER_SIZE * 15, MINIMUM_CHECKER_SIZE * 11); } -TQSize KBgBoard::tqsizeHint() const { +TQSize KBgBoard::sizeHint() const { return TQSize(MINIMUM_CHECKER_SIZE *15*4,MINIMUM_CHECKER_SIZE*11*2); } diff --git a/kbackgammon/kbgboard.h b/kbackgammon/kbgboard.h index f91ab93b..d0d25121 100644 --- a/kbackgammon/kbgboard.h +++ b/kbackgammon/kbgboard.h @@ -64,9 +64,9 @@ /* * Just some internal constants and classes */ -const int US = KBgtqStatus::US; -const int THEM = KBgtqStatus::THEM; -const int BOTH = KBgtqStatus::BOTH; +const int US = KBgStatus::US; +const int THEM = KBgStatus::THEM; +const int BOTH = KBgStatus::BOTH; const int HOME_US_LEFT = 101; const int HOME_US_RIGHT = 102; @@ -181,7 +181,7 @@ class KBgBoard : public TQWidget * This function has to be reimplemented to provide a minimum size for * the playing area. */ - TQSize tqminimumSizeHint() const; + TQSize minimumSizeHint() const; public slots: /** @@ -211,10 +211,10 @@ public slots: /** * This is the most important public member. It takes - * a board status - s. the KBgBoardtqStatus class - + * a board status - s. the KBgBoardStatus class - * and sets the board accordingly. */ - void setState(const KBgtqStatus &); + void setState(const KBgStatus &); /** * Set the context menu @@ -224,7 +224,7 @@ public slots: /** * Get the current state of the board. */ - KBgtqStatus *getState(KBgtqStatus *st) const; + KBgStatus *getState(KBgStatus *st) const; /** * Sets the edit mode of the board. In that mode the board can be @@ -292,7 +292,7 @@ public slots: /* ************************************************** */ protected: - virtual TQSize tqsizeHint() const; + virtual TQSize sizeHint() const; TQColor baseColors[2]; TQFont boardFont; @@ -535,7 +535,7 @@ protected: virtual void drawContents(TQPainter *); /** - * tqStatus numbers that store the current board status. + * Status numbers that store the current board status. */ int mouseButton; int direction; diff --git a/kbackgammon/kbgstatus.cpp b/kbackgammon/kbgstatus.cpp index e9e8d4e5..824ff721 100644 --- a/kbackgammon/kbgstatus.cpp +++ b/kbackgammon/kbgstatus.cpp @@ -29,7 +29,7 @@ /* * Parse a rawboard description from FIBS and initialize members. */ -KBgtqStatus::KBgtqStatus(const TQString &rawboard) +KBgStatus::KBgStatus(const TQString &rawboard) { /* * This is the format string from hell... @@ -116,7 +116,7 @@ KBgtqStatus::KBgtqStatus(const TQString &rawboard) * Constructor initializes the status to an empty board with cube one * and empty dice. */ -KBgtqStatus::KBgtqStatus() +KBgStatus::KBgStatus() : TQObject() { /* @@ -146,7 +146,7 @@ KBgtqStatus::KBgtqStatus() /* * Copy constructor calls private utility function. */ -KBgtqStatus::KBgtqStatus(const KBgtqStatus &rhs) +KBgStatus::KBgStatus(const KBgStatus &rhs) : TQObject() { copy(rhs); @@ -155,7 +155,7 @@ KBgtqStatus::KBgtqStatus(const KBgtqStatus &rhs) /* * Destructor */ -KBgtqStatus::~KBgtqStatus() +KBgStatus::~KBgStatus() { // nothing to do } @@ -164,14 +164,14 @@ KBgtqStatus::~KBgtqStatus() * Assignment operator shares a lot of code with the copy * constructor. */ -KBgtqStatus& KBgtqStatus::operator=(const KBgtqStatus &rhs) +KBgStatus& KBgStatus::operator=(const KBgStatus &rhs) { if (this == &rhs) return *this; copy(rhs); return *this; } -void KBgtqStatus::copy(const KBgtqStatus &rhs) +void KBgStatus::copy(const KBgStatus &rhs) { for (int i = 0; i < 26; i++) board_[i] = rhs.board_[i]; @@ -199,32 +199,32 @@ void KBgtqStatus::copy(const KBgtqStatus &rhs) /* * Access functions */ -int KBgtqStatus::board(const int &i) const +int KBgStatus::board(const int &i) const { return ((0 < i && i < 25) ? color_*board_[i] : 0); } -int KBgtqStatus::home(const int &w) const +int KBgStatus::home(const int &w) const { return ((w == US || w == THEM) ? color_*home_[w] : 0); } -int KBgtqStatus::bar(const int &w) const +int KBgStatus::bar(const int &w) const { return ((w == US || w == THEM) ? color_*bar_[w] : 0); } -int KBgtqStatus::color(const int &w) const +int KBgStatus::color(const int &w) const { return ((w == THEM) ? -color_ : color_); } -int KBgtqStatus::direction() const +int KBgStatus::direction() const { return direction_; } -int KBgtqStatus::dice(const int &w, const int &n) const +int KBgStatus::dice(const int &w, const int &n) const { if ((w == US || w == THEM) && (n == 0 || n == 1)) return dice_[w][n]; @@ -232,34 +232,34 @@ int KBgtqStatus::dice(const int &w, const int &n) const return 0; } -int KBgtqStatus::cube(const int &w) const +int KBgStatus::cube(const int &w) const { if (w == US || w == THEM) return ((maydouble_[w]) ? cube_ : -cube_); return 0; } -int KBgtqStatus::points(const int& w) const +int KBgStatus::points(const int& w) const { return ((w == US || w == THEM) ? points_[w] : -1); } -TQString KBgtqStatus::player(const int &w) const +TQString KBgStatus::player(const int &w) const { return ((w == US || w == THEM) ? player_[w] : TQString()); } -int KBgtqStatus::length() const +int KBgStatus::length() const { return length_; } -int KBgtqStatus::turn() const +int KBgStatus::turn() const { return turn_; } -bool KBgtqStatus::doubled() const +bool KBgStatus::doubled() const { return doubled_; } @@ -268,7 +268,7 @@ bool KBgtqStatus::doubled() const /* * Assignment functions */ -void KBgtqStatus::setBoard(const int &i, const int &w, const int &v) +void KBgStatus::setBoard(const int &i, const int &w, const int &v) { if (0 < i && i < 25) { if (w == US) @@ -278,7 +278,7 @@ void KBgtqStatus::setBoard(const int &i, const int &w, const int &v) } } -void KBgtqStatus::setHome(const int &w, const int &v) +void KBgStatus::setHome(const int &w, const int &v) { if (w == US) home_[w] = abs(v); @@ -286,7 +286,7 @@ void KBgtqStatus::setHome(const int &w, const int &v) home_[w] = -abs(v); } -void KBgtqStatus::setBar(const int& w, const int& v) +void KBgStatus::setBar(const int& w, const int& v) { if (w == US) bar_[w] = abs(v); @@ -294,7 +294,7 @@ void KBgtqStatus::setBar(const int& w, const int& v) bar_[w] = -abs(v); } -void KBgtqStatus::setColor(const int &c, const int &w) +void KBgStatus::setColor(const int &c, const int &w) { if (w == US) color_ = ((c < 0) ? Black : White); @@ -302,12 +302,12 @@ void KBgtqStatus::setColor(const int &c, const int &w) color_ = ((c < 0) ? White : Black); } -void KBgtqStatus::setDirection(const int &dir) +void KBgStatus::setDirection(const int &dir) { direction_ = ((dir < 0) ? -1 : +1); } -void KBgtqStatus::setDice(const int &w, const int &n, const int &v) +void KBgStatus::setDice(const int &w, const int &n, const int &v) { if ((w == US || w == THEM) && (n == 0 || n == 1)) { if (0 <= v && v <= 6) @@ -317,7 +317,7 @@ void KBgtqStatus::setDice(const int &w, const int &n, const int &v) } } -void KBgtqStatus::setCube(const int &c, const bool &us, const bool &them) +void KBgStatus::setCube(const int &c, const bool &us, const bool &them) { int w = NONE; if (us) w = US; @@ -326,7 +326,7 @@ void KBgtqStatus::setCube(const int &c, const bool &us, const bool &them) setCube(c, w); } -void KBgtqStatus::setCube(const int &c, const int &w) +void KBgStatus::setCube(const int &c, const int &w) { // assume that int has at least 32 bits... for (int i = 0; i < 31; i++) { @@ -337,24 +337,24 @@ void KBgtqStatus::setCube(const int &c, const int &w) maydouble_[THEM] = (w == THEM || w == BOTH); } -void KBgtqStatus::setPoints(const int &w, const int &p) +void KBgStatus::setPoints(const int &w, const int &p) { if (w == US || w == THEM) points_[w] = p; } -void KBgtqStatus::setPlayer(const int &w, const TQString &name) +void KBgStatus::setPlayer(const int &w, const TQString &name) { if (w == US || w == THEM) player_[w] = name; } -void KBgtqStatus::setLength(const int &l) +void KBgStatus::setLength(const int &l) { length_ = l; } -void KBgtqStatus::setTurn(const int &w) +void KBgStatus::setTurn(const int &w) { if (w == US || w == THEM || w == BOTH) turn_ = w; @@ -364,7 +364,7 @@ void KBgtqStatus::setTurn(const int &w) /* * Utility functions */ -int KBgtqStatus::moves() const +int KBgStatus::moves() const { int start, dir; @@ -407,7 +407,7 @@ int KBgtqStatus::moves() const * Get a copy of ourselves. That way we can mess around with * the internals of the game. */ - KBgtqStatus sc(*this); + KBgStatus sc(*this); /* * Start with getting all checkers off the bar @@ -490,7 +490,7 @@ int KBgtqStatus::moves() const } } -bool KBgtqStatus::movePossible(KBgtqStatus &sc, int a, int start, int dir) const +bool KBgStatus::movePossible(KBgStatus &sc, int a, int start, int dir) const { /* * Determine where the first checker in moving direction is diff --git a/kbackgammon/kbgstatus.h b/kbackgammon/kbgstatus.h index 255dc049..69d1a0b6 100644 --- a/kbackgammon/kbgstatus.h +++ b/kbackgammon/kbgstatus.h @@ -43,7 +43,7 @@ * @author Jens Hoefkens <jens@hoefkens.com> * @version $Id$ */ -class KBgtqStatus : public TQObject +class KBgStatus : public TQObject { Q_OBJECT @@ -66,27 +66,27 @@ class KBgtqStatus : public TQObject * The default constructor initializes the status to an "empty" * state. The board and dice are empty and the cube shows 1. */ - KBgtqStatus(); + KBgStatus(); /** * Constructor from a FIBS rawboard string */ - KBgtqStatus(const TQString &rawboard); + KBgStatus(const TQString &rawboard); /** * Copy constructor */ - KBgtqStatus(const KBgtqStatus &rhs); + KBgStatus(const KBgStatus &rhs); /** * Assignment operator */ - KBgtqStatus& operator=(const KBgtqStatus &rhs); + KBgStatus& operator=(const KBgStatus &rhs); /** * Destructor */ - virtual ~KBgtqStatus(); + virtual ~KBgStatus(); /* @@ -289,12 +289,12 @@ class KBgtqStatus : public TQObject * anywhere starting from start or later into direction * dir in the game given by sc. */ - bool movePossible(KBgtqStatus &sc, int a, int start, int dir) const; + bool movePossible(KBgStatus &sc, int a, int start, int dir) const; /* * Copy constr. and assignment share a lot of code. */ - void copy(const KBgtqStatus &rhs); + void copy(const KBgStatus &rhs); /* * Private variables with self-expalanatory names. |