summaryrefslogtreecommitdiffstats
path: root/kbackgammon/engines/gnubg/kbggnubg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kbackgammon/engines/gnubg/kbggnubg.cpp')
-rw-r--r--kbackgammon/engines/gnubg/kbggnubg.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/kbackgammon/engines/gnubg/kbggnubg.cpp b/kbackgammon/engines/gnubg/kbggnubg.cpp
index e6f853a2..1ddc3664 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.tqcontains(TQRegExp("^gnubg rolls [1-6], .* rolls [1-6]\\."))) {
+ if (line.contains(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.tqcontains(TQRegExp("^.* cannot move\\..+$"))) {
+ if (line.contains(TQRegExp("^.* cannot move\\..+$"))) {
KRegExp e("(^.* cannot move.)(.*$)");
e.match(line.latin1());
handleLine(e.group(1));
handleLine(e.group(2));
return;
}
- if (line.tqcontains(TQRegExp("^Are you sure you want to start a new game, and discard the one in progress\\?"))) {
+ if (line.contains(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,7 +113,7 @@ void KBgEngineGNU::handleLine(const TQString &l)
/*
* Cube handling
*/
- if (line.tqcontains(TQRegExp("^gnubg accepts and immediately redoubles to [0-9]+\\.$"))) {
+ if (line.contains(TQRegExp("^gnubg accepts and immediately redoubles to [0-9]+\\.$"))) {
// redoubles mess up the game counter "turn"
@@ -122,7 +122,7 @@ void KBgEngineGNU::handleLine(const TQString &l)
//emit newState(st);
}
- if (line.tqcontains(TQRegExp("^gnubg doubles\\.$"))) {
+ if (line.contains(TQRegExp("^gnubg doubles\\.$"))) {
// TODO: we need some generic class for this. the class
// can be shared between all engines
@@ -155,14 +155,14 @@ void KBgEngineGNU::handleLine(const TQString &l)
/*
* Ignore the following messages
*/
- if (line.tqcontains(TQRegExp("^TTY boards will be given in raw format"))) {
+ if (line.contains(TQRegExp("^TTY boards will be given in raw format"))) {
line = " ";
}
/*
* Board messages
*/
- if (line.tqcontains(TQRegExp("^board:"))) {
+ if (line.contains(TQRegExp("^board:"))) {
KBgtqStatus st(line);
@@ -248,7 +248,7 @@ void KBgEngineGNU::handleLine(const TQString &l)
/*
* Show the line...
*/
- line.tqreplace(TQRegExp(" "), " ");
+ line.replace(TQRegExp(" "), " ");
if (!line.isEmpty())
emit infoText(line);
}
@@ -625,9 +625,9 @@ void KBgEngineGNU::done()
emit allowCommand(Redo, false);
// Transform the string to FIBS format
- lastmove.tqreplace(0, 2, "move ");
- lastmove.tqreplace(TQRegExp("\\+"), " ");
- lastmove.tqreplace(TQRegExp("\\-"), " ");
+ lastmove.replace(0, 2, "move ");
+ lastmove.replace(TQRegExp("\\+"), " ");
+ lastmove.replace(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->tqfind(' ', index));
+ TQString t = s->mid(index, s->find(' ', index));
index += 1 + t.length();
int moves = t.toInt();