summaryrefslogtreecommitdiffstats
path: root/kbackgammon
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 /kbackgammon
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 'kbackgammon')
-rw-r--r--kbackgammon/engines/fibs/kbgfibs.cpp320
-rw-r--r--kbackgammon/engines/fibs/kbgfibs.h11
-rw-r--r--kbackgammon/engines/fibs/kbgfibschat.cpp168
-rw-r--r--kbackgammon/engines/fibs/kbgfibschat.h5
-rw-r--r--kbackgammon/engines/fibs/kbginvite.cpp6
-rw-r--r--kbackgammon/engines/fibs/kbginvite.h1
-rw-r--r--kbackgammon/engines/fibs/kplayerlist.cpp110
-rw-r--r--kbackgammon/engines/fibs/kplayerlist.h9
-rw-r--r--kbackgammon/engines/generic/kbgengine.cpp6
-rw-r--r--kbackgammon/engines/generic/kbgengine.h14
-rw-r--r--kbackgammon/engines/gnubg/kbggnubg.cpp58
-rw-r--r--kbackgammon/engines/gnubg/kbggnubg.h3
-rw-r--r--kbackgammon/engines/nextgen/kbggame.cpp6
-rw-r--r--kbackgammon/engines/nextgen/kbggame.h3
-rw-r--r--kbackgammon/engines/nextgen/kbgng.cpp58
-rw-r--r--kbackgammon/engines/nextgen/kbgng.h15
-rw-r--r--kbackgammon/engines/nextgen/kbgplayer.h1
-rw-r--r--kbackgammon/engines/offline/kbgoffline.cpp44
-rw-r--r--kbackgammon/engines/offline/kbgoffline.h3
-rw-r--r--kbackgammon/kbg.cpp58
-rw-r--r--kbackgammon/kbg.h1
-rw-r--r--kbackgammon/kbgboard.cpp136
-rw-r--r--kbackgammon/kbgboard.h76
-rw-r--r--kbackgammon/kbgstatus.cpp70
-rw-r--r--kbackgammon/kbgstatus.h21
-rw-r--r--kbackgammon/kbgtextview.cpp4
-rw-r--r--kbackgammon/kbgtextview.h3
27 files changed, 616 insertions, 594 deletions
diff --git a/kbackgammon/engines/fibs/kbgfibs.cpp b/kbackgammon/engines/fibs/kbgfibs.cpp
index 4e7fd2f4..1492ad2c 100644
--- a/kbackgammon/engines/fibs/kbgfibs.cpp
+++ b/kbackgammon/engines/fibs/kbgfibs.cpp
@@ -81,7 +81,7 @@ void KBgEngineFIBS::start()
// == configuration handling ===================================================
/*
- * Restore settings and ask children to do the same
+ * Restore settings and ask tqchildren to do the same
*/
void KBgEngineFIBS::readConfig()
{
@@ -110,7 +110,7 @@ void KBgEngineFIBS::readConfig()
autoMsg[MsgLos] = config->readEntry("msg-los", "");
autoMsg[MsgWin] = config->readEntry("msg-win", "");
- // ask the children to read their config options
+ // ask the tqchildren to read their config options
playerlist->readConfig();
chatWindow->readConfig();
}
@@ -145,7 +145,7 @@ void KBgEngineFIBS::saveConfig()
config->writeEntry("msg-los", autoMsg[MsgLos]);
config->writeEntry("msg-win", autoMsg[MsgWin]);
- // ask the children to read their config options
+ // ask the tqchildren to read their config options
playerlist->saveConfig();
chatWindow->saveConfig();
}
@@ -343,7 +343,7 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb)
TQWhatsThis::add(cbk, i18n("Usually, FIBS drops the connection after one hour of inactivity. When "
"you check this box, %1 will try to keep the connection alive, even "
"if you are not actually playing or chatting. Use this with caution "
- "if you do not have flat-rate Internet access.").arg(PROG_NAME));
+ "if you do not have flat-rate Internet access.").tqarg(PROG_NAME));
cbk->setChecked(keepalive);
@@ -357,7 +357,7 @@ void KBgEngineFIBS::getSetupPages(KDialogBase *nb)
tc->addTab(w, i18n("&Connection"));
/*
- * Ask children for settings
+ * Ask tqchildren for settings
*/
chatWindow->getSetupPages(tc, nb->spacingHint());
playerlist->getSetupPages(tc, nb->spacingHint());
@@ -380,7 +380,7 @@ void KBgEngineFIBS::cancelJoin(const TQString &info)
TQRegExp patt = TQRegExp("^" + info + " ");
for (int i = 0; i <= numJoin; i++) {
- if (actJoin[i]->text().contains(patt)) {
+ if (actJoin[i]->text().tqcontains(patt)) {
// move all entries starting at i+1 up by one...
for (int j = i; j < numJoin; j++)
actJoin[j]->setText(actJoin[j+1]->text());
@@ -426,33 +426,33 @@ void KBgEngineFIBS::changeJoin(const TQString &info)
for (TQStringList::Iterator it = invitations.begin(); it != invitations.end(); ++it) {
- if ((*it).contains(patt)) {
+ if ((*it).tqcontains(patt)) {
TQString text, menu;
- if ((*it).contains(TQRegExp(" r$"))) {
- menu = i18n("R means resume", "%1 (R)").arg(name);
+ if ((*it).tqcontains(TQRegExp(" r$"))) {
+ menu = i18n("R means resume", "%1 (R)").tqarg(name);
text = i18n("%1 (experience %2, rating %3) wants to resume a saved match with you. "
"If you want to play, use the corresponding menu entry to join (or type "
- "'join %4').").arg(name).arg(expi_s).arg(rate_s).arg(name);
+ "'join %4').").tqarg(name).tqarg(expi_s).tqarg(rate_s).tqarg(name);
KNotifyClient::event("invitation", i18n("%1 wants to resume a saved match with you").
arg(name));
- } else if ((*it).contains(TQRegExp(" u$"))) {
- menu = i18n("U means unlimited", "%1 (U)").arg(name);
+ } else if ((*it).tqcontains(TQRegExp(" u$"))) {
+ menu = i18n("U means unlimited", "%1 (U)").tqarg(name);
text = i18n("%1 (experience %2, rating %3) wants to play an unlimited match with you. "
"If you want to play, use the corresponding menu entry to join (or type "
- "'join %4').").arg(name).arg(expi_s).arg(rate_s).arg(name);
+ "'join %4').").tqarg(name).tqarg(expi_s).tqarg(rate_s).tqarg(name);
KNotifyClient::event("invitation", i18n("%1 has invited you to an unlimited match").
arg(name));
} else {
TQString len = (*it).right((*it).length() - name.length() - 1);
menu = i18n("If the format of the (U) and (R) strings is changed, it should also be changed here",
- "%1 (%2)").arg(name).arg(len);
+ "%1 (%2)").tqarg(name).tqarg(len);
text = i18n("%1 (experience %2, rating %3) wants to play a %4 point match with you. "
"If you want to play, use the corresponding menu entry to join (or type "
- "'join %5').").arg(name).arg(expi_s).arg(rate_s).arg(len).arg(name);
+ "'join %5').").tqarg(name).tqarg(expi_s).tqarg(rate_s).tqarg(len).tqarg(name);
KNotifyClient::event("invitation", i18n("%1 has invited you for a %2 point match").
- arg(name).arg(len));
+ tqarg(name).tqarg(len));
}
emit serverString("rawwho " + name); // this avoids a race
if (whoisInvite) {
@@ -493,7 +493,7 @@ void KBgEngineFIBS::changeJoin(const TQString &info)
*/
void KBgEngineFIBS::keepAlive()
{
- emit serverString("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
+ emit serverString("ABCDEFGHIJKLMNOPTQRSTUVWXYZ");
}
/*
@@ -578,8 +578,8 @@ void KBgEngineFIBS::done()
emit allowCommand(Roll, false);
// Transform the string to FIBS cormat
- lastMove.replace(0, 2, "move ");
- lastMove.replace(pat[PlsChar], "-");
+ lastMove.tqreplace(0, 2, "move ");
+ lastMove.tqreplace(pat[PlsChar], "-");
// sent it to the server
emit serverString(lastMove);
@@ -642,7 +642,7 @@ bool KBgEngineFIBS::queryClose()
if (connection->state() == TQSocket::Idle)
return true;
- switch (KMessageBox::warningYesNoCancel((TQWidget *)parent(),i18n("Still connected. Log out first?"),TQString::null,i18n("Log Out"), i18n("Stay Connected"))) {
+ switch (KMessageBox::warningYesNoCancel((TQWidget *)tqparent(),i18n("Still connected. Log out first?"),TQString(),i18n("Log Out"), i18n("Stay Connected"))) {
case KMessageBox::Yes :
disconnectFIBS();
return true;
@@ -731,7 +731,7 @@ void KBgEngineFIBS::away()
bool ret;
TQString msg = KLineEditDlg::getText(i18n("Please type the message that should be displayed to other\n"
"users while you are away."),
- lastAway, &ret, (TQWidget *)parent());
+ lastAway, &ret, (TQWidget *)tqparent());
if (ret) {
lastAway = msg;
emit serverString("away " + msg);
@@ -809,7 +809,7 @@ void KBgEngineFIBS::load()
*/
void KBgEngineFIBS::join(const TQString &msg)
{
- emit serverString("join " + msg.left(msg.find('(')));
+ emit serverString("join " + msg.left(msg.tqfind('(')));
}
void KBgEngineFIBS::join_0() { join(actJoin[0]->text()); }
void KBgEngineFIBS::join_1() { join(actJoin[1]->text()); }
@@ -877,7 +877,7 @@ void KBgEngineFIBS::connectFIBS()
/*
* Connect
*/
- emit infoText(i18n("Looking up %1").arg(infoFIBS[FIBSHost]));
+ emit infoText(i18n("Looking up %1").tqarg(infoFIBS[FIBSHost]));
connection->connectToHost(infoFIBS[FIBSHost], infoFIBS[FIBSPort].toUShort());
return;
@@ -888,7 +888,7 @@ void KBgEngineFIBS::connectFIBS()
*/
void KBgEngineFIBS::hostFound()
{
- emit infoText(i18n("Connecting to %1").arg(infoFIBS[FIBSHost]));
+ emit infoText(i18n("Connecting to %1").tqarg(infoFIBS[FIBSHost]));
}
/*
@@ -947,7 +947,7 @@ void KBgEngineFIBS::connected()
/*
* Initialize the rx state machine
*/
- rxStatus = RxConnect;
+ rxtqStatus = RxConnect;
rxCollect = "";
/*
@@ -992,7 +992,7 @@ void KBgEngineFIBS::newAccount()
if (!queryConnection(true))
return;
- rxStatus = RxNewLogin;
+ rxtqStatus = RxNewLogin;
rxCollect = "";
login = false;
connectFIBS();
@@ -1052,7 +1052,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin)
msg = KLineEditDlg::getText(i18n("Enter the name of the server you want to connect to.\n"
"This should almost always be \"fibs.com\"."),
- infoFIBS[FIBSHost], &ret, (TQWidget *)parent());
+ infoFIBS[FIBSHost], &ret, (TQWidget *)tqparent());
if (ret)
infoFIBS[FIBSHost] = msg;
@@ -1064,7 +1064,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin)
msg = KLineEditDlg::getText(i18n("Enter the port number on the server. "
"It should almost always be \"4321\"."),
- infoFIBS[FIBSPort], &ret, (TQWidget *)parent());
+ infoFIBS[FIBSPort], &ret, (TQWidget *)tqparent());
if (ret)
infoFIBS[FIBSPort] = msg;
@@ -1077,24 +1077,24 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin)
text = i18n("Enter the login you would like to use on the server %1. The login may not\n"
"contain spaces or colons. If the login you choose is not available, you'll later be\n"
- "given the opportunity to pick another one.\n\n").arg(infoFIBS[FIBSHost]);
+ "given the opportunity to pick another one.\n\n").tqarg(infoFIBS[FIBSHost]);
else
text = i18n("Enter your login on the server %1. If you don't have a login, you\n"
- "should create one using the corresponding menu option.\n\n").arg(infoFIBS[FIBSHost]);
+ "should create one using the corresponding menu option.\n\n").tqarg(infoFIBS[FIBSHost]);
first = true;
do {
msg = (KLineEditDlg::getText(text, infoFIBS[FIBSUser], &ret,
- (TQWidget *)parent())).stripWhiteSpace();
+ (TQWidget *)tqparent())).stripWhiteSpace();
if (first) {
text += i18n("The login may not contain spaces or colons!");
first = false;
}
- } while (ret && (msg.isEmpty() || msg.contains(' ') || msg.contains(':')));
+ } while (ret && (msg.isEmpty() || msg.tqcontains(' ') || msg.tqcontains(':')));
if (ret)
infoFIBS[FIBSUser] = msg;
@@ -1107,12 +1107,12 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin)
text = i18n("Enter the password you would like to use with the login %1\n"
"on the server %2. It may not contain colons.\n\n").
- arg(infoFIBS[FIBSUser]).arg(infoFIBS[FIBSHost]);
+ tqarg(infoFIBS[FIBSUser]).tqarg(infoFIBS[FIBSHost]);
else
text = i18n("Enter the password for the login %1 on the server %2.\n\n").
- arg(infoFIBS[FIBSUser]).arg(infoFIBS[FIBSHost]);
+ tqarg(infoFIBS[FIBSUser]).tqarg(infoFIBS[FIBSHost]);
first = true;
do {
@@ -1130,7 +1130,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin)
first = false;
}
- } while (ret && (msg.isEmpty() || msg.contains(' ') || msg.contains(':')));
+ } while (ret && (msg.isEmpty() || msg.tqcontains(' ') || msg.tqcontains(':')));
if (ret)
infoFIBS[FIBSPswd] = msg;
@@ -1234,7 +1234,7 @@ void KBgEngineFIBS::initPattern()
pat[RejAcpt] = TQRegExp("Type 'accept' or 'reject'\\.$");
pat[YouAcpt] = TQRegExp("^You accept the double\\. The cube shows [0-9]+\\.");
- pat[KeepAlv] = TQRegExp("^\\*\\* Unknown command: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'");
+ pat[KeepAlv] = TQRegExp("^\\*\\* Unknown command: 'ABCDEFGHIJKLMNOPTQRSTUVWXYZ'");
pat[RatingY] = TQRegExp("You'll see how the rating changes are calculated\\.$");
pat[RatingN] = TQRegExp("You won't see how the rating changes are calculated\\.$");
@@ -1281,15 +1281,15 @@ void KBgEngineFIBS::handleServerData(TQString &line)
/*
* Fix-up any HTML-like tags in the line
*/
- line.replace(pat[HTML_lt], "&lt;");
- line.replace(pat[HTML_gt], "&gt;");
+ line.tqreplace(pat[HTML_lt], "&lt;");
+ line.tqreplace(pat[HTML_gt], "&gt;");
/*
* FIBS sometimes sends tabs, where it should send 8 spaces...
*/
- line.replace(pat[TabChar], " ");
+ line.tqreplace(pat[TabChar], " ");
- switch (rxStatus) {
+ switch (rxtqStatus) {
case RxConnect:
handleMessageConnect(line, rawline);
@@ -1344,8 +1344,8 @@ void KBgEngineFIBS::handleServerData(TQString &line)
void KBgEngineFIBS::handleMessageWhois(const TQString &line)
{
rxCollect += "<br>&nbsp;&nbsp;&nbsp;&nbsp;" + line;
- if (line.contains(pat[WhoisE1]) || line.contains(pat[WhoisE2])) {
- rxStatus = RxNormal;
+ if (line.tqcontains(pat[WhoisE1]) || line.tqcontains(pat[WhoisE2])) {
+ rxtqStatus = RxNormal;
emit infoText("<font color=\"darkgreen\">" + rxCollect + "<br></font>");
}
}
@@ -1356,9 +1356,9 @@ void KBgEngineFIBS::handleMessageWhois(const TQString &line)
void KBgEngineFIBS::handleMessageRating(const TQString &line)
{
rxCollect += "<br>" + line;
- if (line.contains(pat[EndRate]) && ++rxCount == 2) {
+ if (line.tqcontains(pat[EndRate]) && ++rxCount == 2) {
emit infoText("<font color=\"blue\">" + rxCollect + "<br></font>");
- rxStatus = RxNormal;
+ rxtqStatus = RxNormal;
}
}
@@ -1367,8 +1367,8 @@ void KBgEngineFIBS::handleMessageRating(const TQString &line)
*/
void KBgEngineFIBS::handleMessageMotd(const TQString &line)
{
- if (line.contains(pat[MotdEnd])) {
- rxStatus = RxNormal;
+ if (line.tqcontains(pat[MotdEnd])) {
+ rxtqStatus = RxNormal;
emit infoText("<font color=\"blue\"><pre>" + rxCollect + "</pre></font>");
/*
* just to be on the safe side, we set the value of boardstyle.
@@ -1378,9 +1378,9 @@ void KBgEngineFIBS::handleMessageMotd(const TQString &line)
emit serverString("set boardstyle 3");
} else {
TQString tline = line;
- tline.replace(pat[BoxHori], "<br><hr>");
- tline.replace(pat[BoxVer1], "");
- tline.replace(pat[BoxVer2], "");
+ tline.tqreplace(pat[BoxHori], "<br><hr>");
+ tline.tqreplace(pat[BoxVer1], "");
+ tline.tqreplace(pat[BoxVer2], "");
rxCollect += "<br>" + tline;
}
}
@@ -1393,14 +1393,14 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r
/*
* Two possibilities: either we are logged in or we sent bad password/login
*/
- if (line.contains("login:")) {
+ if (line.tqcontains("login:")) {
/*
* This can only happen if the password/login is wrong.
*/
if (rxCollect.isEmpty()) {
- rxStatus = RxIgnore;
+ rxtqStatus = RxIgnore;
int ret = KMessageBox::warningContinueCancel
- ((TQWidget *)parent(), i18n("There was a problem with "
+ ((TQWidget *)tqparent(), i18n("There was a problem with "
"your login and password. "
"You can reenter\n"
"your login and password and "
@@ -1411,9 +1411,9 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r
infoFIBS[FIBSUser] = "";
infoFIBS[FIBSPswd] = "";
login = true;
- connectFIBS(); // will reset the rxStatus
+ connectFIBS(); // will reset the rxtqStatus
} else {
- rxStatus = RxConnect;
+ rxtqStatus = RxConnect;
emit serverString("");
emit serverString("");
}
@@ -1428,14 +1428,14 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r
* Ok, we are logged in! Now receive personal information. These
* are completely useless but what the heck.
*/
- if (line.contains(pat[Welcome])) {
+ if (line.tqcontains(pat[Welcome])) {
char p[3][256];
time_t tmp;
// Using latin1() is okay, since the string comes from FIBS.
int words = sscanf (line.latin1(), "%255s%255s%li%255s", p[0], p[1], &tmp, p[2]);
if (words >= 4) {
TQDateTime d; d.setTime_t(tmp);
- TQString text = i18n("%1, last logged in from %2 at %3.").arg(p[1]).arg(p[2]).arg(d.toString());
+ TQString text = i18n("%1, last logged in from %2 at %3.").tqarg(p[1]).tqarg(p[2]).tqarg(d.toString());
emit infoText("<hr><br>" + text);
playerlist->setName(p[1]);
}
@@ -1471,9 +1471,9 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r
* p[3] - timezone
*
*/
- if (line.contains(pat[OwnInfo])) {
+ if (line.tqcontains(pat[OwnInfo])) {
- rxStatus = RxNormal;
+ rxtqStatus = RxNormal;
int fibsOptions[NumFIBSOpt];
@@ -1537,8 +1537,8 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r
/*
* The beginning of a new login procedure starts starts here
*/
- if (line.contains(pat[OneName])) {
- rxStatus = RxNewLogin;
+ if (line.tqcontains(pat[OneName])) {
+ rxtqStatus = RxNewLogin;
emit infoText(TQString("<font color=\"red\">") + rxCollect + "</font>");
rxCollect = "";
TQString tmp = rawline;
@@ -1560,26 +1560,26 @@ void KBgEngineFIBS::handleMessageNewLogin(const TQString &line)
/*
* Request the new login
*/
- if (line.contains(pat[OneName])) {
+ if (line.tqcontains(pat[OneName])) {
emit serverString(TQString("name ") + infoFIBS[FIBSUser]);
return;
}
/*
* Ooops, user name already exists
*/
- if (line.contains(pat[OthrNam])) {
+ if (line.tqcontains(pat[OthrNam])) {
TQString text = i18n("The selected login is alreay in use! Please select another one.");
bool ret, first = true;
TQString msg;
do {
msg = (KLineEditDlg::getText(text, infoFIBS[FIBSUser], &ret,
- (TQWidget *)parent())).stripWhiteSpace();
+ (TQWidget *)tqparent())).stripWhiteSpace();
if (first) {
text += i18n("\n\nThe login may not contain spaces or colons!");
first = false;
}
- } while (msg.contains(' ') || msg.contains(':'));
+ } while (msg.tqcontains(' ') || msg.tqcontains(':'));
if (ret) {
infoFIBS[FIBSUser] = msg;
@@ -1592,28 +1592,28 @@ void KBgEngineFIBS::handleMessageNewLogin(const TQString &line)
/*
* first time we send the password
*/
- if (line.contains(pat[YourNam])) {
+ if (line.tqcontains(pat[YourNam])) {
emit serverString(infoFIBS[FIBSPswd]);
return;
}
/*
* second time we send the password
*/
- if (line.contains(pat[GivePwd])) {
+ if (line.tqcontains(pat[GivePwd])) {
emit serverString(infoFIBS[FIBSPswd]);
return;
}
/*
* at this point we are done creating the account
*/
- if (line.contains(pat[RetypeP])) {
+ if (line.tqcontains(pat[RetypeP])) {
TQString text = i18n("Your account has been created. Your new login is <u>%1</u>. To fully activate "
"this account, I will now close the connection. Once you reconnect, you can start "
- "playing backgammon on FIBS.").arg(infoFIBS[FIBSUser]);
+ "playing backgammon on FIBS.").tqarg(infoFIBS[FIBSUser]);
emit infoText("<br><hr><font color=\"blue\">" + text + "</font><br><hr>");
emit serverString("bye");
- rxStatus = RxNormal;
+ rxtqStatus = RxNormal;
rxCollect = "";
return;
}
@@ -1632,7 +1632,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* For now, the waves are ignored. They should probably go into
* the chat window -- but only optional
*/
- if (line.contains(pat[OneWave]) || line.contains(pat[TwoWave]) || line.contains(pat[YouWave])) {
+ if (line.tqcontains(pat[OneWave]) || line.tqcontains(pat[TwoWave]) || line.tqcontains(pat[YouWave])) {
return;
}
@@ -1642,8 +1642,8 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* ever gets a games window, they should be in there. For now, they
* are ignored.
*/
- else if (line.contains(pat[GameBG1]) || line.contains(pat[GameBG2]) || line.contains(pat[GameRE1]) ||
- line.contains(pat[GameRE2]) || line.contains(pat[GameEnd])) {
+ else if (line.tqcontains(pat[GameBG1]) || line.tqcontains(pat[GameBG2]) || line.tqcontains(pat[GameRE1]) ||
+ line.tqcontains(pat[GameRE2]) || line.tqcontains(pat[GameEnd])) {
return;
}
@@ -1651,7 +1651,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Artefact caused by the login test procedure utilized.
*/
- else if (line.contains(pat[NoLogin])) {
+ else if (line.tqcontains(pat[NoLogin])) {
return;
}
@@ -1659,7 +1659,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Connection keep-alive response
*/
- else if (line.contains(pat[KeepAlv])) {
+ else if (line.tqcontains(pat[KeepAlv])) {
return;
}
@@ -1670,10 +1670,10 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* Chat and personal messages - note that the chat window sends these messages
* back to us so we can display them if the user wants that.
*/
- else if (line.contains(pat[ChatSay]) || line.contains(pat[ChatSht]) || line.contains(pat[ChatWis]) ||
- line.contains(pat[ChatKib]) || line.contains(pat[SelfSay]) || line.contains(pat[SelfSht]) ||
- line.contains(pat[SelfWis]) || line.contains(pat[SelfKib]) || line.contains(pat[SelfSlf]) ||
- line.contains(pat[MsgPers]) || line.contains(pat[MsgDeli]) || line.contains(pat[MsgSave])) {
+ else if (line.tqcontains(pat[ChatSay]) || line.tqcontains(pat[ChatSht]) || line.tqcontains(pat[ChatWis]) ||
+ line.tqcontains(pat[ChatKib]) || line.tqcontains(pat[SelfSay]) || line.tqcontains(pat[SelfSht]) ||
+ line.tqcontains(pat[SelfWis]) || line.tqcontains(pat[SelfKib]) || line.tqcontains(pat[SelfSlf]) ||
+ line.tqcontains(pat[MsgPers]) || line.tqcontains(pat[MsgDeli]) || line.tqcontains(pat[MsgSave])) {
emit chatMessage(line);
return;
@@ -1684,12 +1684,12 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Beginning of games. In all these cases we are playing and not watching.
*/
- else if (line.contains(pat[MatchB1]) || line.contains(pat[MatchB2])) {
+ else if (line.tqcontains(pat[MatchB1]) || line.tqcontains(pat[MatchB2])) {
if (useAutoMsg[MsgBeg] && !autoMsg[MsgBeg].stripWhiteSpace().isEmpty())
emit serverString("kibitz " + autoMsg[MsgBeg]);
}
- else if (line.contains(pat[MatchB3]) || line.contains(pat[MatchB4])) {
+ else if (line.tqcontains(pat[MatchB3]) || line.tqcontains(pat[MatchB4])) {
if (useAutoMsg[MsgBeg] && !autoMsg[MsgBeg].stripWhiteSpace().isEmpty())
emit serverString("kibitz " + autoMsg[MsgBeg]);
@@ -1702,7 +1702,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* The help should be handled separately. A fairly complete implementation of a
* help parsing can be found in KFibs.
*/
- else if (line.contains(pat[HelpTxt])) {
+ else if (line.tqcontains(pat[HelpTxt])) {
// do nothing
}
@@ -1712,12 +1712,12 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Simple cases without the need for many comments...
*/
- else if (line.contains(pat[RawBord])) {
+ else if (line.tqcontains(pat[RawBord])) {
/*
* Save the board string and create a new game state
*/
- KBgStatus *st = new KBgStatus(currBoard = rawline);
+ KBgtqStatus *st = new KBgtqStatus(currBoard = rawline);
/*
* Save important state data and stop the timeout
@@ -1736,15 +1736,15 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* Update the caption string
*/
if (st->turn() < 0)
- caption = i18n("%1 (%2) vs. %3 (%4) - game over").arg(pname[US]).
- arg(st->points(US)).arg(pname[THEM]).arg(st->points(THEM));
+ caption = i18n("%1 (%2) vs. %3 (%4) - game over").tqarg(pname[US]).
+ tqarg(st->points(US)).tqarg(pname[THEM]).tqarg(st->points(THEM));
else if (st->length() < 0)
- caption = i18n("%1 (%2) vs. %3 (%4) - unlimited match").arg(pname[US]).
- arg(st->points(US)).arg(pname[THEM]).arg(st->points(THEM));
+ caption = i18n("%1 (%2) vs. %3 (%4) - unlimited match").tqarg(pname[US]).
+ tqarg(st->points(US)).tqarg(pname[THEM]).tqarg(st->points(THEM));
else
- caption = i18n("%1 (%2) vs. %3 (%4) - %5 point match").arg(pname[US]).
- arg(st->points(US)).arg(pname[THEM]).arg(st->points(THEM)).
- arg(st->length());
+ caption = i18n("%1 (%2) vs. %3 (%4) - %5 point match").tqarg(pname[US]).
+ tqarg(st->points(US)).tqarg(pname[THEM]).tqarg(st->points(THEM)).
+ tqarg(st->length());
emit statText(caption);
@@ -1766,7 +1766,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
return;
}
- else if (line.contains(pat[PlsMove]) || line.contains(pat[YouMove])) {
+ else if (line.tqcontains(pat[PlsMove]) || line.tqcontains(pat[YouMove])) {
KNotifyClient::event("move", i18n("Please make your move"));
@@ -1777,15 +1777,15 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Being away and coming back
*/
- else if (line.contains(pat[YouAway])) {
+ else if (line.tqcontains(pat[YouAway])) {
- emit changePlayerStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, true);
+ emit changePlayertqStatus(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])) {
+ else if (line.tqcontains(pat[YouBack])) {
- emit changePlayerStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, false);
+ emit changePlayertqStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, false);
actBack->setEnabled(false);
actAway->setEnabled(true);
}
@@ -1795,7 +1795,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Catch the response of the user responding to double or resign
*/
- else if (line.contains(pat[YouGive]) || line.contains(pat[RejCont]) || line.contains(pat[AcptWin])) {
+ else if (line.tqcontains(pat[YouGive]) || line.tqcontains(pat[RejCont]) || line.tqcontains(pat[AcptWin])) {
actAccept->setEnabled(false);
actReject->setEnabled(false);
@@ -1806,20 +1806,20 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Catch the responses to newly set toggles
*/
- else if (line.contains(pat[GreedyY]) || line.contains(pat[GreedyN])) {
+ else if (line.tqcontains(pat[GreedyY]) || line.tqcontains(pat[GreedyN])) {
- fibsOpt[OptGreedy]->setChecked(line.contains(pat[GreedyY]));
+ fibsOpt[OptGreedy]->setChecked(line.tqcontains(pat[GreedyY]));
line = "<font color=\"red\">" + line + "</font>";
}
- else if (line.contains(pat[DoubleY]) || line.contains(pat[DoubleN])) {
+ else if (line.tqcontains(pat[DoubleY]) || line.tqcontains(pat[DoubleN])) {
- fibsOpt[OptDouble]->setChecked(line.contains(pat[DoubleY]));
+ fibsOpt[OptDouble]->setChecked(line.tqcontains(pat[DoubleY]));
line = "<font color=\"red\">" + line + "</font>";
}
- else if (line.contains(pat[RatingY]) || line.contains(pat[RatingN])) {
+ else if (line.tqcontains(pat[RatingY]) || line.tqcontains(pat[RatingN])) {
- fibsOpt[OptRatings]->setChecked(line.contains(pat[RatingY]));
+ fibsOpt[OptRatings]->setChecked(line.tqcontains(pat[RatingY]));
line = "<font color=\"red\">" + line + "</font>";
}
@@ -1828,7 +1828,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* It's our turn to roll or double
*/
- else if (line.contains(pat[YouTurn]) || line.contains(pat[YouRoll])) {
+ else if (line.tqcontains(pat[YouTurn]) || line.tqcontains(pat[YouRoll])) {
emit allowCommand(Cube, playing);
emit allowCommand(Roll, playing);
@@ -1843,17 +1843,17 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Got an invitation for a match
*/
- else if (line.contains(pat[Invite0]) || line.contains(pat[Invite2]) || line.contains(pat[Invite3])) {
+ else if (line.tqcontains(pat[Invite0]) || line.tqcontains(pat[Invite2]) || line.tqcontains(pat[Invite3])) {
- rxCollect = rawline.left(rawline.find(' '));
+ rxCollect = rawline.left(rawline.tqfind(' '));
emit serverString("rawwho " + rxCollect);
- if (line.contains(pat[Invite0])) {
- rawline.replace(pat[Invite1], "");
- rawline = rxCollect + " "+ rawline.left(rawline.find(' '));
- } else if (line.contains(pat[Invite2])) {
+ if (line.tqcontains(pat[Invite0])) {
+ rawline.tqreplace(pat[Invite1], "");
+ rawline = rxCollect + " "+ rawline.left(rawline.tqfind(' '));
+ } else if (line.tqcontains(pat[Invite2])) {
rawline = rxCollect + " r";
- } else if (line.contains(pat[Invite3])) {
+ } else if (line.tqcontains(pat[Invite3])) {
invitations += rxCollect + " u";
}
invitations += rawline;
@@ -1862,24 +1862,24 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
// - rx status changes ------------------------------------------------------------
- else if (line.contains(pat[WhoisBG])) {
- rxStatus = RxWhois;
+ else if (line.tqcontains(pat[WhoisBG])) {
+ rxtqStatus = RxWhois;
rxCollect = TQString("<br><u>") + line + "</u>";
return;
}
- else if (line.contains(pat[MotdBeg])) {
- rxStatus = RxMotd;
+ else if (line.tqcontains(pat[MotdBeg])) {
+ rxtqStatus = RxMotd;
rxCollect = "";
return;
}
- else if (line.contains(pat[BegRate])) {
- rxStatus = RxRating;
+ else if (line.tqcontains(pat[BegRate])) {
+ rxtqStatus = RxRating;
rxCount = 0;
rxCollect = "<br>" + line;
return;
}
- else if (line.contains(pat[Goodbye])) {
- rxStatus = RxGoodbye;
+ else if (line.tqcontains(pat[Goodbye])) {
+ rxtqStatus = RxGoodbye;
rxCollect = "<br><hr><br>";
handleServerData(rawline); // danger: recursion!
return;
@@ -1893,7 +1893,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Continue a mutli game match? We have to either leave or continue
*/
- else if (line.contains(pat[ConLeav])) {
+ else if (line.tqcontains(pat[ConLeav])) {
actConti->setEnabled(true);
actLeave->setEnabled(true);
line.append("<br><pre> </pre>" + i18n("(or use the corresponding menu "
@@ -1902,9 +1902,9 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Beginning and end of user updates
*/
- else if (line.contains(pat[WhoInfo])) {
- rawline.replace(pat[WhoInfo], "");
- if (rawline.contains(TQRegExp("^" + infoFIBS[FIBSUser] + " "))) {
+ else if (line.tqcontains(pat[WhoInfo])) {
+ rawline.tqreplace(pat[WhoInfo], "");
+ if (rawline.tqcontains(TQRegExp("^" + infoFIBS[FIBSUser] + " "))) {
int ready;
// Using latin1() is fine, since the string is coming from FIBS.
sscanf(rawline.latin1(), "%*s %*s %*s %i %*s %*s %*s %*s %*s %*s %*s %*s", &ready);
@@ -1913,7 +1913,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
emit fibsWhoInfo(rawline);
return;
}
- else if (line.contains(pat[WhoEnde])) {
+ else if (line.tqcontains(pat[WhoEnde])) {
emit fibsWhoEnd();
return;
}
@@ -1921,43 +1921,43 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* This message is ignored. The instruction is given elsewhere (and slightly
* delayed in the flow of time).
*/
- if (line.contains(pat[TypJoin])) {
+ if (line.tqcontains(pat[TypJoin])) {
return;
}
/*
* Watching other players
*/
- else if (line.contains(pat[BegWtch])) {
+ else if (line.tqcontains(pat[BegWtch])) {
emit allowCommand(Load, true);
- rawline.replace(pat[BegWtch], "");
+ rawline.tqreplace(pat[BegWtch], "");
rawline.truncate(rawline.length()-1);
emit fibsStartNewGame(rawline);
load();
}
- else if (line.contains(pat[EndWtch])) {
+ else if (line.tqcontains(pat[EndWtch])) {
emit gameOver();
}
/*
* Blinding of players, the actual blind is handled by
* the player list
*/
- else if (line.contains(pat[BegBlnd])) {
- rawline.replace(pat[BegBlnd], "");
+ else if (line.tqcontains(pat[BegBlnd])) {
+ rawline.tqreplace(pat[BegBlnd], "");
rawline.truncate(rawline.length()-1);
- emit changePlayerStatus(rawline, KFibsPlayerList::Blind, true);
+ emit changePlayertqStatus(rawline, KFibsPlayerList::Blind, true);
line = "<font color=\"red\">" + line + "</font>";
}
- else if (line.contains(pat[EndBlnd])) {
- rawline.replace(pat[EndBlnd], "");
+ else if (line.tqcontains(pat[EndBlnd])) {
+ rawline.tqreplace(pat[EndBlnd], "");
rawline.truncate(rawline.length()-1);
- emit changePlayerStatus(rawline, KFibsPlayerList::Blind, false);
+ emit changePlayertqStatus(rawline, KFibsPlayerList::Blind, false);
line = "<font color=\"red\">" + line + "</font>";
}
/*
* Starting or reloading games or matches
*/
- else if (line.contains(pat[BegGame])) {
- rawline.replace(pat[BegGame], "");
+ else if (line.tqcontains(pat[BegGame])) {
+ rawline.tqreplace(pat[BegGame], "");
rawline.truncate(rawline.length()-1);
emit fibsStartNewGame(rawline);
fibsOpt[OptDouble]->setChecked(true);
@@ -1965,9 +1965,9 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
actConti->setEnabled(false);
actLeave->setEnabled(false);
}
- else if (line.contains(pat[Reload1])) {
- rawline.replace(pat[Reload1], "");
- rawline = rawline.left(rawline.find(' '));
+ else if (line.tqcontains(pat[Reload1])) {
+ rawline.tqreplace(pat[Reload1], "");
+ rawline = rawline.left(rawline.tqfind(' '));
rawline.truncate(rawline.length()-1);
emit fibsStartNewGame(rawline);
fibsOpt[OptDouble]->setChecked(true);
@@ -1976,8 +1976,8 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
actLeave->setEnabled(false);
load();
}
- else if (line.contains(pat[Reload2])) {
- rawline.replace(pat[Reload2], "");
+ else if (line.tqcontains(pat[Reload2])) {
+ rawline.tqreplace(pat[Reload2], "");
emit fibsStartNewGame(rawline);
fibsOpt[OptDouble]->setChecked(true);
fibsOpt[OptGreedy]->setChecked(false);
@@ -1989,7 +1989,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* Opponent offered resignation or the cube. We have to accept
* or reject the offer.
*/
- else if (line.contains(pat[RejAcpt])) {
+ else if (line.tqcontains(pat[RejAcpt])) {
actAccept->setEnabled(true);
actReject->setEnabled(true);
line += "<br><pre> </pre>" + i18n("(or use the corresponding menu "
@@ -1999,10 +1999,10 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* This is strange: FIBS seems to not send a newline at the
* end of this pattern. So we work around that.
*/
- else if (line.contains(pat[YouAcpt])) {
+ else if (line.tqcontains(pat[YouAcpt])) {
actAccept->setEnabled(false);
actReject->setEnabled(false);
- rawline.replace(pat[YouAcpt], "");
+ rawline.tqreplace(pat[YouAcpt], "");
line.truncate(line.length()-rawline.length());
if (!rawline.stripWhiteSpace().isEmpty()) {
handleServerData(rawline);
@@ -2011,7 +2011,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Ending of games
*/
- else if (line.contains(pat[EndLose])) {
+ else if (line.tqcontains(pat[EndLose])) {
if (playing) {
KNotifyClient::event("game over l", i18n("Sorry, you lost the game."));
if (useAutoMsg[MsgLos] && !autoMsg[MsgLos].stripWhiteSpace().isEmpty())
@@ -2019,7 +2019,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
}
emit gameOver();
}
- else if (line.contains(pat[EndVict])) {
+ else if (line.tqcontains(pat[EndVict])) {
if (playing) {
KNotifyClient::event("game over w", i18n("Congratulations, you won the game!"));
if (useAutoMsg[MsgWin] && !autoMsg[MsgWin].stripWhiteSpace().isEmpty())
@@ -2027,24 +2027,24 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
}
emit gameOver();
}
- else if (line.contains(pat[GameSav])) {
+ else if (line.tqcontains(pat[GameSav])) {
emit gameOver();
}
/*
* User logs out. This has to be signalled to the player
* list. Get the true user names by working on the rawline.
*/
- else if (line.contains(pat[UserLot])) {
- rawline.replace(pat[UserLot], "");
- emit fibsLogout(rawline.left(rawline.find(' ')));
+ else if (line.tqcontains(pat[UserLot])) {
+ rawline.tqreplace(pat[UserLot], "");
+ emit fibsLogout(rawline.left(rawline.tqfind(' ')));
return;
}
/*
* Emit the name of the newly logged in user.
*/
- else if (line.contains(pat[UserLin])) {
- rawline.replace(pat[UserLin], "");
- emit fibsLogin(rawline.left(rawline.find(' ')));
+ else if (line.tqcontains(pat[UserLin])) {
+ rawline.tqreplace(pat[UserLin], "");
+ emit fibsLogin(rawline.left(rawline.tqfind(' ')));
return;
}
/*
@@ -2052,11 +2052,11 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* the 'boardstyle' variable, since we will not be able to display
* the board properly without it.
*/
- else if (line.contains(pat[BoardSY])) {
+ else if (line.tqcontains(pat[BoardSY])) {
// ignored
return;
}
- else if (line.contains(pat[BoardSN])) {
+ else if (line.tqcontains(pat[BoardSN])) {
emit serverString("set boardstyle 3");
emit infoText(TQString("<font color=\"red\"><br>")
+ i18n("You should never set the 'boardstyle' variable "
@@ -2071,7 +2071,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* hasn't been processed, make it red, since it is a server resp.
* to something we just did.
*/
- else if (line.contains(pat[TwoStar])) {
+ else if (line.tqcontains(pat[TwoStar])) {
line = "<font color=\"red\">" + line + "</font>";
}
@@ -2091,13 +2091,13 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/*
* Constructor
*/
-KBgEngineFIBS::KBgEngineFIBS(TQWidget *parent, TQString *name, TQPopupMenu *pmenu)
- : KBgEngine(parent, name, pmenu)
+KBgEngineFIBS::KBgEngineFIBS(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu)
+ : KBgEngine(tqparent, name, pmenu)
{
/*
* No connection, not playing, ready for login
*/
- connection = new TQSocket(parent, "fibs connection");
+ connection = new TQSocket(TQT_TQOBJECT(tqparent), "fibs connection");
playing = false;
login = true;
@@ -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(changePlayerStatus(const TQString &, int, bool)),
- playerlist, TQT_SLOT(changePlayerStatus(const TQString &, int, bool)));
+ connect(this, TQT_SIGNAL(changePlayertqStatus(const TQString &, int, bool)),
+ playerlist, TQT_SLOT(changePlayertqStatus(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 b46ae3a2..d044c642 100644
--- a/kbackgammon/engines/fibs/kbgfibs.h
+++ b/kbackgammon/engines/fibs/kbgfibs.h
@@ -60,13 +60,14 @@ class KToggleAction;
class KBgEngineFIBS : public KBgEngine
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor
*/
- KBgEngineFIBS(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0);
+ KBgEngineFIBS(TQWidget *tqparent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0);
/**
* Destructor
@@ -174,7 +175,7 @@ signals:
void fibsConnectionClosed();
- void changePlayerStatus(const TQString &, int, bool);
+ void changePlayertqStatus(const TQString &, int, bool);
void chatMessage(const TQString &msg);
@@ -198,7 +199,7 @@ private:
TQString currBoard, caption;
- //KBgStatus *currBoard
+ //KBgtqStatus *currBoard
//KBgFIBSBoard *boardHandler;
TQStringList invitations;
@@ -399,10 +400,10 @@ protected slots:
protected:
- enum RxStatus {RxIgnore, RxConnect, RxWhois, RxMotd, RxRating,
+ enum RxtqStatus {RxIgnore, RxConnect, RxWhois, RxMotd, RxRating,
RxNewLogin, RxGoodbye, RxNormal};
- int rxStatus, rxCount;
+ int rxtqStatus, rxCount;
TQString rxCollect;
diff --git a/kbackgammon/engines/fibs/kbgfibschat.cpp b/kbackgammon/engines/fibs/kbgfibschat.cpp
index 7b34bae0..c1eca59d 100644
--- a/kbackgammon/engines/fibs/kbgfibschat.cpp
+++ b/kbackgammon/engines/fibs/kbgfibschat.cpp
@@ -63,7 +63,7 @@
* Private utility class that might become more generally useful in
* the future. Basically, it implements rich text TQListBox items.
*/
-class KLBT : public QListBoxText
+class KLBT : public TQListBoxText
{
public:
@@ -71,10 +71,10 @@ public:
/*
* Constructor
*/
- KLBT(TQWidget *parent, const TQString &text = TQString::null, const TQString &player = TQString::null)
+ KLBT(TQWidget *tqparent, const TQString &text = TQString(), const TQString &player = TQString())
: TQListBoxText(text)
{
- w = parent;
+ w = tqparent;
n = new TQString(player);
t = new TQSimpleRichText(text, w->font());
@@ -123,7 +123,7 @@ protected:
*/
virtual void paint(TQPainter *p)
{
- t->draw(p, 1, 1, TQRegion(p->viewport()), w->colorGroup());
+ t->draw(p, 1, 1, TQRegion(p->viewport()), w->tqcolorGroup());
}
private:
@@ -189,18 +189,18 @@ public:
/*
* Constructor of the chat window.
*/
-KBgChat::KBgChat(TQWidget *parent, const char *name)
- : KChat(parent, false)
+KBgChat::KBgChat(TQWidget *tqparent, const char *name)
+ : KChat(tqparent, false)
{
d = new KBgChatPrivate();
KActionCollection* actions = new KActionCollection(this);
- d->mName[0] = TQString::null;
+ d->mName[0] = TQString();
d->mChat = 0;
d->mInvt = new TQPopupMenu();
setAutoAddMessages(false); // we get an echo from FIBS
- setFromNickname(i18n("%1 user").arg(PROG_NAME));
+ setFromNickname(i18n("%1 user").tqarg(PROG_NAME));
if (!addSendingEntry(i18n("Kibitz to watchers and players"), CLIP_YOU_KIBITZ))
kdDebug(10500) << "adding kibitz" << endl;
@@ -233,31 +233,31 @@ KBgChat::KBgChat(TQWidget *parent, const char *name)
d->mAct[KBgChatPrivate::Inquire] = new KAction(i18n("Info On"),
TQIconSet(kapp->iconLoader()->loadIcon(
"help.xpm", KIcon::Small)),
- 0, this, TQT_SLOT(slotInquire()), actions);
+ 0, TQT_TQOBJECT(this), TQT_SLOT(slotInquire()), actions);
d->mAct[KBgChatPrivate::Talk] = new KAction(i18n("Talk To"),
TQIconSet(kapp->iconLoader()->loadIcon(
PROG_NAME "-chat.png", KIcon::Small)),
- 0, this, TQT_SLOT(slotTalk()), actions);
+ 0, TQT_TQOBJECT(this), TQT_SLOT(slotTalk()), actions);
- d->mAct[KBgChatPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, this,
+ d->mAct[KBgChatPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInviteD()), actions);
- d->mAct[KBgChatPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, this,
+ d->mAct[KBgChatPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInvite1()), actions);
- d->mAct[KBgChatPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, this,
+ d->mAct[KBgChatPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInvite2()), actions);
- d->mAct[KBgChatPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, this,
+ d->mAct[KBgChatPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInvite3()), actions);
- d->mAct[KBgChatPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, this,
+ d->mAct[KBgChatPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInvite4()), actions);
- d->mAct[KBgChatPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, this,
+ d->mAct[KBgChatPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInvite5()), actions);
- d->mAct[KBgChatPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, this,
+ d->mAct[KBgChatPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInvite6()), actions);
- d->mAct[KBgChatPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, this,
+ d->mAct[KBgChatPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInvite7()), actions);
- d->mAct[KBgChatPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, this,
+ d->mAct[KBgChatPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInviteU()), actions);
- d->mAct[KBgChatPrivate::InviteR] = new KAction(i18n("Resume"), 0, this,
+ d->mAct[KBgChatPrivate::InviteR] = new KAction(i18n("Resume"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInviteR()), actions);
d->mAct[KBgChatPrivate::InviteD]->plug(d->mInvt);
@@ -277,13 +277,13 @@ KBgChat::KBgChat(TQWidget *parent, const char *name)
d->mAct[KBgChatPrivate::InviteU]->plug(d->mInvt);
d->mAct[KBgChatPrivate::InviteR]->plug(d->mInvt);
- d->mAct[KBgChatPrivate::Gag] = new KAction(i18n("Gag"), 0, this, TQT_SLOT(slotGag()), actions);
- d->mAct[KBgChatPrivate::Ungag] = new KAction(i18n("Ungag"), 0, this, TQT_SLOT(slotUngag()), actions);
- d->mAct[KBgChatPrivate::Cleargag] = new KAction(i18n("Clear Gag List"), 0, this, TQT_SLOT(slotCleargag()), actions);
- d->mAct[KBgChatPrivate::Copy] = KStdAction::copy(this, TQT_SLOT(slotCopy()), actions);
- d->mAct[KBgChatPrivate::Clear] = new KAction(i18n("Clear"), 0, this, TQT_SLOT(slotClear()), actions);
- d->mAct[KBgChatPrivate::Close] = KStdAction::close(this, TQT_SLOT(hide()), actions);
- d->mAct[KBgChatPrivate::Silent] = new KToggleAction(i18n("Silent"), 0, this, TQT_SLOT(slotSilent()), actions);
+ d->mAct[KBgChatPrivate::Gag] = new KAction(i18n("Gag"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotGag()), actions);
+ d->mAct[KBgChatPrivate::Ungag] = new KAction(i18n("Ungag"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotUngag()), actions);
+ d->mAct[KBgChatPrivate::Cleargag] = new KAction(i18n("Clear Gag List"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotCleargag()), actions);
+ d->mAct[KBgChatPrivate::Copy] = KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(slotCopy()), actions);
+ d->mAct[KBgChatPrivate::Clear] = new KAction(i18n("Clear"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotClear()), actions);
+ d->mAct[KBgChatPrivate::Close] = KStdAction::close(TQT_TQOBJECT(this), TQT_SLOT(hide()), actions);
+ d->mAct[KBgChatPrivate::Silent] = new KToggleAction(i18n("Silent"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotSilent()), actions);
}
@@ -416,7 +416,7 @@ void KBgChat::setupDefault()
/*
* Overloaded member to create a TQListBoxItem for the chat window.
*/
-TQListBoxItem* KBgChat::layoutMessage(const TQString& fromName, const TQString& text)
+TQListBoxItem* KBgChat::tqlayoutMessage(const TQString& fromName, const TQString& text)
{
TQListBoxText* message = new KLBT(this, text, fromName);
return message;
@@ -446,11 +446,11 @@ void KBgChat::hideEvent(TQHideEvent *e)
*/
void KBgChat::startGame(const TQString &name)
{
- int *id = d->mName2ID->find(d->mName[1] = name);
+ int *id = d->mName2ID->tqfind(d->mName[1] = name);
if (!id) {
id = new int(nextId());
d->mName2ID->insert(name, id);
- addSendingEntry(i18n("Talk to %1").arg(name), *id);
+ addSendingEntry(i18n("Talk to %1").tqarg(name), *id);
}
setSendingEntry(CLIP_YOU_KIBITZ);
}
@@ -460,7 +460,7 @@ void KBgChat::startGame(const TQString &name)
*/
void KBgChat::endGame()
{
- int *id = d->mName2ID->find(d->mName[1]);
+ int *id = d->mName2ID->tqfind(d->mName[1]);
if (id)
setSendingEntry(*id);
else
@@ -472,11 +472,11 @@ void KBgChat::endGame()
*/
void KBgChat::fibsTalk(const TQString &name)
{
- int *id = d->mName2ID->find(name);
+ int *id = d->mName2ID->tqfind(name);
if (!id) {
id = new int(nextId());
d->mName2ID->insert(name, id);
- addSendingEntry(i18n("Talk to %1").arg(name), *id);
+ addSendingEntry(i18n("Talk to %1").tqarg(name), *id);
}
setSendingEntry(*id);
}
@@ -486,7 +486,7 @@ void KBgChat::fibsTalk(const TQString &name)
*/
void KBgChat::deletePlayer(const TQString &name)
{
- int *id = d->mName2ID->find(name);
+ int *id = d->mName2ID->tqfind(name);
if (id) {
removeSendingEntry(*id);
d->mName2ID->remove(name);
@@ -535,21 +535,21 @@ void KBgChat::handleCommand(int id, const TQString& msg)
*/
void KBgChat::handleData(const TQString &msg)
{
- TQString clip = msg.left(msg.find(' ')), user, cMsg = msg;
+ TQString clip = msg.left(msg.tqfind(' ')), user, cMsg = msg;
TQDateTime date;
bool flag = false;
int cmd = clip.toInt(&flag);
if (flag) {
- cMsg.replace(0, cMsg.find(' ')+1, "");
+ cMsg.tqreplace(0, cMsg.tqfind(' ')+1, "");
- user = cMsg.left(cMsg.find(' '));
+ user = cMsg.left(cMsg.tqfind(' '));
switch (cmd) {
case CLIP_SAYS:
- if (!d->mGag.contains(user)) {
- cMsg = i18n("<u>%1 tells you:</u> %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), ""));
+ if (!d->mGag.tqcontains(user)) {
+ cMsg = i18n("<u>%1 tells you:</u> %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), ""));
cMsg = "<font color=\"red\">" + cMsg + "</font>";
emit personalMessage(cMsg);
} else
@@ -557,16 +557,16 @@ void KBgChat::handleData(const TQString &msg)
break;
case CLIP_SHOUTS:
- if ((!((KToggleAction *)d->mAct[KBgChatPrivate::Silent])->isChecked()) && (!d->mGag.contains(user))) {
- cMsg = i18n("<u>%1 shouts:</u> %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), ""));
+ if ((!((KToggleAction *)d->mAct[KBgChatPrivate::Silent])->isChecked()) && (!d->mGag.tqcontains(user))) {
+ cMsg = i18n("<u>%1 shouts:</u> %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), ""));
cMsg = "<font color=\"black\">" + cMsg + "</font>";
} else
cMsg = "";
break;
case CLIP_WHISPERS:
- if (!d->mGag.contains(user)) {
- cMsg = i18n("<u>%1 whispers:</u> %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), ""));
+ if (!d->mGag.tqcontains(user)) {
+ cMsg = i18n("<u>%1 whispers:</u> %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), ""));
cMsg = "<font color=\"red\">" + cMsg + "</font>";
emit personalMessage(cMsg);
} else
@@ -574,8 +574,8 @@ void KBgChat::handleData(const TQString &msg)
break;
case CLIP_KIBITZES:
- if (!d->mGag.contains(user)) {
- cMsg = i18n("<u>%1 kibitzes:</u> %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), ""));
+ if (!d->mGag.tqcontains(user)) {
+ cMsg = i18n("<u>%1 kibitzes:</u> %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), ""));
cMsg = "<font color=\"red\">" + cMsg + "</font>";
emit personalMessage(cMsg);
} else
@@ -583,56 +583,56 @@ void KBgChat::handleData(const TQString &msg)
break;
case CLIP_YOU_SAY:
- cMsg = i18n("<u>You tell %1:</u> %2").arg(user).arg(cMsg.replace(TQRegExp("^" + user), ""));
+ cMsg = i18n("<u>You tell %1:</u> %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), ""));
cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>";
emit personalMessage(cMsg);
- user = TQString::null;
+ user = TQString();
break;
case CLIP_YOU_SHOUT:
- cMsg = i18n("<u>You shout:</u> %1").arg(cMsg);
+ cMsg = i18n("<u>You shout:</u> %1").tqarg(cMsg);
cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>";
emit personalMessage(cMsg);
- user = TQString::null;
+ user = TQString();
break;
case CLIP_YOU_WHISPER:
- cMsg = i18n("<u>You whisper:</u> %1").arg(cMsg);
+ cMsg = i18n("<u>You whisper:</u> %1").tqarg(cMsg);
cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>";
emit personalMessage(cMsg);
- user = TQString::null;
+ user = TQString();
break;
case CLIP_YOU_KIBITZ:
- cMsg = i18n("<u>You kibitz:</u> %1").arg(cMsg);
+ cMsg = i18n("<u>You kibitz:</u> %1").tqarg(cMsg);
cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>";
emit personalMessage(cMsg);
- user = TQString::null;
+ user = TQString();
break;
case CLIP_MESSAGE:
- user = cMsg.left(cMsg.find(' ')+1);
- cMsg.remove(0, cMsg.find(' ')+1);
- date.setTime_t(cMsg.left(cMsg.find(' ')+1).toUInt());
- cMsg.remove(0, cMsg.find(' '));
- cMsg = i18n("<u>User %1 left a message at %2</u>: %3").arg(user).arg(date.toString()).arg(cMsg);
+ user = cMsg.left(cMsg.tqfind(' ')+1);
+ cMsg.remove(0, cMsg.tqfind(' ')+1);
+ date.setTime_t(cMsg.left(cMsg.tqfind(' ')+1).toUInt());
+ cMsg.remove(0, cMsg.tqfind(' '));
+ cMsg = i18n("<u>User %1 left a message at %2</u>: %3").tqarg(user).tqarg(date.toString()).tqarg(cMsg);
cMsg = "<font color=\"red\">" + cMsg + "</font>";
emit personalMessage(cMsg);
- user = TQString::null;
+ user = TQString();
break;
case CLIP_MESSAGE_DELIVERED:
- cMsg = i18n("Your message for %1 has been delivered.").arg(user);
+ cMsg = i18n("Your message for %1 has been delivered.").tqarg(user);
cMsg = TQString("<font color=\"darkgreen\">") + cMsg + "</font>";
emit personalMessage(cMsg);
- user = TQString::null;
+ user = TQString();
break;
case CLIP_MESSAGE_SAVED:
- cMsg = i18n("Your message for %1 has been saved.").arg(user);
+ cMsg = i18n("Your message for %1 has been saved.").tqarg(user);
cMsg = TQString("<font color=\"darkgreen\">") + cMsg + "</font>";
emit personalMessage(cMsg);
- user = TQString::null;
+ user = TQString();
break;
default: // ignore the message
@@ -644,8 +644,8 @@ void KBgChat::handleData(const TQString &msg)
/*
* Special treatment for non-CLIP messages
*/
- if (cMsg.contains(TQRegExp("^You say to yourself: "))) {
- cMsg.replace(TQRegExp("^You say to yourself: "),
+ if (cMsg.tqcontains(TQRegExp("^You say to yourself: "))) {
+ cMsg.tqreplace(TQRegExp("^You say to yourself: "),
i18n("<u>You say to yourself:</u> "));
} else {
kdDebug(user.isNull(), 10500) << "KBgChat::handleData unhandled message: "
@@ -667,10 +667,10 @@ void KBgChat::handleData(const TQString &msg)
void KBgChat::contextMenu(TQListBoxItem *i, const TQPoint &p)
{
/*
- * Even if i is non-null, user might still be TQString::null
+ * Even if i is non-null, user might still be TQString()
*/
- d->mName[0] = (i == 0) ? TQString::null : ((KLBT *)i)->player();
- d->mText = (i == 0) ? TQString::null : ((KLBT *)i)->text();
+ d->mName[0] = (i == 0) ? TQString() : ((KLBT *)i)->player();
+ d->mText = (i == 0) ? TQString() : ((KLBT *)i)->text();
/*
* Get a new context menu every time. Safe to delete the 0
@@ -683,22 +683,22 @@ void KBgChat::contextMenu(TQListBoxItem *i, const TQPoint &p)
*/
if (!d->mName[0].isNull()) {
- d->mAct[KBgChatPrivate::Talk]->setText(i18n("Talk to %1").arg(d->mName[0]));
+ d->mAct[KBgChatPrivate::Talk]->setText(i18n("Talk to %1").tqarg(d->mName[0]));
d->mAct[KBgChatPrivate::Talk]->plug(d->mChat);
- d->mAct[KBgChatPrivate::Inquire]->setText(i18n("Info on %1").arg(d->mName[0]));
+ d->mAct[KBgChatPrivate::Inquire]->setText(i18n("Info on %1").tqarg(d->mName[0]));
d->mAct[KBgChatPrivate::Inquire]->plug(d->mChat);
// invite menu is always the same
- d->mChat->insertItem(i18n("Invite %1").arg(d->mName[0]), d->mInvt);
+ d->mChat->insertItem(i18n("Invite %1").tqarg(d->mName[0]), d->mInvt);
d->mChat->insertSeparator();
- if (d->mGag.contains(d->mName[0]) <= 0) {
- d->mAct[KBgChatPrivate::Gag]->setText(i18n("Gag %1").arg(d->mName[0]));
+ if (d->mGag.tqcontains(d->mName[0]) <= 0) {
+ d->mAct[KBgChatPrivate::Gag]->setText(i18n("Gag %1").tqarg(d->mName[0]));
d->mAct[KBgChatPrivate::Gag]->plug(d->mChat);
} else {
- d->mAct[KBgChatPrivate::Ungag]->setText(i18n("Ungag %1").arg(d->mName[0]));
+ d->mAct[KBgChatPrivate::Ungag]->setText(i18n("Ungag %1").tqarg(d->mName[0]));
d->mAct[KBgChatPrivate::Ungag]->plug(d->mChat);
}
}
@@ -730,7 +730,7 @@ void KBgChat::slotCleargag()
msg += i18n("The gag list is now empty.");
msg += "</font>";
- addMessage(TQString::null, msg);
+ addMessage(TQString(), msg);
}
/*
@@ -741,10 +741,10 @@ void KBgChat::slotGag()
d->mGag.append(d->mName[0]);
TQString msg("<font color=\"blue\">");
- msg += i18n("You won't hear what %1 says and shouts.").arg(d->mName[0]);
+ msg += i18n("You won't hear what %1 says and shouts.").tqarg(d->mName[0]);
msg += "</font>";
- addMessage(TQString::null, msg);
+ addMessage(TQString(), msg);
}
/*
@@ -763,10 +763,10 @@ void KBgChat::slotUngag()
d->mGag.remove(d->mName[0]);
TQString msg("<font color=\"blue\">");
- msg += i18n("You will again hear what %1 says and shouts.").arg(d->mName[0]);
+ msg += i18n("You will again hear what %1 says and shouts.").tqarg(d->mName[0]);
msg += "</font>";
- addMessage(TQString::null, msg);
+ addMessage(TQString(), msg);
}
/*
@@ -788,7 +788,7 @@ void KBgChat::slotSilent()
msg = "<font color=\"blue\">" + i18n("You will not hear what people shout.") + "</font>";
else
msg = "<font color=\"blue\">" + i18n("You will hear what people shout.") + "</font>";
- addMessage(TQString::null, msg);
+ addMessage(TQString(), msg);
}
/*
@@ -797,10 +797,10 @@ void KBgChat::slotSilent()
*/
void KBgChat::slotCopy()
{
- d->mText.replace(TQRegExp("<u>"), "");
- d->mText.replace(TQRegExp("</u>"), "");
- d->mText.replace(TQRegExp("</font>"), "");
- d->mText.replace(TQRegExp("^.*\">"), "");
+ d->mText.tqreplace(TQRegExp("<u>"), "");
+ d->mText.tqreplace(TQRegExp("</u>"), "");
+ d->mText.tqreplace(TQRegExp("</font>"), "");
+ d->mText.tqreplace(TQRegExp("^.*\">"), "");
kapp->clipboard()->setText(d->mText);
}
diff --git a/kbackgammon/engines/fibs/kbgfibschat.h b/kbackgammon/engines/fibs/kbgfibschat.h
index 5e1fefa4..7dc0cfaf 100644
--- a/kbackgammon/engines/fibs/kbgfibschat.h
+++ b/kbackgammon/engines/fibs/kbgfibschat.h
@@ -55,13 +55,14 @@ class KBgChatPrivate;
class KBgChat : public KChat
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor
*/
- KBgChat(TQWidget *parent = 0, const char *name = 0);
+ KBgChat(TQWidget *tqparent = 0, const char *name = 0);
/**
* Destructor
@@ -170,7 +171,7 @@ protected:
* Create a custom ListBoxItem that contains a formated string
* for the chat window.
*/
- virtual TQListBoxItem* layoutMessage(const TQString& fromName, const TQString& text);
+ virtual TQListBoxItem* tqlayoutMessage(const TQString& fromName, const TQString& text);
protected slots:
diff --git a/kbackgammon/engines/fibs/kbginvite.cpp b/kbackgammon/engines/fibs/kbginvite.cpp
index f43c3b6a..666ba4c5 100644
--- a/kbackgammon/engines/fibs/kbginvite.cpp
+++ b/kbackgammon/engines/fibs/kbginvite.cpp
@@ -75,7 +75,7 @@ KBgInvite::KBgInvite(const char *name)
hLine->setFrameStyle(TQFrame::Sunken|TQFrame::HLine);
/*
- * Set up layouts
+ * Set up tqlayouts
*/
TQBoxLayout *vbox = new TQVBoxLayout(this);
@@ -103,9 +103,9 @@ KBgInvite::KBgInvite(const char *name)
* Adjust widget sizes and resize the dialog
*/
KDialog::resizeLayout(this, marginHint(), spacingHint());
- setMinimumSize(childrenRect().size());
+ setMinimumSize(tqchildrenRect().size());
vbox->activate();
- resize(minimumSize());
+ resize(tqminimumSize());
/*
* Set focus and default buttons
diff --git a/kbackgammon/engines/fibs/kbginvite.h b/kbackgammon/engines/fibs/kbginvite.h
index 7bc5f3f7..4c33b169 100644
--- a/kbackgammon/engines/fibs/kbginvite.h
+++ b/kbackgammon/engines/fibs/kbginvite.h
@@ -46,6 +46,7 @@ class KBgInvitePrivate;
class KBgInvite : public KDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
diff --git a/kbackgammon/engines/fibs/kplayerlist.cpp b/kbackgammon/engines/fibs/kplayerlist.cpp
index 06b724e5..a928de7e 100644
--- a/kbackgammon/engines/fibs/kplayerlist.cpp
+++ b/kbackgammon/engines/fibs/kplayerlist.cpp
@@ -79,7 +79,7 @@ public:
/*
* Constructor
*/
- KFibsPlayerListLVI(KFibsPlayerList *parent) : KListViewItem(parent) { _plist = parent; }
+ KFibsPlayerListLVI(KFibsPlayerList *tqparent) : KListViewItem(tqparent) { _plist = tqparent; }
/*
* Destructor
@@ -101,7 +101,7 @@ public:
case KFibsPlayerList::Watches:
case KFibsPlayerList::Client:
case KFibsPlayerList::Email:
- case KFibsPlayerList::Status:
+ case KFibsPlayerList::tqStatus:
case KFibsPlayerList::Host:
s = s.lower();
break;
@@ -175,7 +175,7 @@ public:
/*
* Short abbreviations for Blind, Ready, and Away.
*/
- TQString mAbrv[KFibsPlayerList::MaxStatus];
+ TQString mAbrv[KFibsPlayerList::MaxtqStatus];
/*
* Name of the last selected player - for internal purposes
@@ -200,8 +200,8 @@ public:
/*
* Construct the playerlist and do some initial setup
*/
-KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name)
- : KListView(parent, name)
+KFibsPlayerList::KFibsPlayerList(TQWidget *tqparent, const char *name)
+ : KListView(tqparent, name)
{
d = new KFibsPlayerListPrivate();
KActionCollection* actions = new KActionCollection(this);
@@ -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[Status]->name = i18n("Status");
+ d->mCol[tqStatus]->name = i18n("tqStatus");
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[Status]->key = "status";
+ d->mCol[tqStatus]->key = "status";
d->mCol[Rating]->key = "rating";
d->mCol[Experience]->key = "experience";
d->mCol[Idle]->key = "idle";
@@ -246,7 +246,7 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name)
d->mAbrv[Away ] = i18n("abreviate away", "A");
d->mAbrv[Ready] = i18n("abreviate ready", "R");
- d->mName = TQString::null;
+ d->mName = TQString();
d->mWatch = false;
@@ -289,41 +289,41 @@ KFibsPlayerList::KFibsPlayerList(TQWidget *parent, const char *name)
d->mAct[KFibsPlayerListPrivate::Info] = new KAction(i18n("Info"),
TQIconSet(kapp->iconLoader()->loadIcon
("help.xpm", KIcon::Small)),
- 0, this, TQT_SLOT(slotInfo()), actions);
+ 0, TQT_TQOBJECT(this), TQT_SLOT(slotInfo()), actions);
d->mAct[KFibsPlayerListPrivate::Talk] = new KAction(i18n("Talk"),
TQIconSet(kapp->iconLoader()->loadIcon
(PROG_NAME "-chat.png", KIcon::Small)),
- 0, this, TQT_SLOT(slotTalk()), actions);
+ 0, TQT_TQOBJECT(this), TQT_SLOT(slotTalk()), actions);
- d->mAct[KFibsPlayerListPrivate::Look] = new KAction(i18n("Look"), 0, this, TQT_SLOT(slotLook()), actions);
- d->mAct[KFibsPlayerListPrivate::Watch] = new KAction(i18n("Watch"), 0, this, TQT_SLOT(slotWatch()), actions);
- d->mAct[KFibsPlayerListPrivate::Unwatch] = new KAction(i18n("Unwatch"), 0, this, TQT_SLOT(slotUnwatch()),actions);
- d->mAct[KFibsPlayerListPrivate::BlindAct] = new KAction(i18n("Blind"), 0, this, TQT_SLOT(slotBlind()), actions);
- d->mAct[KFibsPlayerListPrivate::Update] = new KAction(i18n("Update"), 0, this, TQT_SLOT(slotUpdate()), actions);
+ d->mAct[KFibsPlayerListPrivate::Look] = new KAction(i18n("Look"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotLook()), actions);
+ d->mAct[KFibsPlayerListPrivate::Watch] = new KAction(i18n("Watch"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotWatch()), actions);
+ d->mAct[KFibsPlayerListPrivate::Unwatch] = new KAction(i18n("Unwatch"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotUnwatch()),actions);
+ d->mAct[KFibsPlayerListPrivate::BlindAct] = new KAction(i18n("Blind"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotBlind()), actions);
+ d->mAct[KFibsPlayerListPrivate::Update] = new KAction(i18n("Update"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotUpdate()), actions);
- d->mAct[KFibsPlayerListPrivate::Reload] = KStdAction::redisplay(this, TQT_SLOT(slotReload()), actions);
- d->mAct[KFibsPlayerListPrivate::Mail] = KStdAction::mail(this, TQT_SLOT(slotMail()), actions);
- d->mAct[KFibsPlayerListPrivate::Close] = KStdAction::close(this, TQT_SLOT(hide()), actions);
+ d->mAct[KFibsPlayerListPrivate::Reload] = KStdAction::redisplay(TQT_TQOBJECT(this), TQT_SLOT(slotReload()), actions);
+ d->mAct[KFibsPlayerListPrivate::Mail] = KStdAction::mail(TQT_TQOBJECT(this), TQT_SLOT(slotMail()), actions);
+ d->mAct[KFibsPlayerListPrivate::Close] = KStdAction::close(TQT_TQOBJECT(this), TQT_SLOT(hide()), actions);
- d->mAct[KFibsPlayerListPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, this,
+ d->mAct[KFibsPlayerListPrivate::InviteD] = new KAction(i18n("Use Dialog"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInviteD()), actions);
- d->mAct[KFibsPlayerListPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, this,
+ d->mAct[KFibsPlayerListPrivate::Invite1] = new KAction(i18n("1 Point Match"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInvite1()), actions);
- d->mAct[KFibsPlayerListPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, this,
+ d->mAct[KFibsPlayerListPrivate::Invite2] = new KAction(i18n("2 Point Match"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInvite2()), actions);
- d->mAct[KFibsPlayerListPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, this,
+ d->mAct[KFibsPlayerListPrivate::Invite3] = new KAction(i18n("3 Point Match"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInvite3()), actions);
- d->mAct[KFibsPlayerListPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, this,
+ d->mAct[KFibsPlayerListPrivate::Invite4] = new KAction(i18n("4 Point Match"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInvite4()), actions);
- d->mAct[KFibsPlayerListPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, this,
+ d->mAct[KFibsPlayerListPrivate::Invite5] = new KAction(i18n("5 Point Match"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInvite5()), actions);
- d->mAct[KFibsPlayerListPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, this,
+ d->mAct[KFibsPlayerListPrivate::Invite6] = new KAction(i18n("6 Point Match"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInvite6()), actions);
- d->mAct[KFibsPlayerListPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, this,
+ d->mAct[KFibsPlayerListPrivate::Invite7] = new KAction(i18n("7 Point Match"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInvite7()), actions);
- d->mAct[KFibsPlayerListPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, this,
+ d->mAct[KFibsPlayerListPrivate::InviteU] = new KAction(i18n("Unlimited"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInviteU()), actions);
- d->mAct[KFibsPlayerListPrivate::InviteR] = new KAction(i18n("Resume"), 0, this,
+ d->mAct[KFibsPlayerListPrivate::InviteR] = new KAction(i18n("Resume"), 0, TQT_TQOBJECT(this),
TQT_SLOT(slotInviteR()), actions);
/*
@@ -469,7 +469,7 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space)
gl = new TQGridLayout(gbl, LVEnd, 2, 20);
gl->addWidget(lb, 0, 0);
- // two column layout....
+ // two column tqlayout....
for (i = 1; i < LVEnd/2; i++) {
gl->addWidget(d->mCol[2*i-1]->cb, i, 0);
gl->addWidget(d->mCol[2*i ]->cb, i, 1);
@@ -483,7 +483,7 @@ void KFibsPlayerList::getSetupPages(KTabCtl *nb, int space)
*/
nb->addTab(w, i18n("&Playerlist"));
- connect(nb, TQT_SIGNAL(applyButtonPressed()), this, TQT_SLOT(setupOk()));
+ connect(nb, TQT_SIGNAL(applyButtonPressed()), TQT_TQOBJECT(this), TQT_SLOT(setupOk()));
}
/*
@@ -567,14 +567,14 @@ void KFibsPlayerList::showContextMenu(KListView *, TQListViewItem *i, const TQPo
/*
* Get the name of the selected player
*/
- d->mUser = (i ? i->text(Player) : TQString::null);
+ d->mUser = (i ? i->text(Player) : TQString());
- d->mAct[KFibsPlayerListPrivate::Info ]->setText(i18n("Info on %1" ).arg(d->mUser));
- d->mAct[KFibsPlayerListPrivate::Talk ]->setText(i18n("Talk to %1" ).arg(d->mUser));
- d->mAct[KFibsPlayerListPrivate::Mail ]->setText(i18n("Email to %1").arg(d->mUser));
- d->mAct[KFibsPlayerListPrivate::Look ]->setText(i18n("Look at %1" ).arg(d->mUser));
- d->mAct[KFibsPlayerListPrivate::Watch ]->setText(i18n("Watch %1" ).arg(d->mUser));
- d->mAct[KFibsPlayerListPrivate::Update]->setText(i18n("Update %1" ).arg(d->mUser));
+ d->mAct[KFibsPlayerListPrivate::Info ]->setText(i18n("Info on %1" ).tqarg(d->mUser));
+ d->mAct[KFibsPlayerListPrivate::Talk ]->setText(i18n("Talk to %1" ).tqarg(d->mUser));
+ d->mAct[KFibsPlayerListPrivate::Mail ]->setText(i18n("Email to %1").tqarg(d->mUser));
+ d->mAct[KFibsPlayerListPrivate::Look ]->setText(i18n("Look at %1" ).tqarg(d->mUser));
+ d->mAct[KFibsPlayerListPrivate::Watch ]->setText(i18n("Watch %1" ).tqarg(d->mUser));
+ d->mAct[KFibsPlayerListPrivate::Update]->setText(i18n("Update %1" ).tqarg(d->mUser));
d->mAct[KFibsPlayerListPrivate::Info ]->setEnabled(i);
d->mAct[KFibsPlayerListPrivate::Talk ]->setEnabled(i);
@@ -587,15 +587,15 @@ void KFibsPlayerList::showContextMenu(KListView *, TQListViewItem *i, const TQPo
d->mAct[KFibsPlayerListPrivate::Unwatch]->setEnabled(d->mWatch);
d->mPm[0]->setItemEnabled(d->mInID, i && d->mName != d->mUser);
- d->mPm[0]->changeItem(d->mInID, i18n("Invite %1").arg(d->mUser));
+ d->mPm[0]->changeItem(d->mInID, i18n("Invite %1").tqarg(d->mUser));
- d->mMail = (i && d->mCol[Email]->show ? i->text(d->mCol[Email]->index) : TQString::null);
+ 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[Status]->show)
+ if (i && d->mCol[tqStatus]->show)
d->mAct[KFibsPlayerListPrivate::BlindAct]->setText
- ((i->text(d->mCol[Status]->index).contains(d->mAbrv[Blind])) ?
- i18n("Unblind %1").arg(d->mUser) : i18n("Blind %1").arg(d->mUser));
+ ((i->text(d->mCol[tqStatus]->index).tqcontains(d->mAbrv[Blind])) ?
+ i18n("Unblind %1").tqarg(d->mUser) : i18n("Blind %1").tqarg(d->mUser));
else
d->mAct[KFibsPlayerListPrivate::BlindAct]->setText(i18n("Blind"));
@@ -657,7 +657,7 @@ void KFibsPlayerList::slotLook()
*/
void KFibsPlayerList::slotMail()
{
- kapp->invokeMailer(d->mMail, TQString::null);
+ kapp->invokeMailer(d->mMail, TQString());
}
/*
@@ -721,7 +721,7 @@ void KFibsPlayerList::changePlayer(const TQString &line)
TQDateTime fromEpoch;
TQString str_entry[LVEnd], tmp;
- entry[Status][0] = '\0';
+ entry[tqStatus][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[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, "-");
+ str_entry[tqStatus].tqreplace(Ready, 1, ready[0] == '0' ? "-" : d->mAbrv[Ready]);
+ str_entry[tqStatus].tqreplace(Away, 1, away [0] == '0' ? "-" : d->mAbrv[Away ]);
+ str_entry[tqStatus].tqreplace(Blind, 1, "-");
// disable drawing until the end of update
setUpdatesEnabled(false);
@@ -758,9 +758,9 @@ void KFibsPlayerList::changePlayer(const TQString &line)
i = new KFibsPlayerListLVI(this);
// count the KFibs and KBackgammon clients
- if (str_entry[Client].contains("KFibs"))
+ if (str_entry[Client].tqcontains("KFibs"))
d->mCount[0]++;
- else if (str_entry[Client].contains(PROG_NAME))
+ else if (str_entry[Client].tqcontains(PROG_NAME))
d->mCount[1]++;
// new entry requires an update to the player count
@@ -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[Status].replace(Blind,1,i->text(Status).contains
+ str_entry[tqStatus].tqreplace(Blind,1,i->text(tqStatus).tqcontains
(d->mAbrv[Blind]) ? d->mAbrv[Blind] : "-");
update:
@@ -794,9 +794,9 @@ void KFibsPlayerList::deletePlayer(const TQString &player)
TQListViewItemIterator it(this);
for ( ; it.current(); ++it) {
if (it.current()->text(0) == player) {
- if (it.current()->text(Client).contains(PROG_NAME))
+ if (it.current()->text(Client).tqcontains(PROG_NAME))
--d->mCount[1];
- else if (it.current()->text(Client).contains("KFibs"))
+ else if (it.current()->text(Client).tqcontains("KFibs"))
--d->mCount[0];
delete it.current();
updateCaption();
@@ -808,7 +808,7 @@ void KFibsPlayerList::deletePlayer(const TQString &player)
/*
* Set/Unset the status stat in the corresponding column of the list
*/
-void KFibsPlayerList::changePlayerStatus(const TQString &player, int stat, bool flag)
+void KFibsPlayerList::changePlayertqStatus(const TQString &player, int stat, bool flag)
{
TQListViewItem *i = 0;
@@ -827,7 +827,7 @@ void KFibsPlayerList::changePlayerStatus(const TQString &player, int stat, bool
/*
* Update the status flag
*/
- i->setText(Status, i->text(Status).replace(stat, 1, (flag) ? d->mAbrv[stat] : "-"));
+ i->setText(tqStatus, i->text(tqStatus).tqreplace(stat, 1, (flag) ? d->mAbrv[stat] : "-"));
}
@@ -886,7 +886,7 @@ void KFibsPlayerList::setName(const TQString &name)
*/
void KFibsPlayerList::updateCaption()
{
- setCaption(i18n("Player List - %1 - %2/%3").arg(childCount()).arg(d->mCount[0]).arg(d->mCount[1]));
+ setCaption(i18n("Player List - %1 - %2/%3").tqarg(childCount()).tqarg(d->mCount[0]).tqarg(d->mCount[1]));
}
/*
diff --git a/kbackgammon/engines/fibs/kplayerlist.h b/kbackgammon/engines/fibs/kplayerlist.h
index 27fd825f..7fe45218 100644
--- a/kbackgammon/engines/fibs/kplayerlist.h
+++ b/kbackgammon/engines/fibs/kplayerlist.h
@@ -46,24 +46,25 @@ class KFibsPlayerListPrivate;
class KFibsPlayerList : public KListView
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Enumerate player status
*/
- enum PStatus {Ready, Away, Blind, MaxStatus};
+ enum PtqStatus {Ready, Away, Blind, MaxtqStatus};
/**
* Enumerate the different columns of the list
*/
- enum {Player, Opponent, Watches, Status, Rating, Experience,
+ enum {Player, Opponent, Watches, tqStatus, Rating, Experience,
Idle, Time, Host, Client, Email, LVEnd};
/**
* Constructor
*/
- KFibsPlayerList(TQWidget *parent = 0, const char *name = 0);
+ KFibsPlayerList(TQWidget *tqparent = 0, const char *name = 0);
/**
* Destructor
@@ -110,7 +111,7 @@ public slots:
/**
* Change the status of a player
*/
- void changePlayerStatus(const TQString &player, int stat, bool flag);
+ void changePlayertqStatus(const TQString &player, int stat, bool flag);
/**
* Fills the playerlist page into the notebook
diff --git a/kbackgammon/engines/generic/kbgengine.cpp b/kbackgammon/engines/generic/kbgengine.cpp
index 59c19e2f..ac217bd0 100644
--- a/kbackgammon/engines/generic/kbgengine.cpp
+++ b/kbackgammon/engines/generic/kbgengine.cpp
@@ -31,10 +31,10 @@
/*
- * Constructor initializes the QObject
+ * Constructor initializes the TQObject
*/
-KBgEngine::KBgEngine(TQWidget *parent, TQString *name, TQPopupMenu *pmenu)
- : TQObject(parent, name->local8Bit())
+KBgEngine::KBgEngine(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu)
+ : TQObject(tqparent, name->local8Bit())
{
menu = pmenu;
cl = -1;
diff --git a/kbackgammon/engines/generic/kbgengine.h b/kbackgammon/engines/generic/kbgengine.h
index d254a910..c43b31b5 100644
--- a/kbackgammon/engines/generic/kbgengine.h
+++ b/kbackgammon/engines/generic/kbgengine.h
@@ -35,7 +35,7 @@ class TQPopupMenu;
class KDialogBase;
-class KBgStatus;
+class KBgtqStatus;
/**
*
@@ -58,16 +58,18 @@ class KBgStatus;
* @author Jens Hoefkens <[email protected]>
*
*/
-class KBgEngine:public QObject
+class KBgEngine:public TQObject
{
- Q_OBJECT public:
+ Q_OBJECT
+ TQ_OBJECT
+public:
enum Command { Redo, Undo, Roll, Cube, Done, Load };
/**
* Constructor
*/
- KBgEngine (TQWidget * parent = 0, TQString * name = 0, TQPopupMenu * pmenu = 0);
+ KBgEngine (TQWidget * tqparent = 0, TQString * name = 0, TQPopupMenu * pmenu = 0);
/**
* Destructor
@@ -247,12 +249,12 @@ signals:
/**
* Emit the most recent game state
*/
- void newState (const KBgStatus &);
+ void newState (const KBgtqStatus &);
/**
* Tell the board that we need the current state of the board.
*/
- void getState (KBgStatus *);
+ void getState (KBgtqStatus *);
/**
* Starts/ends the edit mode of the board
diff --git a/kbackgammon/engines/gnubg/kbggnubg.cpp b/kbackgammon/engines/gnubg/kbggnubg.cpp
index d17a6f88..e6f853a2 100644
--- a/kbackgammon/engines/gnubg/kbggnubg.cpp
+++ b/kbackgammon/engines/gnubg/kbggnubg.cpp
@@ -85,7 +85,7 @@ void KBgEngineGNU::handleLine(const TQString &l)
/*
* Start of a new game/match
*/
- if (line.contains(TQRegExp("^gnubg rolls [1-6], .* rolls [1-6]\\."))) {
+ if (line.tqcontains(TQRegExp("^gnubg rolls [1-6], .* rolls [1-6]\\."))) {
KRegExp e("^gnubg rolls ([1-6]), .* rolls ([1-6])\\.");
e.match(line.latin1());
if (int r = strcmp(e.group(1), e.group(2)))
@@ -95,14 +95,14 @@ void KBgEngineGNU::handleLine(const TQString &l)
/*
* Bug fixes for older versions of GNUBG - to be removed
*/
- if (line.contains(TQRegExp("^.* cannot move\\..+$"))) {
+ if (line.tqcontains(TQRegExp("^.* cannot move\\..+$"))) {
KRegExp e("(^.* cannot move.)(.*$)");
e.match(line.latin1());
handleLine(e.group(1));
handleLine(e.group(2));
return;
}
- if (line.contains(TQRegExp("^Are you sure you want to start a new game, and discard the one in progress\\?"))) {
+ if (line.tqcontains(TQRegExp("^Are you sure you want to start a new game, and discard the one in progress\\?"))) {
KRegExp e("(^Are you sure you want to start a new game, and discard the one in progress\\? )(.+$)");
e.match(line.latin1());
handleLine(e.group(1));
@@ -113,25 +113,25 @@ void KBgEngineGNU::handleLine(const TQString &l)
/*
* Cube handling
*/
- if (line.contains(TQRegExp("^gnubg accepts and immediately redoubles to [0-9]+\\.$"))) {
+ if (line.tqcontains(TQRegExp("^gnubg accepts and immediately redoubles to [0-9]+\\.$"))) {
// redoubles mess up the game counter "turn"
- //KBgStatus st(board);
+ //KBgtqStatus st(board);
//st.setCube(32, BOTH);
//emit newState(st);
}
- if (line.contains(TQRegExp("^gnubg doubles\\.$"))) {
+ if (line.tqcontains(TQRegExp("^gnubg doubles\\.$"))) {
// TODO: we need some generic class for this. the class
// can be shared between all engines
#if 0
- KBgStatus st(board);
+ KBgtqStatus st(board);
int ret = KMessageBox::warningYesNoCancel
- (0, i18n("gnubg doubles the cube to %1.").arg(2*st.cube(THEM)),
+ (0, i18n("gnubg doubles the cube to %1.").tqarg(2*st.cube(THEM)),
i18n("gnubg doubles"),
i18n("&Accept"), i18n("Re&double"), i18n("&Reject"), true);
@@ -155,16 +155,16 @@ void KBgEngineGNU::handleLine(const TQString &l)
/*
* Ignore the following messages
*/
- if (line.contains(TQRegExp("^TTY boards will be given in raw format"))) {
+ if (line.tqcontains(TQRegExp("^TTY boards will be given in raw format"))) {
line = " ";
}
/*
* Board messages
*/
- if (line.contains(TQRegExp("^board:"))) {
+ if (line.tqcontains(TQRegExp("^board:"))) {
- KBgStatus st(line);
+ KBgtqStatus st(line);
/*
* Do preliminary analysis of board
@@ -199,7 +199,7 @@ void KBgEngineGNU::handleLine(const TQString &l)
case uMove:
st.setDice(THEM, 0, 0);
st.setDice(THEM, 1, 0);
- emit infoText(i18n("You roll %1 and %2.").arg(st.dice(US, 0)).arg(st.dice(US, 1)));
+ emit infoText(i18n("You roll %1 and %2.").tqarg(st.dice(US, 0)).tqarg(st.dice(US, 1)));
switch (st.moves()) {
case 0:
// get a message
@@ -208,7 +208,7 @@ void KBgEngineGNU::handleLine(const TQString &l)
emit infoText(i18n("Please move 1 piece."));
break;
default:
- emit infoText(i18n("Please move %1 pieces.").arg(st.moves()));
+ emit infoText(i18n("Please move %1 pieces.").tqarg(st.moves()));
break;
}
emit allowCommand(Roll, false);
@@ -220,7 +220,7 @@ void KBgEngineGNU::handleLine(const TQString &l)
case tMove:
st.setDice(US, 0, 0);
st.setDice(US, 1, 0);
- emit infoText(i18n("gnubg rolls %1 and %2.").arg(st.dice(THEM, 0)).arg(st.dice(THEM, 1)));
+ emit infoText(i18n("gnubg rolls %1 and %2.").tqarg(st.dice(THEM, 0)).tqarg(st.dice(THEM, 1)));
if (st.moves() == 0)
emit infoText(i18n("gnubg cannot move."));
@@ -236,7 +236,7 @@ void KBgEngineGNU::handleLine(const TQString &l)
emit allowMoving(st.turn() == US);
emit newState(st);
- emit statText(i18n("%1 vs. %2").arg(st.player(US)).arg(st.player(THEM)));
+ emit statText(i18n("%1 vs. %2").tqarg(st.player(US)).tqarg(st.player(THEM)));
emit allowCommand(Load, true );
emit allowCommand(Undo, false);
@@ -248,7 +248,7 @@ void KBgEngineGNU::handleLine(const TQString &l)
/*
* Show the line...
*/
- line.replace(TQRegExp(" "), "&nbsp;");
+ line.tqreplace(TQRegExp(" "), "&nbsp;");
if (!line.isEmpty())
emit infoText(line);
}
@@ -275,10 +275,10 @@ void KBgEngineGNU::newGame()
/*
* If there is a game running we warn the user first
*/
- if (gameRunning && (KMessageBox::warningYesNo((TQWidget *)parent(),
+ if (gameRunning && (KMessageBox::warningYesNo((TQWidget *)tqparent(),
i18n("A game is currently in progress. "
"Starting a new one will terminate it."),
- TQString::null, i18n("Start New Game"), i18n("Continue Old Game"))
+ TQString(), i18n("Start New Game"), i18n("Continue Old Game"))
== KMessageBox::No))
return;
@@ -422,8 +422,8 @@ void KBgEngineGNU::saveConfig()
/*
* Constructor
*/
-KBgEngineGNU::KBgEngineGNU(TQWidget *parent, TQString *name, TQPopupMenu *pmenu)
- : KBgEngine(parent, name, pmenu)
+KBgEngineGNU::KBgEngineGNU(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu)
+ : KBgEngine(tqparent, name, pmenu)
{
// obsolete
nameUS = "US";
@@ -503,7 +503,7 @@ void KBgEngineGNU::startGNU()
resAction->setEnabled(false);
if (!gnubg.start(KProcess::NotifyOnExit, KProcess::All))
- KMessageBox::information((TQWidget *)parent(),
+ KMessageBox::information((TQWidget *)tqparent(),
i18n("Could not start the GNU Backgammon process.\n"
"Make sure the program is in your PATH and is "
"called \"gnubg\".\n"
@@ -533,7 +533,7 @@ void KBgEngineGNU::gnubgExit(KProcess *proc)
emit allowMoving(false);
emit infoText(TQString("<br/><font color=\"red\">") + i18n("The GNU Backgammon process (%1) has exited. ")
- .arg(proc->pid()) + "</font><br/>");
+ .tqarg(proc->pid()) + "</font><br/>");
resAction->setEnabled(true);
}
@@ -564,12 +564,12 @@ void KBgEngineGNU::nextCommand()
TQString s = (*it) + "\n";
if (!gnubg.writeStdin(s.latin1(), strlen(s.latin1()))) {
cmdTimer->start(250, true);
- cmdList.remove(TQString::null);
+ cmdList.remove(TQString());
return;
}
- (*it) = TQString::null;
+ (*it) = TQString();
}
- cmdList.remove(TQString::null);
+ cmdList.remove(TQString());
cmdTimer->stop();
}
@@ -625,9 +625,9 @@ void KBgEngineGNU::done()
emit allowCommand(Redo, false);
// Transform the string to FIBS format
- lastmove.replace(0, 2, "move ");
- lastmove.replace(TQRegExp("\\+"), " ");
- lastmove.replace(TQRegExp("\\-"), " ");
+ lastmove.tqreplace(0, 2, "move ");
+ lastmove.tqreplace(TQRegExp("\\+"), " ");
+ lastmove.tqreplace(TQRegExp("\\-"), " ");
// sent it to the server
handleCommand(lastmove);
@@ -669,7 +669,7 @@ void KBgEngineGNU::handleMove(TQString *s)
lastmove = *s;
int index = 0;
- TQString t = s->mid(index, s->find(' ', index));
+ TQString t = s->mid(index, s->tqfind(' ', index));
index += 1 + t.length();
int moves = t.toInt();
diff --git a/kbackgammon/engines/gnubg/kbggnubg.h b/kbackgammon/engines/gnubg/kbggnubg.h
index acb007f1..78b4566e 100644
--- a/kbackgammon/engines/gnubg/kbggnubg.h
+++ b/kbackgammon/engines/gnubg/kbggnubg.h
@@ -44,13 +44,14 @@
class KBgEngineGNU : public KBgEngine
{
Q_OBJECT
+ TQ_OBJECT
public:
/*
* Constructor and destructor
*/
- KBgEngineGNU(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0);
+ KBgEngineGNU(TQWidget *tqparent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0);
virtual ~KBgEngineGNU();
/**
diff --git a/kbackgammon/engines/nextgen/kbggame.cpp b/kbackgammon/engines/nextgen/kbggame.cpp
index 13ae076a..d00c1966 100644
--- a/kbackgammon/engines/nextgen/kbggame.cpp
+++ b/kbackgammon/engines/nextgen/kbggame.cpp
@@ -31,15 +31,15 @@
/*
* Constructor
*/
-KBgGame::KBgGame(int cookie, TQObject *parent)
- : KGame(cookie, parent)
+KBgGame::KBgGame(int cookie, TQObject *tqparent)
+ : KGame(cookie, tqparent)
{
// do nothing...
}
bool KBgGame::playerInput(TQDataStream &msg,KPlayer *player)
{
- Q_INT32 move;
+ TQ_INT32 move;
msg >> move;
cerr << " Player " << player->id() << " moved to " << move << endl;
return true;
diff --git a/kbackgammon/engines/nextgen/kbggame.h b/kbackgammon/engines/nextgen/kbggame.h
index 7888be62..255a3483 100644
--- a/kbackgammon/engines/nextgen/kbggame.h
+++ b/kbackgammon/engines/nextgen/kbggame.h
@@ -40,12 +40,13 @@ class KPlayer;
class KDE_EXPORT KBgGame : public KGame
{
Q_OBJECT
+ TQ_OBJECT
public:
enum MsgID {Text, Cmd, MaxMsg};
- KBgGame(int cookie = 42, TQObject *parent = 0);
+ KBgGame(int cookie = 42, TQObject *tqparent = 0);
protected:
diff --git a/kbackgammon/engines/nextgen/kbgng.cpp b/kbackgammon/engines/nextgen/kbgng.cpp
index 302cbb58..f2f04066 100644
--- a/kbackgammon/engines/nextgen/kbgng.cpp
+++ b/kbackgammon/engines/nextgen/kbgng.cpp
@@ -51,8 +51,8 @@
/*
* Constructor
*/
-KBgEngineNg::KBgEngineNg(TQWidget *parent, TQString *name, TQPopupMenu *pmenu)
- : KBgEngine(parent, name, pmenu)
+KBgEngineNg::KBgEngineNg(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu)
+ : KBgEngine(tqparent, name, pmenu)
{
// get a new game
initGame();
@@ -124,7 +124,7 @@ void KBgEngineNg::setGame()
// initialize a new game
bool ret = false;
TQString label, port_s, host_s;
- Q_UINT16 port;
+ TQ_UINT16 port;
switch (_currGame = _gameSelect->currentItem()) {
@@ -140,7 +140,7 @@ void KBgEngineNg::setGame()
"65535.");
port_s.setNum(_port);
do {
- port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)parent());
+ port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)tqparent());
if (!ret)
return;
port = port_s.toUShort(&ret);
@@ -150,7 +150,7 @@ void KBgEngineNg::setGame()
emit infoText(i18n("Now waiting for incoming connections on port %1.").
arg(_port = port));
else
- emit infoText(i18n("Failed to offer connections on port %1.").arg(port));
+ emit infoText(i18n("Failed to offer connections on port %1.").tqarg(port));
_game->addPlayer(createPlayer(0, _name[0]));
break;
@@ -159,16 +159,16 @@ void KBgEngineNg::setGame()
label = i18n("Type the name of the server you want to connect to:");
host_s = _host;
do {
- host_s = KLineEditDlg::getText(label, host_s, &ret, (TQWidget *)parent());
+ host_s = KLineEditDlg::getText(label, host_s, &ret, (TQWidget *)tqparent());
if (!ret)
return;
} while (host_s.isEmpty());
label = i18n("Type the port number on %1 you want to connect to.\nThe "
- "number should be between 1024 and 65535.").arg(host_s);
+ "number should be between 1024 and 65535.").tqarg(host_s);
port_s.setNum(_port);
do {
- port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)parent());
+ port_s = KLineEditDlg::getText(label, port_s, &ret, (TQWidget *)tqparent());
if (!ret)
return;
port = port_s.toUShort(&ret);
@@ -183,10 +183,10 @@ void KBgEngineNg::setGame()
_game->addPlayer(createPlayer(0, _name[0]));
if (_game->connectToServer(host_s, port))
- emit infoText(i18n("Now connected to %1:%2.").arg(_host = host_s).
+ emit infoText(i18n("Now connected to %1:%2.").tqarg(_host = host_s).
arg(_port = port));
else
- emit infoText(i18n("Failed to connect to %1:%2.").arg(_host = host_s).
+ emit infoText(i18n("Failed to connect to %1:%2.").tqarg(_host = host_s).
arg(_port = port));
// <HERE>
@@ -202,13 +202,13 @@ void KBgEngineNg::setGame()
// we are still having problems with player creation...
- // FIXME - which status _game->setGameStatus(KGame::End);
+ // FIXME - which status _game->setGametqStatus(KGame::End);
}
void KBgEngineNg::slotPlayerJoinedGame(KPlayer *p)
{
- emit infoText(i18n("Player %1 (%2) has joined the game.").arg(p->name()).arg(p->id()));
- cerr << i18n("Player %1 (%2) has joined the game.").arg(p->name()).arg(p->id()).latin1() << endl;
+ emit infoText(i18n("Player %1 (%2) has joined the game.").tqarg(p->name()).tqarg(p->id()));
+ cerr << i18n("Player %1 (%2) has joined the game.").tqarg(p->name()).tqarg(p->id()).latin1() << endl;
}
void KBgEngineNg::slotCreatePlayer(KPlayer *&p, int rtti, int io, bool v, KGame *g)
@@ -216,16 +216,16 @@ void KBgEngineNg::slotCreatePlayer(KPlayer *&p, int rtti, int io, bool v, KGame
Q_UNUSED(rtti)
Q_UNUSED(g)
Q_UNUSED(io)
- emit infoText(i18n("creating player. virtual=%1").arg(v));
+ emit infoText(i18n("creating player. virtual=%1").tqarg(v));
p = createPlayer(1);
}
-void KBgEngineNg::slotClientConnected(Q_UINT32)
+void KBgEngineNg::slotClientConnected(TQ_UINT32)
{
cerr << "client has joint the game..." << endl;
}
-void KBgEngineNg::slotClientDisconnected(Q_UINT32, bool)
+void KBgEngineNg::slotClientDisconnected(TQ_UINT32, bool)
{
cerr << "KBgEngineNg::slotClientDisconnected" << endl;
}
@@ -507,7 +507,7 @@ void KBgEngineNg::slotPropertyChanged(KGamePropertyBase *p, KPlayer *me)
case KGamePropertyBase::IdName:
emit infoText(i18n("Player %1 has changed the name to %2.")
- .arg(_name[player]).arg(me->name()));
+ .tqarg(_name[player]).tqarg(me->name()));
_name[player] = me->name();
break;
@@ -542,14 +542,14 @@ void KBgEngineNg::changeName()
TQString name;
for (int i = 0; i < 2; i++) {
- name = TQString::null;
+ name = TQString();
while (!_player[i]->isVirtual() && name.isEmpty()) {
if (i == 0)
name = KLineEditDlg::getText(i18n("Type the name of the first player:"),
- _name[i], &ok, (TQWidget *)parent());
+ _name[i], &ok, (TQWidget *)tqparent());
else
name = KLineEditDlg::getText(i18n("Type the name of the second player:"),
- _name[i], &ok, (TQWidget *)parent());
+ _name[i], &ok, (TQWidget *)tqparent());
if (!ok) return;
_player[i]->setName(name);
}
@@ -559,7 +559,7 @@ void KBgEngineNg::changeName()
/*
* Receive data sent via KBgGame::sendMessage(...)
*/
-void KBgEngineNg::slotNetworkData(int msgid, const TQByteArray &msg, Q_UINT32 r, Q_UINT32 s)
+void KBgEngineNg::slotNetworkData(int msgid, const TQByteArray &msg, TQ_UINT32 r, TQ_UINT32 s)
{
Q_UNUSED(r);
Q_UNUSED(s);
@@ -567,8 +567,8 @@ void KBgEngineNg::slotNetworkData(int msgid, const TQByteArray &msg, Q_UINT32 r,
case KBgGame::Cmd:
emit infoText(msg);
- emit infoText(i18n("Players are %1 and %2").arg(_player[0]->name())
- .arg(_player[1]->name()));
+ emit infoText(i18n("Players are %1 and %2").tqarg(_player[0]->name())
+ .tqarg(_player[1]->name()));
break;
default:
@@ -608,15 +608,15 @@ void KBgEngineNg::initGame()
connect(_game, TQT_SIGNAL(signalCreatePlayer(KPlayer *&, int, int, bool, KGame *)),
this, TQT_SLOT(slotCreatePlayer(KPlayer *&, int, int, bool, KGame *)));
- connect(_game, TQT_SIGNAL(signalClientConnected(Q_UINT32)),
- this, TQT_SLOT(slotClientConnected(Q_UINT32)));
- connect(_game, TQT_SIGNAL(signalClientDisconnected(Q_UINT32, bool)),
- this, TQT_SLOT(slotClientDisconnected(Q_UINT32, bool)));
+ connect(_game, TQT_SIGNAL(signalClientConnected(TQ_UINT32)),
+ this, TQT_SLOT(slotClientConnected(TQ_UINT32)));
+ connect(_game, TQT_SIGNAL(signalClientDisconnected(TQ_UINT32, bool)),
+ this, TQT_SLOT(slotClientDisconnected(TQ_UINT32, bool)));
connect(_game, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase *, KGame *)),
this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase *, KGame *)));
- connect(_game, TQT_SIGNAL(signalNetworkData(int,const TQByteArray &, Q_UINT32, Q_UINT32)),
- this, TQT_SLOT(slotNetworkData(int,const TQByteArray &, Q_UINT32, Q_UINT32)));
+ connect(_game, TQT_SIGNAL(signalNetworkData(int,const TQByteArray &, TQ_UINT32, TQ_UINT32)),
+ this, TQT_SLOT(slotNetworkData(int,const TQByteArray &, TQ_UINT32, TQ_UINT32)));
}
// EOF
diff --git a/kbackgammon/engines/nextgen/kbgng.h b/kbackgammon/engines/nextgen/kbgng.h
index 99ea82c1..12c94140 100644
--- a/kbackgammon/engines/nextgen/kbgng.h
+++ b/kbackgammon/engines/nextgen/kbgng.h
@@ -51,13 +51,14 @@
class KBgEngineNg : public KBgEngine
{
Q_OBJECT
+ TQ_OBJECT
public:
/*
* Constructor and destructor
*/
- KBgEngineNg( TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0);
+ KBgEngineNg( TQWidget *tqparent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0);
virtual ~KBgEngineNg();
/**
@@ -152,11 +153,11 @@ public slots:
void slotPlayerJoinedGame(KPlayer *p);
- void slotNetworkData(int msgid, const TQByteArray &msg, Q_UINT32 receiver, Q_UINT32 sender);
+ void slotNetworkData(int msgid, const TQByteArray &msg, TQ_UINT32 receiver, TQ_UINT32 sender);
void slotCreatePlayer(KPlayer *&, int, int, bool, KGame *);
- void slotClientDisconnected(Q_UINT32, bool);
- void slotClientConnected(Q_UINT32);
+ void slotClientDisconnected(TQ_UINT32, bool);
+ void slotClientConnected(TQ_UINT32);
void slotPropertyChanged(KGamePropertyBase *p, KGame *me);
void slotPropertyChanged(KGamePropertyBase *p, KPlayer *me);
@@ -220,7 +221,7 @@ private:
int _nplayers;
TQString _host;
- Q_UINT16 _port;
+ TQ_UINT16 _port;
// ************************************************************
// ************************************************************
@@ -244,11 +245,11 @@ private:
/**
* Create the i-th player. Legal values for i are 0 and 1. The
- * name of the player is taken from @ref _name and the parent of
+ * name of the player is taken from @ref _name and the tqparent of
* the player is @ref _player. That means that the players are
* automatically deleted.
*/
- KBgPlayer * createPlayer(int i, TQString name = TQString::null);
+ KBgPlayer * createPlayer(int i, TQString name = TQString());
private:
diff --git a/kbackgammon/engines/nextgen/kbgplayer.h b/kbackgammon/engines/nextgen/kbgplayer.h
index 8d6536de..c9fcdb1c 100644
--- a/kbackgammon/engines/nextgen/kbgplayer.h
+++ b/kbackgammon/engines/nextgen/kbgplayer.h
@@ -41,6 +41,7 @@ class KGame;
class KBgPlayer : public KPlayer
{
Q_OBJECT
+ TQ_OBJECT
public:
diff --git a/kbackgammon/engines/offline/kbgoffline.cpp b/kbackgammon/engines/offline/kbgoffline.cpp
index 4a9e1755..14197f54 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
*/
- KBgStatus mGame[2];
+ KBgtqStatus mGame[2];
/*
* Use the standard method of obtaining random numbers
@@ -106,8 +106,8 @@ public:
/*
* Constructor
*/
-KBgEngineOffline::KBgEngineOffline(TQWidget *parent, TQString *name, TQPopupMenu *pmenu)
- : KBgEngine(parent, name, pmenu)
+KBgEngineOffline::KBgEngineOffline(TQWidget *tqparent, TQString *name, TQPopupMenu *pmenu)
+ : KBgEngine(tqparent, name, pmenu)
{
d = new KBgEngineOfflinePrivate();
@@ -282,10 +282,10 @@ void KBgEngineOffline::newGame()
/*
* If there is a game running we warn the user first
*/
- if (d->mGameFlag && (KMessageBox::warningYesNo((TQWidget *)parent(),
+ if (d->mGameFlag && (KMessageBox::warningYesNo((TQWidget *)tqparent(),
i18n("A game is currently in progress. "
"Starting a new one will terminate it."),
- TQString::null, i18n("Start New Game"),
+ TQString(), i18n("Start New Game"),
i18n("Continue Old Game"))
== KMessageBox::No))
return;
@@ -318,14 +318,14 @@ void KBgEngineOffline::newGame()
u = getRandom();
t = getRandom();
emit infoText(i18n("%1 rolls %2, %3 rolls %4.").
- arg(d->mName[0]).arg(u).arg(d->mName[1]).arg(t));
+ tqarg(d->mName[0]).tqarg(u).tqarg(d->mName[1]).tqarg(t));
}
if (u > t) {
- emit infoText(i18n("%1 makes the first move.").arg(d->mName[0]));
+ emit infoText(i18n("%1 makes the first move.").tqarg(d->mName[0]));
d->mRoll = US;
} else {
- emit infoText(i18n("%1 makes the first move.").arg(d->mName[1]));
+ emit infoText(i18n("%1 makes the first move.").tqarg(d->mName[1]));
d->mRoll = THEM;
int n = u; u = t; t = n;
}
@@ -338,7 +338,7 @@ void KBgEngineOffline::newGame()
/*
* tell the user
*/
- emit statText(i18n("%1 vs. %2").arg(d->mName[0]).arg(d->mName[1]));
+ emit statText(i18n("%1 vs. %2").tqarg(d->mName[0]).tqarg(d->mName[1]));
}
/*
@@ -397,7 +397,7 @@ bool KBgEngineOffline::queryPlayerName(int w)
}
do {
- *name = KLineEditDlg::getText(text, *name, &ret, (TQWidget *)parent());
+ *name = KLineEditDlg::getText(text, *name, &ret, (TQWidget *)tqparent());
if (!ret) break;
} while (name->isEmpty());
@@ -484,7 +484,7 @@ void KBgEngineOffline::redo()
void KBgEngineOffline::handleMove(TQString *s)
{
int index = 0;
- TQString t = s->mid(index, s->find(' ', index));
+ TQString t = s->mid(index, s->tqfind(' ', index));
index += 1 + t.length();
int moves = t.toInt();
@@ -510,22 +510,22 @@ void KBgEngineOffline::handleMove(TQString *s)
*/
for (int i = 0; i < moves; i++) {
bool kick = false;
- t = s->mid(index, s->find(' ', index) - index);
+ t = s->mid(index, s->tqfind(' ', index) - index);
index += 1 + t.length();
char c = '-';
- if (t.contains('+')) {
+ if (t.tqcontains('+')) {
c = '+';
kick = true;
}
- TQString r = t.left(t.find(c));
- if (r.contains("bar")) {
+ TQString r = t.left(t.tqfind(c));
+ if (r.tqcontains("bar")) {
d->mGame[0].setBar(d->mRoll, abs(d->mGame[0].bar(d->mRoll)) - 1);
} else {
int from = r.toInt();
d->mGame[0].setBoard(from, d->mRoll, abs(d->mGame[0].board(from)) - 1);
}
t.remove(0, 1 + r.length());
- if (t.contains("off")) {
+ if (t.tqcontains("off")) {
d->mGame[0].setHome(d->mRoll, abs(d->mGame[0].home(d->mRoll)) + 1);
} else {
int to = t.toInt();
@@ -645,7 +645,7 @@ void KBgEngineOffline::cube()
if (d->mRollFlag && d->mGame[0].cube(w) > 0) {
emit allowCommand(Cube, false);
- if (KMessageBox::questionYesNo((TQWidget *)parent(),
+ if (KMessageBox::questionYesNo((TQWidget *)tqparent(),
i18n("%1 has doubled. %2, do you accept the double?").
arg((w == THEM) ? d->mName[1] : d->mName[0]).
arg((w == US) ? d->mName[1] : d->mName[0]),
@@ -695,9 +695,9 @@ bool KBgEngineOffline::queryClose()
if (!d->mGameFlag)
return true;
- switch (KMessageBox::warningContinueCancel((TQWidget *)parent(),
+ switch (KMessageBox::warningContinueCancel((TQWidget *)tqparent(),
i18n("In the middle of a game. "
- "Really quit?"), TQString::null, KStdGuiItem::quit())) {
+ "Really quit?"), TQString(), KStdGuiItem::quit())) {
case KMessageBox::Continue :
return TRUE;
case KMessageBox::Cancel :
@@ -722,7 +722,7 @@ bool KBgEngineOffline::queryExit()
void KBgEngineOffline::handleCommand(const TQString& cmd)
{
emit infoText(i18n("Text commands are not yet working. "
- "The command '%1' has been ignored.").arg(cmd));
+ "The command '%1' has been ignored.").tqarg(cmd));
}
/*
@@ -791,11 +791,11 @@ void KBgEngineOffline::toggleEditMode()
emit allowCommand(Roll, false);
emit allowCommand(Done, false);
emit allowCommand(Cube, false);
- emit statText(i18n("%1 vs. %2 - Edit Mode").arg(d->mName[0]).arg(d->mName[1]));
+ emit statText(i18n("%1 vs. %2 - Edit Mode").tqarg(d->mName[0]).tqarg(d->mName[1]));
} else {
d->mNew->setEnabled(true);
d->mSwap->setEnabled(true);
- emit statText(i18n("%1 vs. %2").arg(d->mName[0]).arg(d->mName[1]));
+ emit statText(i18n("%1 vs. %2").tqarg(d->mName[0]).tqarg(d->mName[1]));
emit getState(&d->mGame[1]);
d->mGame[0] = d->mGame[1];
emit allowCommand(Done, d->mDoneFlag);
diff --git a/kbackgammon/engines/offline/kbgoffline.h b/kbackgammon/engines/offline/kbgoffline.h
index 8a6448fb..a0217920 100644
--- a/kbackgammon/engines/offline/kbgoffline.h
+++ b/kbackgammon/engines/offline/kbgoffline.h
@@ -49,13 +49,14 @@ class KBgEngineOfflinePrivate;
class KBgEngineOffline : public KBgEngine
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor
*/
- KBgEngineOffline(TQWidget *parent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0);
+ KBgEngineOffline(TQWidget *tqparent = 0, TQString *name = 0, TQPopupMenu *pmenu = 0);
/**
* Destructor
diff --git a/kbackgammon/kbg.cpp b/kbackgammon/kbg.cpp
index 711471ad..0c01d8f1 100644
--- a/kbackgammon/kbg.cpp
+++ b/kbackgammon/kbg.cpp
@@ -89,7 +89,7 @@ KBg::KBg()
/*
* The main view is shared between the board and a small text window
*/
- panner = new TQSplitter(Vertical, this, "panner");
+ panner = new TQSplitter(Qt::Vertical, this, "panner");
board = new KBgBoardSetup(panner, "board");
status = new KBgTextView(panner, "status");
setCentralWidget(panner);
@@ -97,45 +97,45 @@ KBg::KBg()
/*
* Create all actions needed by the application
*/
- newAction = KStdGameAction::gameNew(this, TQT_SLOT(openNew()), actionCollection());
+ newAction = KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(openNew()), actionCollection());
newAction->setEnabled(false);
- KStdGameAction::print(this, TQT_SLOT(print()), actionCollection());
- KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection());
+ KStdGameAction::print(TQT_TQOBJECT(this), TQT_SLOT(print()), actionCollection());
+ KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection());
TQStringList list;
for (int i = 0; i < MaxEngine; i++)
list.append(engineString[i]);
- engineSet = new KSelectAction(i18n("&Engine"), 0, this, TQT_SLOT(setupEngine()), actionCollection(),
+ engineSet = new KSelectAction(i18n("&Engine"), 0, TQT_TQOBJECT(this), TQT_SLOT(setupEngine()), actionCollection(),
"move_engine");
engineSet->setItems(list);
// AB: what the heck has this to do with redisplay? perhaps use reload instead?
- loadAction = KStdAction::redisplay(this, TQT_SLOT(load()), actionCollection(), "move_load");
+ loadAction = KStdAction::redisplay(TQT_TQOBJECT(this), TQT_SLOT(load()), actionCollection(), "move_load");
loadAction->setEnabled(false);
- undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection());
+ undoAction = KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(undo()), actionCollection());
undoAction->setEnabled(false);
- redoAction = KStdGameAction::redo(this, TQT_SLOT(redo()), actionCollection());
+ redoAction = KStdGameAction::redo(TQT_TQOBJECT(this), TQT_SLOT(redo()), actionCollection());
redoAction->setEnabled(false);
- rollAction = KStdGameAction::roll(this, TQT_SLOT(roll()), actionCollection());
+ rollAction = KStdGameAction::roll(TQT_TQOBJECT(this), TQT_SLOT(roll()), actionCollection());
rollAction->setEnabled(false);
- endAction = KStdGameAction::endTurn(this, TQT_SLOT(done()), actionCollection());
+ endAction = KStdGameAction::endTurn(TQT_TQOBJECT(this), TQT_SLOT(done()), actionCollection());
endAction->setEnabled(false);
cubeAction = new KAction(i18n("Double Cube"), TQIconSet(kapp->iconLoader()->loadIcon
(PROG_NAME "-double.xpm", KIcon::Toolbar)),
- 0, this, TQT_SLOT(cube()), actionCollection(), "move_cube");
+ 0, TQT_TQOBJECT(this), TQT_SLOT(cube()), actionCollection(), "move_cube");
cubeAction->setEnabled(false);
- KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection());
- KStdAction::preferences(this, TQT_SLOT(setupDlg()), actionCollection());
- KStdAction::saveOptions(this, TQT_SLOT(saveConfig()), actionCollection());
+ KStdAction::showMenubar(TQT_TQOBJECT(this), TQT_SLOT(toggleMenubar()), actionCollection());
+ KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(setupDlg()), actionCollection());
+ KStdAction::saveOptions(TQT_TQOBJECT(this), TQT_SLOT(saveConfig()), actionCollection());
KPopupMenu *p = (new KActionMenu(i18n("&Backgammon on the Web"),
actionCollection(), "help_www"))->popupMenu();
- (new KAction(helpTopic[FIBSHome][0], 0, this, TQT_SLOT(wwwFIBS()),
+ (new KAction(helpTopic[FIBSHome][0], 0, TQT_TQOBJECT(this), TQT_SLOT(wwwFIBS()),
actionCollection(), "help_www_fibs"))->plug(p);
- (new KAction(helpTopic[RuleHome][0], 0, this, TQT_SLOT(wwwRule()),
+ (new KAction(helpTopic[RuleHome][0], 0, TQT_TQOBJECT(this), TQT_SLOT(wwwRule()),
actionCollection(), "help_www_rule"))->plug(p);
/*
@@ -145,11 +145,11 @@ KBg::KBg()
cmdLabel = new TQLabel(i18n("Command: "), this);
new KWidgetAction( cmdLabel, cmdLabel->text(), 0, 0, 0, actionCollection(), "command_label");
cmdLine = new KLineEdit(this, "commandline");
- KWidgetAction* actionCmdLine = new KWidgetAction( cmdLine, TQString::null, 0, 0, 0, actionCollection(), "command_lineedit");
+ KWidgetAction* actionCmdLine = new KWidgetAction( cmdLine, TQString(), 0, 0, 0, actionCollection(), "command_lineedit");
actionCmdLine->setAutoSized(true);
cmdLine->completionObject()->setOrder(KCompletion::Weighted);
- connect(cmdLine, TQT_SIGNAL(returnPressed(const TQString &)), this, TQT_SLOT(handleCmd(const TQString &)));
+ connect(cmdLine, TQT_SIGNAL(returnPressed(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(handleCmd(const TQString &)));
/*
* Done with the actions, create the XML-defined parts of the
* user interface
@@ -275,7 +275,7 @@ void KBg::setupEngine()
newAction->setEnabled(engine[currEngine]->haveNewGame());
// engine -> this
- connect(engine[currEngine], TQT_SIGNAL(statText(const TQString &)), this, TQT_SLOT(updateCaption(const TQString &)));
+ connect(engine[currEngine], TQT_SIGNAL(statText(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(updateCaption(const TQString &)));
connect(engine[currEngine], TQT_SIGNAL(infoText(const TQString &)), status, TQT_SLOT(write(const TQString &)));
connect(engine[currEngine], TQT_SIGNAL(allowCommand(int, bool)), this, TQT_SLOT(allowCommand(int, bool)));
@@ -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(KBgStatus *)), board, TQT_SLOT(getState(KBgStatus *)));
- connect(engine[currEngine], TQT_SIGNAL(newState(const KBgStatus &)), board, TQT_SLOT(setState(const KBgStatus &)));
+ 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 &)));
// now that all signals are connected, start the engine
engine[currEngine]->start();
@@ -371,8 +371,8 @@ void KBg::readConfig()
status->setFont(config->readFontEntry("font", &kappFont));
TQValueList<int> l;
- l.append(qRound( config->readDoubleNumEntry("panner", 0.75) *panner->height()));
- l.append(qRound((1-config->readDoubleNumEntry("panner", 0.75))*panner->height()));
+ l.append(tqRound( config->readDoubleNumEntry("panner", 0.75) *panner->height()));
+ l.append(tqRound((1-config->readDoubleNumEntry("panner", 0.75))*panner->height()));
panner->setSizes(l);
applyMainWindowSettings(config, "main window");
@@ -421,7 +421,7 @@ void KBg::setupOk()
if (cbm->isChecked())
KMessageBox::enableAllMessages();
- // tell children to read their changes
+ // tell tqchildren to read their changes
board->setupOk();
// engines
@@ -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->sizeHint());
+ lab->setMaximumSize(lab->tqsizeHint());
gle->addWidget(lab, 0, 0);
connect(lab, TQT_SIGNAL(leftClickedURL(const TQString &)), TQT_SLOT(startKCM(const TQString &)));
@@ -617,12 +617,12 @@ void KBg::setupDlg()
*/
connect(nb, TQT_SIGNAL(okClicked()), this, TQT_SLOT(setupOk()));
connect(nb, TQT_SIGNAL(applyClicked()), this, TQT_SLOT(setupOk()));
- connect(nb, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(setupCancel()));
+ connect(nb, TQT_SIGNAL(cancelClicked()), TQT_TQOBJECT(this), TQT_SLOT(setupCancel()));
connect(nb, TQT_SIGNAL(defaultClicked()),this, TQT_SLOT(setupDefault()));
- connect(nb, TQT_SIGNAL(finished()), this, TQT_SLOT(setupDone()));
+ connect(nb, TQT_SIGNAL(finished()), TQT_TQOBJECT(this), TQT_SLOT(setupDone()));
- nb->resize(nb->minimumSize());
+ nb->resize(nb->tqminimumSize());
nb->show();
}
@@ -646,7 +646,7 @@ void KBg::print()
prt->setPageSize((KPrinter::PageSize) config->readNumEntry("pagesize", KPrinter::A4));
prt->setOrientation((KPrinter::Orientation)config->readNumEntry("orientation", KPrinter::Landscape));
- if (prt->setup(this, i18n("Print %1").arg(baseCaption))) {
+ if (prt->setup(this, i18n("Print %1").tqarg(baseCaption))) {
TQPainter p;
p.begin(prt);
board->print(&p);
diff --git a/kbackgammon/kbg.h b/kbackgammon/kbg.h
index 94f4aab9..81c5f4fd 100644
--- a/kbackgammon/kbg.h
+++ b/kbackgammon/kbg.h
@@ -48,6 +48,7 @@ class KBgBoardSetup;
class KBg : public KMainWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
diff --git a/kbackgammon/kbgboard.cpp b/kbackgammon/kbgboard.cpp
index fc024ab8..b47c6192 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]->sizeHint());
+ rbMove[i]->setMinimumSize(rbMove[i]->tqsizeHint());
blm->addWidget(rbMove[i]);
rbMove[i]->setChecked(i == getShortMoveMode());
}
@@ -248,8 +248,8 @@ void KBgBoardSetup::getSetupPages(KDialogBase *nb)
/*
* Empty constructor calls the board constructor
*/
-KBgBoardSetup::KBgBoardSetup(TQWidget *parent, const char *name, TQPopupMenu *menu)
- : KBgBoard(parent, name, menu)
+KBgBoardSetup::KBgBoardSetup(TQWidget *tqparent, const char *name, TQPopupMenu *menu)
+ : KBgBoard(tqparent, name, menu)
{
// empty
}
@@ -360,10 +360,10 @@ void KBgBoard::setFont(const TQFont& f)
*/
void KBgBoard::queryCube()
{
- KBgStatus *st = new KBgStatus();
+ KBgtqStatus *st = new KBgtqStatus();
getState(st);
- KBgBoardQCube *dlg =
- new KBgBoardQCube(abs(st->cube()), (st->cube(US) > 0), (st->cube(THEM) > 0));
+ KBgBoardTQCube *dlg =
+ new KBgBoardTQCube(abs(st->cube()), (st->cube(US) > 0), (st->cube(THEM) > 0));
if (dlg->exec()) {
bool u = ((dlg->getCubeValue() == 0) || (dlg->getCubeOwner() == US ));
bool t = ((dlg->getCubeValue() == 0) || (dlg->getCubeOwner() == THEM));
@@ -377,7 +377,7 @@ void KBgBoard::queryCube()
/*
* Constructor, creates the dialog but does not show nor execute it.
*/
-KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them)
+KBgBoardTQCube::KBgBoardTQCube(int val, bool us, bool them)
: TQDialog(0, 0, true)
{
setCaption(i18n("Set Cube Values"));
@@ -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->sizeHint());
+ info->setMinimumSize(info->tqsizeHint());
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]->sizeHint());
- cb[1]->setMinimumSize(cb[1]->sizeHint());
+ cb[0]->setMinimumSize(cb[0]->tqsizeHint());
+ cb[1]->setMinimumSize(cb[1]->tqsizeHint());
- ok->setMinimumSize(ok->sizeHint());
- cancel->setMinimumSize(cancel->sizeHint());
+ ok->setMinimumSize(ok->tqsizeHint());
+ cancel->setMinimumSize(cancel->tqsizeHint());
- setMinimumSize(childrenRect().size());
+ setMinimumSize(tqchildrenRect().size());
vbox->activate();
- resize(minimumSize());
+ resize(tqminimumSize());
ok->setAutoDefault (true);
ok->setDefault(true);
@@ -481,7 +481,7 @@ KBgBoardQCube::KBgBoardQCube(int val, bool us, bool them)
/*
* Deconstructor, empty.
*/
-KBgBoardQCube::~KBgBoardQCube()
+KBgBoardTQCube::~KBgBoardTQCube()
{
// nothing
}
@@ -489,7 +489,7 @@ KBgBoardQCube::~KBgBoardQCube()
/*
* Get the face value of the cube
*/
-int KBgBoardQCube::getCubeValue()
+int KBgBoardTQCube::getCubeValue()
{
return cb[0]->currentItem();
}
@@ -497,7 +497,7 @@ int KBgBoardQCube::getCubeValue()
/*
* Get the owner of the cube
*/
-int KBgBoardQCube::getCubeOwner()
+int KBgBoardTQCube::getCubeOwner()
{
return cb[1]->currentItem();
}
@@ -505,7 +505,7 @@ int KBgBoardQCube::getCubeOwner()
/*
* If the cube is open, the value can only be 1
*/
-void KBgBoardQCube::changeValue(int player)
+void KBgBoardTQCube::changeValue(int player)
{
if (player == BOTH)
cb[0]->setCurrentItem(0);
@@ -516,7 +516,7 @@ void KBgBoardQCube::changeValue(int player)
* If the value is 1, the cube has to be open; and if the value
* becomes bigger than 1, the player cannot stay open.
*/
-void KBgBoardQCube::changePlayer(int val)
+void KBgBoardTQCube::changePlayer(int val)
{
if (val == 0)
cb[1]->setCurrentItem(BOTH);
@@ -527,7 +527,7 @@ void KBgBoardQCube::changePlayer(int val)
/*
* Constructor, creates the dialog but does not show nor execute it.
*/
-KBgBoardQDice::KBgBoardQDice(const char *name)
+KBgBoardTQDice::KBgBoardTQDice(const char *name)
: TQDialog(0, name, true)
{
setCaption(i18n("Set Dice Values"));
@@ -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->sizeHint());
+ info->setMinimumSize(info->tqsizeHint());
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]->sizeHint());
- sb[1]->setMinimumSize(sb[1]->sizeHint());
+ sb[0]->setMinimumSize(sb[0]->tqsizeHint());
+ sb[1]->setMinimumSize(sb[1]->tqsizeHint());
- ok->setMinimumSize(ok->sizeHint());
- cancel->setMinimumSize(cancel->sizeHint());
+ ok->setMinimumSize(ok->tqsizeHint());
+ cancel->setMinimumSize(cancel->tqsizeHint());
- setMinimumSize(childrenRect().size());
+ setMinimumSize(tqchildrenRect().size());
vbox->activate();
- resize(minimumSize());
+ resize(tqminimumSize());
ok->setAutoDefault (true);
ok->setDefault(true);
@@ -590,7 +590,7 @@ KBgBoardQDice::KBgBoardQDice(const char *name)
/*
* Deconstructor, empty.
*/
-KBgBoardQDice::~KBgBoardQDice()
+KBgBoardTQDice::~KBgBoardTQDice()
{
// nothing
}
@@ -598,7 +598,7 @@ KBgBoardQDice::~KBgBoardQDice()
/*
* Get the face value of the dice
*/
-int KBgBoardQDice::getDice(int n)
+int KBgBoardTQDice::getDice(int n)
{
return sb[n]->value();
}
@@ -628,10 +628,10 @@ bool KBgBoard::getEditMode() const
}
/*
- * This function takes a KBgStatus object and fills it with the current
+ * This function takes a KBgtqStatus object and fills it with the current
* board status.
*/
-KBgStatus* KBgBoard::getState(KBgStatus *st) const
+KBgtqStatus* KBgBoard::getState(KBgtqStatus *st) const
{
st->setColor(color);
st->setDirection(direction);
@@ -915,7 +915,7 @@ void KBgBoardBar::paintCell(TQPainter *p, int xo, int yo, double sf) const
* the center belongs to two(!) fields - both bars.
*
* If we are not printing on paper we use the fact that
- * Qt will clip the drawing for us. So we print the upper
+ * TQt will clip the drawing for us. So we print the upper
* half of the cube and the lower half on different cells.
*
* Since there is no such thing as clipping when we print
@@ -1103,7 +1103,7 @@ void KBgBoardHome::drawDiceFrame(TQPainter *p, int col, int num,
*/
void KBgBoardCell::mousePressEvent(TQMouseEvent *e)
{
- if (e->button() == RightButton)
+ if (e->button() == Qt::RightButton)
board->showContextMenu();
else
mouseButton = e->button();
@@ -1142,7 +1142,7 @@ int KBgBoard::getShortMoveMode()
*/
void KBgBoardCell::checkAndMakeShortMove(TQMouseEvent *e, int m)
{
- if ((e->button() == LeftButton) &&
+ if ((e->button() == Qt::LeftButton) &&
(board->getShortMoveMode() == m) &&
(dragPossible()) &&
(!board->getEditMode()))
@@ -1166,7 +1166,7 @@ void KBgBoardBar::mouseDoubleClickEvent(TQMouseEvent *e)
{
TQRect r = cubeRect(cellID == BAR_THEM ? CUBE_UPPER : CUBE_LOWER, true);
if (board->canDouble(US) &&
- board->canDouble(THEM) && r.contains(e->pos())) {
+ board->canDouble(THEM) && r.tqcontains(e->pos())) {
if (board->getEditMode())
board->queryCube();
else
@@ -1318,7 +1318,7 @@ int KBgBoard::getPipCount(const int& w) const
*/
void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e)
{
- if (e->button() != LeftButton)
+ if (e->button() != Qt::LeftButton)
return;
/*
* Check whether this is the bookkeeping home...
@@ -1332,12 +1332,12 @@ void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e)
US : THEM);
for (int i = 0; i < 2; ++i) {
TQRect r = diceRect(i, true);
- if (r.contains(e->pos())) {
+ if (r.tqcontains(e->pos())) {
if (board->getEditMode()) {
- KBgBoardQDice *dlg = new KBgBoardQDice();
+ KBgBoardTQDice *dlg = new KBgBoardTQDice();
if (dlg->exec()) {
- KBgStatus *st = new KBgStatus();
+ KBgtqStatus *st = new KBgtqStatus();
board->getState(st);
st->setDice(w, 0, dlg->getDice(0));
st->setDice(w, 1, dlg->getDice(1));
@@ -1356,7 +1356,7 @@ void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e)
if (board->canDouble(w) &&
!(board->canDouble(US) && board->canDouble(THEM))) {
TQRect r = cubeRect(w, true);
- if (r.contains(e->pos()))
+ if (r.tqcontains(e->pos()))
if (board->getEditMode())
board->queryCube();
else
@@ -1367,7 +1367,7 @@ void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e)
/*
* This function determines if a checker can be dropped on this field.
- * It checks whether the field is already owned, empty or contains
+ * It checks whether the field is already owned, empty or tqcontains
* only one opponents piece. Then the dice are checked.
*/
bool KBgBoardField::dropPossible(int fromCellID, int newColor)
@@ -1435,7 +1435,7 @@ bool KBgBoard::moveOffPossible() const
KBgBoardCell* KBgBoard::getCellByPos(const TQPoint& p) const
{
for (int i = 0; i < 30; ++i) {
- if (cells[i]->rect().contains(cells[i]->mapFromParent(p)))
+ if (TQT_TQRECT_OBJECT(cells[i]->rect()).tqcontains(cells[i]->mapFromParent(p)))
return cells[i];
}
return NULL;
@@ -1610,8 +1610,8 @@ KBgBoardField::~KBgBoardField()
* This is the constructor of the bars. It calls the base class' constructor
* and defines the TQWhatsThis string.
*/
-KBgBoardBar::KBgBoardBar(TQWidget * parent, int numID)
- : KBgBoardCell(parent, numID)
+KBgBoardBar::KBgBoardBar(TQWidget * tqparent, int numID)
+ : KBgBoardCell(tqparent, numID)
{
TQWhatsThis::add(this, i18n("This is the bar of the backgammon board.\n\n"
"Checkers that have been kicked from the board are put "
@@ -1627,8 +1627,8 @@ KBgBoardBar::KBgBoardBar(TQWidget * parent, int numID)
* This is the constructor of regular fields. It calls the base class' constructor
* and defines the TQWhatsThis string.
*/
-KBgBoardField::KBgBoardField(TQWidget * parent, int numID)
- : KBgBoardCell(parent, numID)
+KBgBoardField::KBgBoardField(TQWidget * tqparent, int numID)
+ : KBgBoardCell(tqparent, numID)
{
TQWhatsThis::add(this, i18n("This is a regular field of the backgammon board.\n\n"
"Checkers can be placed on this field and if the current state "
@@ -1641,8 +1641,8 @@ KBgBoardField::KBgBoardField(TQWidget * parent, int numID)
* This is the constructor of the homes. It calls the base class' constructor
* and defines the TQWhatsThis string.
*/
-KBgBoardHome::KBgBoardHome(TQWidget * parent, int numID)
- : KBgBoardCell(parent, numID)
+KBgBoardHome::KBgBoardHome(TQWidget * tqparent, int numID)
+ : KBgBoardCell(tqparent, numID)
{
TQWhatsThis::add(this, i18n("This part of the backgammon board is the home.\n\n"
"Depending on the direction of the game, one of the homes "
@@ -1734,10 +1734,10 @@ int KBgBoard::getTurn() const
* This is the constructor of the basic cells. It initializes the cell
* to a sane state and connects a signal to the board.
*/
-KBgBoardCell::KBgBoardCell(TQWidget * parent, int numID)
- : TQLabel(parent)
+KBgBoardCell::KBgBoardCell(TQWidget * tqparent, int numID)
+ : TQLabel(tqparent)
{
- board = (KBgBoard *)parent;
+ board = (KBgBoard *)tqparent;
direction = +1;
color = -1;
@@ -1746,10 +1746,10 @@ KBgBoardCell::KBgBoardCell(TQWidget * parent, int numID)
stateChanged = false;
colorChanged = false;
directionChanged = false;
- mouseButton = NoButton;
+ mouseButton = Qt::NoButton;
dragInProgress = false;
- connect(parent, TQT_SIGNAL(finishedUpdate()), this, TQT_SLOT(refresh()));
+ connect(tqparent, TQT_SIGNAL(finishedUpdate()), this, TQT_SLOT(refresh()));
}
/*
@@ -1854,7 +1854,7 @@ void KBgBoard::updateField(int f, int v)
}
/*
- * This function displays the context menu our parent may have given us
+ * This function displays the context menu our tqparent may have given us
*/
void KBgBoard::showContextMenu()
{
@@ -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 KBgStatus &st)
+void KBgBoard::setState(const KBgtqStatus &st)
{
color = st.color();
direction = st.direction();
@@ -2151,7 +2151,7 @@ void KBgBoard::setState(const KBgStatus &st)
*/
void KBgBoardCell::mouseMoveEvent(TQMouseEvent *)
{
- if ((mouseButton == LeftButton) && dragPossible()) {
+ if ((mouseButton == Qt::LeftButton) && dragPossible()) {
dragInProgress = true;
TQRect cr(0, 0, 1+getCheckerDiameter(), 1+getCheckerDiameter());
cr.moveBottomLeft(rect().bottomLeft());
@@ -2162,15 +2162,15 @@ void KBgBoardCell::mouseMoveEvent(TQMouseEvent *)
board->drawSimpleChecker(&tmp, 0, 0, pcs, getCheckerDiameter());
tmp.end();
pix.setMask(pix.createHeuristicMask());
- TQBitmap mask = *(pix.mask());
+ TQBitmap tqmask = *(pix.tqmask());
TQBitmap newCursor;
- newCursor = pix;
- board->replaceCursor(TQCursor(newCursor, mask));
+ newCursor = TQBitmap(pix);
+ board->replaceCursor(TQCursor(newCursor, tqmask));
if (board->getEditMode())
board->storeTurn(pcs);
getPiece();
}
- mouseButton = NoButton;
+ mouseButton = Qt::NoButton;
}
/*
@@ -2653,7 +2653,7 @@ void KBgBoard::redoMove()
}
/*
- * This function performs and undo for the last move and updates the parent
+ * This function performs and undo for the last move and updates the tqparent
* of the board by calling sendMove() after the undo.
*/
void KBgBoard::undoMove()
@@ -2820,11 +2820,11 @@ 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 KBgStatus
+ * You have to change the status by passing a KBgtqStatus
* object to setState(...) before you can play!
*/
-KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu)
- : TQWidget(parent, name)
+KBgBoard::KBgBoard(TQWidget *tqparent, const char *name, TQPopupMenu *menu)
+ : TQWidget(tqparent, name)
{
/*
* The following lines set up internal bookkeeping data.
@@ -2838,7 +2838,7 @@ KBgBoard::KBgBoard(TQWidget *parent, const char *name, TQPopupMenu *menu)
checkerDiam = MINIMUM_CHECKER_SIZE;
/*
- * We may be initialized with a popup menu by our parent.
+ * We may be initialized with a popup menu by our tqparent.
*/
contextMenu = 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.
*/
- KBgStatus *st = new KBgStatus();
+ KBgtqStatus *st = new KBgtqStatus();
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::minimumSizeHint() const
+TQSize KBgBoard::tqminimumSizeHint() const
{
return TQSize(MINIMUM_CHECKER_SIZE * 15, MINIMUM_CHECKER_SIZE * 11);
}
-TQSize KBgBoard::sizeHint() const {
+TQSize KBgBoard::tqsizeHint() const {
return TQSize(MINIMUM_CHECKER_SIZE *15*4,MINIMUM_CHECKER_SIZE*11*2);
}
diff --git a/kbackgammon/kbgboard.h b/kbackgammon/kbgboard.h
index 54ad506c..04cac55f 100644
--- a/kbackgammon/kbgboard.h
+++ b/kbackgammon/kbgboard.h
@@ -64,9 +64,9 @@
/*
* Just some internal constants and classes
*/
-const int US = KBgStatus::US;
-const int THEM = KBgStatus::THEM;
-const int BOTH = KBgStatus::BOTH;
+const int US = KBgtqStatus::US;
+const int THEM = KBgtqStatus::THEM;
+const int BOTH = KBgtqStatus::BOTH;
const int HOME_US_LEFT = 101;
const int HOME_US_RIGHT = 102;
@@ -87,7 +87,7 @@ class KBgBoardMove;
class KBgBoardHome;
class KBgBoardBar;
class KBgBoardField;
-class KBgBoardQDice;
+class KBgBoardTQDice;
/**
@@ -95,9 +95,10 @@ class KBgBoardQDice;
*
* This class handles all game operations of the client.
*/
-class KBgBoard : public QWidget
+class KBgBoard : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
friend class KBgBoardCell;
friend class KBgBoardHome;
@@ -109,7 +110,7 @@ class KBgBoard : public QWidget
/**
* Constructor and destructor. Parameter as usual.
*/
- KBgBoard(TQWidget *parent = 0, const char *name = 0,
+ KBgBoard(TQWidget *tqparent = 0, const char *name = 0,
TQPopupMenu *menu = 0);
virtual ~KBgBoard();
@@ -180,7 +181,7 @@ class KBgBoard : public QWidget
* This function has to be reimplemented to provide a minimum size for
* the playing area.
*/
- TQSize minimumSizeHint() const;
+ TQSize tqminimumSizeHint() const;
public slots:
/**
@@ -194,7 +195,7 @@ public slots:
* Overwritten resize event handler.
*
* We overwrite the handler to make sure that all the cells are
- * repainted as well.
+ * tqrepainted as well.
*/
virtual void resizeEvent(TQResizeEvent *);
@@ -210,10 +211,10 @@ public slots:
/**
* This is the most important public member. It takes
- * a board status - s. the KBgBoardStatus class -
+ * a board status - s. the KBgBoardtqStatus class -
* and sets the board accordingly.
*/
- void setState(const KBgStatus &);
+ void setState(const KBgtqStatus &);
/**
* Set the context menu
@@ -223,7 +224,7 @@ public slots:
/**
* Get the current state of the board.
*/
- KBgStatus *getState(KBgStatus *st) const;
+ KBgtqStatus *getState(KBgtqStatus *st) const;
/**
* Sets the edit mode of the board. In that mode the board can be
@@ -291,7 +292,7 @@ public slots:
/* ************************************************** */
protected:
- virtual TQSize sizeHint() const;
+ virtual TQSize tqsizeHint() const;
TQColor baseColors[2];
TQFont boardFont;
@@ -458,21 +459,22 @@ protected:
* on a backgammon board. It has a bunch of virtual functions that
* are overloaded in the derived classes.
*/
-class KBgBoardCell : public QLabel
+class KBgBoardCell : public TQLabel
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor and destructor
*/
- KBgBoardCell(TQWidget * parent, int numID);
+ KBgBoardCell(TQWidget * tqparent, int numID);
virtual ~KBgBoardCell();
/**
* sets the number and color of checkers on this cell
- * takes care of repainting
+ * takes care of tqrepainting
*/
virtual void cellUpdate(const int p, const bool cubechanged = false) = 0;
@@ -533,7 +535,7 @@ protected:
virtual void drawContents(TQPainter *);
/**
- * Status numbers that store the current board status.
+ * tqStatus numbers that store the current board status.
*/
int mouseButton;
int direction;
@@ -550,7 +552,7 @@ protected:
int cellID;
/**
- * Indicates whether this cell needs to repaint itself after
+ * Indicates whether this cell needs to tqrepaint itself after
* the board has been processed.
*/
bool stateChanged;
@@ -558,7 +560,7 @@ protected:
/**
* the board and the pieces are one unit (none makes
- * sense without the other). So the pieces know and access their parent.
+ * sense without the other). So the pieces know and access their tqparent.
*/
KBgBoard *board;
void checkAndMakeShortMove(TQMouseEvent *e, int m);
@@ -615,11 +617,12 @@ protected:
class KBgBoardHome : public KBgBoardCell
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* sets the number and color of checkers on this cell
- * takes care of repainting
+ * takes care of tqrepainting
*/
virtual void cellUpdate(const int p, const bool cubechanged = false);
@@ -632,7 +635,7 @@ class KBgBoardHome : public KBgBoardCell
/**
* Constructor and destructor
*/
- KBgBoardHome( TQWidget * parent, int numID);
+ KBgBoardHome( TQWidget * tqparent, int numID);
virtual ~KBgBoardHome();
/**
@@ -664,7 +667,7 @@ class KBgBoardHome : public KBgBoardCell
private:
/**
- * Save old dice to avoid repainting
+ * Save old dice to avoid tqrepainting
*/
int savedDice[2];
@@ -677,11 +680,12 @@ class KBgBoardHome : public KBgBoardCell
class KBgBoardBar : public KBgBoardCell
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* sets the number and color of checkers on this cell
- * takes care of repainting
+ * takes care of tqrepainting
*/
virtual void cellUpdate(const int p, const bool cubechanged = false);
@@ -694,7 +698,7 @@ class KBgBoardBar : public KBgBoardCell
/**
* Constructor
*/
- KBgBoardBar( TQWidget * parent, int numID );
+ KBgBoardBar( TQWidget * tqparent, int numID );
/**
* Destructor
@@ -724,17 +728,18 @@ class KBgBoardBar : public KBgBoardCell
class KBgBoardField : public KBgBoardCell
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor and destructor
*/
- KBgBoardField( TQWidget * parent, int numID);
+ KBgBoardField( TQWidget * tqparent, int numID);
virtual ~KBgBoardField();
/**
* sets the number and color of checkers on this cell
- * takes care of repainting
+ * takes care of tqrepainting
*/
virtual void cellUpdate(const int p, const bool cubechanged = false);
@@ -816,22 +821,23 @@ class KBgBoardMove
*
* A very simple dialog with two SpinBoxes and two buttons.
*/
-class KBgBoardQDice : public QDialog
+class KBgBoardTQDice : public TQDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor and destructor
*/
- KBgBoardQDice(const char *name = 0);
- virtual ~KBgBoardQDice();
+ KBgBoardTQDice(const char *name = 0);
+ virtual ~KBgBoardTQDice();
protected:
/**
- * Spin boxes and buttons are children
+ * Spin boxes and buttons are tqchildren
*/
TQSpinBox *sb[2];
TQPushButton *ok;
@@ -849,22 +855,23 @@ public slots:
/**
* Simple dialog that allows to query the user for the cube value.
*/
-class KBgBoardQCube : public QDialog
+class KBgBoardTQCube : public TQDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor and destructor
*/
- KBgBoardQCube(int val, bool us, bool them);
- virtual ~KBgBoardQCube();
+ KBgBoardTQCube(int val, bool us, bool them);
+ virtual ~KBgBoardTQCube();
protected:
/**
- * Spin boxes and buttons are children
+ * Spin boxes and buttons are tqchildren
*/
TQComboBox *cb[2];
TQPushButton *ok;
@@ -897,13 +904,14 @@ protected slots:
class KBgBoardSetup : public KBgBoard
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor
*/
- KBgBoardSetup(TQWidget *parent = 0, const char *name = 0,
+ KBgBoardSetup(TQWidget *tqparent = 0, const char *name = 0,
TQPopupMenu *menu = 0);
/**
diff --git a/kbackgammon/kbgstatus.cpp b/kbackgammon/kbgstatus.cpp
index 4f5db3c0..e9e8d4e5 100644
--- a/kbackgammon/kbgstatus.cpp
+++ b/kbackgammon/kbgstatus.cpp
@@ -29,7 +29,7 @@
/*
* Parse a rawboard description from FIBS and initialize members.
*/
-KBgStatus::KBgStatus(const TQString &rawboard)
+KBgtqStatus::KBgtqStatus(const TQString &rawboard)
{
/*
* This is the format string from hell...
@@ -116,7 +116,7 @@ KBgStatus::KBgStatus(const TQString &rawboard)
* Constructor initializes the status to an empty board with cube one
* and empty dice.
*/
-KBgStatus::KBgStatus()
+KBgtqStatus::KBgtqStatus()
: TQObject()
{
/*
@@ -131,7 +131,7 @@ KBgStatus::KBgStatus()
setHome (i, 0);
setBar (i, 0);
setPoints(i, -1);
- setPlayer(i, TQString::null);
+ setPlayer(i, TQString());
}
setColor(White, US);
setCube(1, BOTH); // also initializes maydouble
@@ -146,7 +146,7 @@ KBgStatus::KBgStatus()
/*
* Copy constructor calls private utility function.
*/
-KBgStatus::KBgStatus(const KBgStatus &rhs)
+KBgtqStatus::KBgtqStatus(const KBgtqStatus &rhs)
: TQObject()
{
copy(rhs);
@@ -155,7 +155,7 @@ KBgStatus::KBgStatus(const KBgStatus &rhs)
/*
* Destructor
*/
-KBgStatus::~KBgStatus()
+KBgtqStatus::~KBgtqStatus()
{
// nothing to do
}
@@ -164,14 +164,14 @@ KBgStatus::~KBgStatus()
* Assignment operator shares a lot of code with the copy
* constructor.
*/
-KBgStatus& KBgStatus::operator=(const KBgStatus &rhs)
+KBgtqStatus& KBgtqStatus::operator=(const KBgtqStatus &rhs)
{
if (this == &rhs) return *this;
copy(rhs);
return *this;
}
-void KBgStatus::copy(const KBgStatus &rhs)
+void KBgtqStatus::copy(const KBgtqStatus &rhs)
{
for (int i = 0; i < 26; i++)
board_[i] = rhs.board_[i];
@@ -199,32 +199,32 @@ void KBgStatus::copy(const KBgStatus &rhs)
/*
* Access functions
*/
-int KBgStatus::board(const int &i) const
+int KBgtqStatus::board(const int &i) const
{
return ((0 < i && i < 25) ? color_*board_[i] : 0);
}
-int KBgStatus::home(const int &w) const
+int KBgtqStatus::home(const int &w) const
{
return ((w == US || w == THEM) ? color_*home_[w] : 0);
}
-int KBgStatus::bar(const int &w) const
+int KBgtqStatus::bar(const int &w) const
{
return ((w == US || w == THEM) ? color_*bar_[w] : 0);
}
-int KBgStatus::color(const int &w) const
+int KBgtqStatus::color(const int &w) const
{
return ((w == THEM) ? -color_ : color_);
}
-int KBgStatus::direction() const
+int KBgtqStatus::direction() const
{
return direction_;
}
-int KBgStatus::dice(const int &w, const int &n) const
+int KBgtqStatus::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 KBgStatus::dice(const int &w, const int &n) const
return 0;
}
-int KBgStatus::cube(const int &w) const
+int KBgtqStatus::cube(const int &w) const
{
if (w == US || w == THEM)
return ((maydouble_[w]) ? cube_ : -cube_);
return 0;
}
-int KBgStatus::points(const int& w) const
+int KBgtqStatus::points(const int& w) const
{
return ((w == US || w == THEM) ? points_[w] : -1);
}
-TQString KBgStatus::player(const int &w) const
+TQString KBgtqStatus::player(const int &w) const
{
- return ((w == US || w == THEM) ? player_[w] : TQString::null);
+ return ((w == US || w == THEM) ? player_[w] : TQString());
}
-int KBgStatus::length() const
+int KBgtqStatus::length() const
{
return length_;
}
-int KBgStatus::turn() const
+int KBgtqStatus::turn() const
{
return turn_;
}
-bool KBgStatus::doubled() const
+bool KBgtqStatus::doubled() const
{
return doubled_;
}
@@ -268,7 +268,7 @@ bool KBgStatus::doubled() const
/*
* Assignment functions
*/
-void KBgStatus::setBoard(const int &i, const int &w, const int &v)
+void KBgtqStatus::setBoard(const int &i, const int &w, const int &v)
{
if (0 < i && i < 25) {
if (w == US)
@@ -278,7 +278,7 @@ void KBgStatus::setBoard(const int &i, const int &w, const int &v)
}
}
-void KBgStatus::setHome(const int &w, const int &v)
+void KBgtqStatus::setHome(const int &w, const int &v)
{
if (w == US)
home_[w] = abs(v);
@@ -286,7 +286,7 @@ void KBgStatus::setHome(const int &w, const int &v)
home_[w] = -abs(v);
}
-void KBgStatus::setBar(const int& w, const int& v)
+void KBgtqStatus::setBar(const int& w, const int& v)
{
if (w == US)
bar_[w] = abs(v);
@@ -294,7 +294,7 @@ void KBgStatus::setBar(const int& w, const int& v)
bar_[w] = -abs(v);
}
-void KBgStatus::setColor(const int &c, const int &w)
+void KBgtqStatus::setColor(const int &c, const int &w)
{
if (w == US)
color_ = ((c < 0) ? Black : White);
@@ -302,12 +302,12 @@ void KBgStatus::setColor(const int &c, const int &w)
color_ = ((c < 0) ? White : Black);
}
-void KBgStatus::setDirection(const int &dir)
+void KBgtqStatus::setDirection(const int &dir)
{
direction_ = ((dir < 0) ? -1 : +1);
}
-void KBgStatus::setDice(const int &w, const int &n, const int &v)
+void KBgtqStatus::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 KBgStatus::setDice(const int &w, const int &n, const int &v)
}
}
-void KBgStatus::setCube(const int &c, const bool &us, const bool &them)
+void KBgtqStatus::setCube(const int &c, const bool &us, const bool &them)
{
int w = NONE;
if (us) w = US;
@@ -326,7 +326,7 @@ void KBgStatus::setCube(const int &c, const bool &us, const bool &them)
setCube(c, w);
}
-void KBgStatus::setCube(const int &c, const int &w)
+void KBgtqStatus::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 KBgStatus::setCube(const int &c, const int &w)
maydouble_[THEM] = (w == THEM || w == BOTH);
}
-void KBgStatus::setPoints(const int &w, const int &p)
+void KBgtqStatus::setPoints(const int &w, const int &p)
{
if (w == US || w == THEM)
points_[w] = p;
}
-void KBgStatus::setPlayer(const int &w, const TQString &name)
+void KBgtqStatus::setPlayer(const int &w, const TQString &name)
{
if (w == US || w == THEM)
player_[w] = name;
}
-void KBgStatus::setLength(const int &l)
+void KBgtqStatus::setLength(const int &l)
{
length_ = l;
}
-void KBgStatus::setTurn(const int &w)
+void KBgtqStatus::setTurn(const int &w)
{
if (w == US || w == THEM || w == BOTH)
turn_ = w;
@@ -364,7 +364,7 @@ void KBgStatus::setTurn(const int &w)
/*
* Utility functions
*/
-int KBgStatus::moves() const
+int KBgtqStatus::moves() const
{
int start, dir;
@@ -407,7 +407,7 @@ int KBgStatus::moves() const
* Get a copy of ourselves. That way we can mess around with
* the internals of the game.
*/
- KBgStatus sc(*this);
+ KBgtqStatus sc(*this);
/*
* Start with getting all checkers off the bar
@@ -490,7 +490,7 @@ int KBgStatus::moves() const
}
}
-bool KBgStatus::movePossible(KBgStatus &sc, int a, int start, int dir) const
+bool KBgtqStatus::movePossible(KBgtqStatus &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 afcc2f6a..05348157 100644
--- a/kbackgammon/kbgstatus.h
+++ b/kbackgammon/kbgstatus.h
@@ -43,10 +43,11 @@
* @author Jens Hoefkens <[email protected]>
* @version $Id$
*/
-class KBgStatus : public QObject
+class KBgtqStatus : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
@@ -65,27 +66,27 @@ class KBgStatus : public QObject
* The default constructor initializes the status to an "empty"
* state. The board and dice are empty and the cube shows 1.
*/
- KBgStatus();
+ KBgtqStatus();
/**
* Constructor from a FIBS rawboard string
*/
- KBgStatus(const TQString &rawboard);
+ KBgtqStatus(const TQString &rawboard);
/**
* Copy constructor
*/
- KBgStatus(const KBgStatus &rhs);
+ KBgtqStatus(const KBgtqStatus &rhs);
/**
* Assignment operator
*/
- KBgStatus& operator=(const KBgStatus &rhs);
+ KBgtqStatus& operator=(const KBgtqStatus &rhs);
/**
* Destructor
*/
- virtual ~KBgStatus();
+ virtual ~KBgtqStatus();
/*
@@ -156,7 +157,7 @@ class KBgStatus : public QObject
/*
* Return the name of player w. If w is out of bounds or if
- * the player names have not been set, TQString::null is
+ * the player names have not been set, TQString() is
* returned.
*/
TQString player(const int &w = US) const;
@@ -231,7 +232,7 @@ class KBgStatus : public QObject
/*
* Set the n-th dice of player w to v. Nothing is done if w is
* invalid or if n is out of bounds. If v is invalid, the
- * value zero is assigned (i.e., the dice is invalidated).
+ * value zero is assigned (i.e., the dice is tqinvalidated).
*/
void setDice(const int &w, const int &n, const int &v);
@@ -288,12 +289,12 @@ class KBgStatus : public QObject
* anywhere starting from start or later into direction
* dir in the game given by sc.
*/
- bool movePossible(KBgStatus &sc, int a, int start, int dir) const;
+ bool movePossible(KBgtqStatus &sc, int a, int start, int dir) const;
/*
* Copy constr. and assignment share a lot of code.
*/
- void copy(const KBgStatus &rhs);
+ void copy(const KBgtqStatus &rhs);
/*
* Private variables with self-expalanatory names.
diff --git a/kbackgammon/kbgtextview.cpp b/kbackgammon/kbgtextview.cpp
index a2199b05..30b8b671 100644
--- a/kbackgammon/kbgtextview.cpp
+++ b/kbackgammon/kbgtextview.cpp
@@ -36,8 +36,8 @@
/*
* Constructor
*/
-KBgTextView::KBgTextView(TQWidget *parent, const char *name)
- : KTextBrowser(parent, name)
+KBgTextView::KBgTextView(TQWidget *tqparent, const char *name)
+ : KTextBrowser(tqparent, name)
{
clear();
setLinkUnderline(true);
diff --git a/kbackgammon/kbgtextview.h b/kbackgammon/kbgtextview.h
index 8b8b8389..87d783a0 100644
--- a/kbackgammon/kbgtextview.h
+++ b/kbackgammon/kbgtextview.h
@@ -36,13 +36,14 @@
class KBgTextView : public KTextBrowser
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructor
*/
- KBgTextView(TQWidget *parent = 0, const char *name = 0);
+ KBgTextView(TQWidget *tqparent = 0, const char *name = 0);
/**
* Destructor