rename the following methods:

tqfind find
tqreplace replace
tqcontains contains


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent f6000cffbc
commit 24c5cdc273

@ -135,7 +135,7 @@ included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for "Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means making modifications to it. For a library, complete source code means
all the source code for all modules it tqcontains, plus any associated all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation interface definition files, plus the scripts used to control compilation
and installation of the library. and installation of the library.

@ -110,7 +110,7 @@ void Monopigator::processData(const TQByteArray &data, bool okSoFar)
MonopigatorEntry::MonopigatorEntry(TQListView *tqparent, TQString host, TQString latency, TQString version, TQString users, TQString port, TQString ip) : TQObject(), TQListViewItem(tqparent, host, latency, version, users, port) MonopigatorEntry::MonopigatorEntry(TQListView *tqparent, TQString host, TQString latency, TQString version, TQString users, TQString port, TQString ip) : TQObject(), TQListViewItem(tqparent, host, latency, version, users, port)
{ {
m_isDev = ( version.tqfind( TQRegExp("(CVS|-dev)") ) != -1 ) ? true : false; m_isDev = ( version.find( TQRegExp("(CVS|-dev)") ) != -1 ) ? true : false;
setEnabled(false); setEnabled(false);
tqparent->sort(); tqparent->sort();

@ -298,7 +298,7 @@ void EstateDetails::appendText(TQString text)
KWrappedListViewItem *infoText = new KWrappedListViewItem(m_infoListView, m_infoListView->lastItem(), text); KWrappedListViewItem *infoText = new KWrappedListViewItem(m_infoListView, m_infoListView->lastItem(), text);
if ( text.tqfind( TQRegExp("rolls") ) != -1 ) if ( text.find( TQRegExp("rolls") ) != -1 )
infoText->setPixmap(0, TQPixmap(SmallIcon("roll"))); infoText->setPixmap(0, TQPixmap(SmallIcon("roll")));
else else
infoText->setPixmap(0, TQPixmap(SmallIcon("atlantik"))); infoText->setPixmap(0, TQPixmap(SmallIcon("atlantik")));

@ -83,7 +83,7 @@ void KWrappedListViewItem::wrapColumn( int c )
KWordWrap *wrap = KWordWrap::formatText( fm, rect, 0, m_origText ); KWordWrap *wrap = KWordWrap::formatText( fm, rect, 0, m_origText );
setText( c, wrap->wrappedString() ); setText( c, wrap->wrappedString() );
int lc = text(c).tqcontains( TQChar( '\n' ) ) + 1; int lc = text(c).contains( TQChar( '\n' ) ) + 1;
setHeight( wrap->boundingRect().height() + lc*lv->itemMargin() ); setHeight( wrap->boundingRect().height() + lc*lv->itemMargin() );
widthChanged( c ); widthChanged( c );

@ -68,7 +68,7 @@ void Molek::load (const KSimpleConfig& config)
value = ""; value = "";
strlcpy(current.conn, value.ascii(), sizeof(current.conn)); strlcpy(current.conn, value.ascii(), sizeof(current.conn));
kdWarning( atoms.tqfind(current) != atoms.end() ) kdWarning( atoms.find(current) != atoms.end() )
<< "OOOPS, duplicate atom definition in " << key << endl; << "OOOPS, duplicate atom definition in " << key << endl;
atoms.append(current); atoms.append(current);
atom_index++; atom_index++;

@ -380,7 +380,7 @@ void KBgEngineFIBS::cancelJoin(const TQString &info)
TQRegExp patt = TQRegExp("^" + info + " "); TQRegExp patt = TQRegExp("^" + info + " ");
for (int i = 0; i <= numJoin; i++) { for (int i = 0; i <= numJoin; i++) {
if (actJoin[i]->text().tqcontains(patt)) { if (actJoin[i]->text().contains(patt)) {
// move all entries starting at i+1 up by one... // move all entries starting at i+1 up by one...
for (int j = i; j < numJoin; j++) for (int j = i; j < numJoin; j++)
actJoin[j]->setText(actJoin[j+1]->text()); actJoin[j]->setText(actJoin[j+1]->text());
@ -426,18 +426,18 @@ void KBgEngineFIBS::changeJoin(const TQString &info)
for (TQStringList::Iterator it = invitations.begin(); it != invitations.end(); ++it) { for (TQStringList::Iterator it = invitations.begin(); it != invitations.end(); ++it) {
if ((*it).tqcontains(patt)) { if ((*it).contains(patt)) {
TQString text, menu; TQString text, menu;
if ((*it).tqcontains(TQRegExp(" r$"))) { if ((*it).contains(TQRegExp(" r$"))) {
menu = i18n("R means resume", "%1 (R)").tqarg(name); menu = i18n("R means resume", "%1 (R)").tqarg(name);
text = i18n("%1 (experience %2, rating %3) wants to resume a saved match with you. " 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 " "If you want to play, use the corresponding menu entry to join (or type "
"'join %4').").tqarg(name).tqarg(expi_s).tqarg(rate_s).tqarg(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"). KNotifyClient::event("invitation", i18n("%1 wants to resume a saved match with you").
arg(name)); arg(name));
} else if ((*it).tqcontains(TQRegExp(" u$"))) { } else if ((*it).contains(TQRegExp(" u$"))) {
menu = i18n("U means unlimited", "%1 (U)").tqarg(name); menu = i18n("U means unlimited", "%1 (U)").tqarg(name);
text = i18n("%1 (experience %2, rating %3) wants to play an unlimited match with you. " 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 " "If you want to play, use the corresponding menu entry to join (or type "
@ -578,8 +578,8 @@ void KBgEngineFIBS::done()
emit allowCommand(Roll, false); emit allowCommand(Roll, false);
// Transform the string to FIBS cormat // Transform the string to FIBS cormat
lastMove.tqreplace(0, 2, "move "); lastMove.replace(0, 2, "move ");
lastMove.tqreplace(pat[PlsChar], "-"); lastMove.replace(pat[PlsChar], "-");
// sent it to the server // sent it to the server
emit serverString(lastMove); emit serverString(lastMove);
@ -809,7 +809,7 @@ void KBgEngineFIBS::load()
*/ */
void KBgEngineFIBS::join(const TQString &msg) void KBgEngineFIBS::join(const TQString &msg)
{ {
emit serverString("join " + msg.left(msg.tqfind('('))); emit serverString("join " + msg.left(msg.find('(')));
} }
void KBgEngineFIBS::join_0() { join(actJoin[0]->text()); } void KBgEngineFIBS::join_0() { join(actJoin[0]->text()); }
void KBgEngineFIBS::join_1() { join(actJoin[1]->text()); } void KBgEngineFIBS::join_1() { join(actJoin[1]->text()); }
@ -1094,7 +1094,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin)
first = false; first = false;
} }
} while (ret && (msg.isEmpty() || msg.tqcontains(' ') || msg.tqcontains(':'))); } while (ret && (msg.isEmpty() || msg.contains(' ') || msg.contains(':')));
if (ret) if (ret)
infoFIBS[FIBSUser] = msg; infoFIBS[FIBSUser] = msg;
@ -1130,7 +1130,7 @@ bool KBgEngineFIBS::queryConnection(const bool newlogin)
first = false; first = false;
} }
} while (ret && (msg.isEmpty() || msg.tqcontains(' ') || msg.tqcontains(':'))); } while (ret && (msg.isEmpty() || msg.contains(' ') || msg.contains(':')));
if (ret) if (ret)
infoFIBS[FIBSPswd] = msg; infoFIBS[FIBSPswd] = msg;
@ -1281,13 +1281,13 @@ void KBgEngineFIBS::handleServerData(TQString &line)
/* /*
* Fix-up any HTML-like tags in the line * Fix-up any HTML-like tags in the line
*/ */
line.tqreplace(pat[HTML_lt], "&lt;"); line.replace(pat[HTML_lt], "&lt;");
line.tqreplace(pat[HTML_gt], "&gt;"); line.replace(pat[HTML_gt], "&gt;");
/* /*
* FIBS sometimes sends tabs, where it should send 8 spaces... * FIBS sometimes sends tabs, where it should send 8 spaces...
*/ */
line.tqreplace(pat[TabChar], " "); line.replace(pat[TabChar], " ");
switch (rxtqStatus) { switch (rxtqStatus) {
@ -1344,7 +1344,7 @@ void KBgEngineFIBS::handleServerData(TQString &line)
void KBgEngineFIBS::handleMessageWhois(const TQString &line) void KBgEngineFIBS::handleMessageWhois(const TQString &line)
{ {
rxCollect += "<br>&nbsp;&nbsp;&nbsp;&nbsp;" + line; rxCollect += "<br>&nbsp;&nbsp;&nbsp;&nbsp;" + line;
if (line.tqcontains(pat[WhoisE1]) || line.tqcontains(pat[WhoisE2])) { if (line.contains(pat[WhoisE1]) || line.contains(pat[WhoisE2])) {
rxtqStatus = RxNormal; rxtqStatus = RxNormal;
emit infoText("<font color=\"darkgreen\">" + rxCollect + "<br></font>"); emit infoText("<font color=\"darkgreen\">" + rxCollect + "<br></font>");
} }
@ -1356,7 +1356,7 @@ void KBgEngineFIBS::handleMessageWhois(const TQString &line)
void KBgEngineFIBS::handleMessageRating(const TQString &line) void KBgEngineFIBS::handleMessageRating(const TQString &line)
{ {
rxCollect += "<br>" + line; rxCollect += "<br>" + line;
if (line.tqcontains(pat[EndRate]) && ++rxCount == 2) { if (line.contains(pat[EndRate]) && ++rxCount == 2) {
emit infoText("<font color=\"blue\">" + rxCollect + "<br></font>"); emit infoText("<font color=\"blue\">" + rxCollect + "<br></font>");
rxtqStatus = RxNormal; rxtqStatus = RxNormal;
} }
@ -1367,7 +1367,7 @@ void KBgEngineFIBS::handleMessageRating(const TQString &line)
*/ */
void KBgEngineFIBS::handleMessageMotd(const TQString &line) void KBgEngineFIBS::handleMessageMotd(const TQString &line)
{ {
if (line.tqcontains(pat[MotdEnd])) { if (line.contains(pat[MotdEnd])) {
rxtqStatus = RxNormal; rxtqStatus = RxNormal;
emit infoText("<font color=\"blue\"><pre>" + rxCollect + "</pre></font>"); emit infoText("<font color=\"blue\"><pre>" + rxCollect + "</pre></font>");
/* /*
@ -1378,9 +1378,9 @@ void KBgEngineFIBS::handleMessageMotd(const TQString &line)
emit serverString("set boardstyle 3"); emit serverString("set boardstyle 3");
} else { } else {
TQString tline = line; TQString tline = line;
tline.tqreplace(pat[BoxHori], "<br><hr>"); tline.replace(pat[BoxHori], "<br><hr>");
tline.tqreplace(pat[BoxVer1], ""); tline.replace(pat[BoxVer1], "");
tline.tqreplace(pat[BoxVer2], ""); tline.replace(pat[BoxVer2], "");
rxCollect += "<br>" + tline; rxCollect += "<br>" + tline;
} }
} }
@ -1393,7 +1393,7 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r
/* /*
* Two possibilities: either we are logged in or we sent bad password/login * Two possibilities: either we are logged in or we sent bad password/login
*/ */
if (line.tqcontains("login:")) { if (line.contains("login:")) {
/* /*
* This can only happen if the password/login is wrong. * This can only happen if the password/login is wrong.
*/ */
@ -1428,7 +1428,7 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r
* Ok, we are logged in! Now receive personal information. These * Ok, we are logged in! Now receive personal information. These
* are completely useless but what the heck. * are completely useless but what the heck.
*/ */
if (line.tqcontains(pat[Welcome])) { if (line.contains(pat[Welcome])) {
char p[3][256]; char p[3][256];
time_t tmp; time_t tmp;
// Using latin1() is okay, since the string comes from FIBS. // Using latin1() is okay, since the string comes from FIBS.
@ -1471,7 +1471,7 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r
* p[3] - timezone * p[3] - timezone
* *
*/ */
if (line.tqcontains(pat[OwnInfo])) { if (line.contains(pat[OwnInfo])) {
rxtqStatus = RxNormal; rxtqStatus = RxNormal;
@ -1537,7 +1537,7 @@ void KBgEngineFIBS::handleMessageConnect(const TQString &line, const TQString &r
/* /*
* The beginning of a new login procedure starts starts here * The beginning of a new login procedure starts starts here
*/ */
if (line.tqcontains(pat[OneName])) { if (line.contains(pat[OneName])) {
rxtqStatus = RxNewLogin; rxtqStatus = RxNewLogin;
emit infoText(TQString("<font color=\"red\">") + rxCollect + "</font>"); emit infoText(TQString("<font color=\"red\">") + rxCollect + "</font>");
rxCollect = ""; rxCollect = "";
@ -1560,14 +1560,14 @@ void KBgEngineFIBS::handleMessageNewLogin(const TQString &line)
/* /*
* Request the new login * Request the new login
*/ */
if (line.tqcontains(pat[OneName])) { if (line.contains(pat[OneName])) {
emit serverString(TQString("name ") + infoFIBS[FIBSUser]); emit serverString(TQString("name ") + infoFIBS[FIBSUser]);
return; return;
} }
/* /*
* Ooops, user name already exists * Ooops, user name already exists
*/ */
if (line.tqcontains(pat[OthrNam])) { if (line.contains(pat[OthrNam])) {
TQString text = i18n("The selected login is alreay in use! Please select another one."); TQString text = i18n("The selected login is alreay in use! Please select another one.");
bool ret, first = true; bool ret, first = true;
TQString msg; TQString msg;
@ -1579,7 +1579,7 @@ void KBgEngineFIBS::handleMessageNewLogin(const TQString &line)
text += i18n("\n\nThe login may not contain spaces or colons!"); text += i18n("\n\nThe login may not contain spaces or colons!");
first = false; first = false;
} }
} while (msg.tqcontains(' ') || msg.tqcontains(':')); } while (msg.contains(' ') || msg.contains(':'));
if (ret) { if (ret) {
infoFIBS[FIBSUser] = msg; infoFIBS[FIBSUser] = msg;
@ -1592,21 +1592,21 @@ void KBgEngineFIBS::handleMessageNewLogin(const TQString &line)
/* /*
* first time we send the password * first time we send the password
*/ */
if (line.tqcontains(pat[YourNam])) { if (line.contains(pat[YourNam])) {
emit serverString(infoFIBS[FIBSPswd]); emit serverString(infoFIBS[FIBSPswd]);
return; return;
} }
/* /*
* second time we send the password * second time we send the password
*/ */
if (line.tqcontains(pat[GivePwd])) { if (line.contains(pat[GivePwd])) {
emit serverString(infoFIBS[FIBSPswd]); emit serverString(infoFIBS[FIBSPswd]);
return; return;
} }
/* /*
* at this point we are done creating the account * at this point we are done creating the account
*/ */
if (line.tqcontains(pat[RetypeP])) { if (line.contains(pat[RetypeP])) {
TQString text = i18n("Your account has been created. Your new login is <u>%1</u>. To fully activate " 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 " "this account, I will now close the connection. Once you reconnect, you can start "
@ -1632,7 +1632,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* For now, the waves are ignored. They should probably go into * For now, the waves are ignored. They should probably go into
* the chat window -- but only optional * the chat window -- but only optional
*/ */
if (line.tqcontains(pat[OneWave]) || line.tqcontains(pat[TwoWave]) || line.tqcontains(pat[YouWave])) { if (line.contains(pat[OneWave]) || line.contains(pat[TwoWave]) || line.contains(pat[YouWave])) {
return; 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 * ever gets a games window, they should be in there. For now, they
* are ignored. * are ignored.
*/ */
else if (line.tqcontains(pat[GameBG1]) || line.tqcontains(pat[GameBG2]) || line.tqcontains(pat[GameRE1]) || else if (line.contains(pat[GameBG1]) || line.contains(pat[GameBG2]) || line.contains(pat[GameRE1]) ||
line.tqcontains(pat[GameRE2]) || line.tqcontains(pat[GameEnd])) { line.contains(pat[GameRE2]) || line.contains(pat[GameEnd])) {
return; return;
} }
@ -1651,7 +1651,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/* /*
* Artefact caused by the login test procedure utilized. * Artefact caused by the login test procedure utilized.
*/ */
else if (line.tqcontains(pat[NoLogin])) { else if (line.contains(pat[NoLogin])) {
return; return;
} }
@ -1659,7 +1659,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/* /*
* Connection keep-alive response * Connection keep-alive response
*/ */
else if (line.tqcontains(pat[KeepAlv])) { else if (line.contains(pat[KeepAlv])) {
return; return;
} }
@ -1670,10 +1670,10 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* Chat and personal messages - note that the chat window sends these messages * 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. * back to us so we can display them if the user wants that.
*/ */
else if (line.tqcontains(pat[ChatSay]) || line.tqcontains(pat[ChatSht]) || line.tqcontains(pat[ChatWis]) || else if (line.contains(pat[ChatSay]) || line.contains(pat[ChatSht]) || line.contains(pat[ChatWis]) ||
line.tqcontains(pat[ChatKib]) || line.tqcontains(pat[SelfSay]) || line.tqcontains(pat[SelfSht]) || line.contains(pat[ChatKib]) || line.contains(pat[SelfSay]) || line.contains(pat[SelfSht]) ||
line.tqcontains(pat[SelfWis]) || line.tqcontains(pat[SelfKib]) || line.tqcontains(pat[SelfSlf]) || line.contains(pat[SelfWis]) || line.contains(pat[SelfKib]) || line.contains(pat[SelfSlf]) ||
line.tqcontains(pat[MsgPers]) || line.tqcontains(pat[MsgDeli]) || line.tqcontains(pat[MsgSave])) { line.contains(pat[MsgPers]) || line.contains(pat[MsgDeli]) || line.contains(pat[MsgSave])) {
emit chatMessage(line); emit chatMessage(line);
return; 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. * Beginning of games. In all these cases we are playing and not watching.
*/ */
else if (line.tqcontains(pat[MatchB1]) || line.tqcontains(pat[MatchB2])) { else if (line.contains(pat[MatchB1]) || line.contains(pat[MatchB2])) {
if (useAutoMsg[MsgBeg] && !autoMsg[MsgBeg].stripWhiteSpace().isEmpty()) if (useAutoMsg[MsgBeg] && !autoMsg[MsgBeg].stripWhiteSpace().isEmpty())
emit serverString("kibitz " + autoMsg[MsgBeg]); emit serverString("kibitz " + autoMsg[MsgBeg]);
} }
else if (line.tqcontains(pat[MatchB3]) || line.tqcontains(pat[MatchB4])) { else if (line.contains(pat[MatchB3]) || line.contains(pat[MatchB4])) {
if (useAutoMsg[MsgBeg] && !autoMsg[MsgBeg].stripWhiteSpace().isEmpty()) if (useAutoMsg[MsgBeg] && !autoMsg[MsgBeg].stripWhiteSpace().isEmpty())
emit serverString("kibitz " + autoMsg[MsgBeg]); 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 * The help should be handled separately. A fairly complete implementation of a
* help parsing can be found in KFibs. * help parsing can be found in KFibs.
*/ */
else if (line.tqcontains(pat[HelpTxt])) { else if (line.contains(pat[HelpTxt])) {
// do nothing // do nothing
} }
@ -1712,7 +1712,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/* /*
* Simple cases without the need for many comments... * Simple cases without the need for many comments...
*/ */
else if (line.tqcontains(pat[RawBord])) { else if (line.contains(pat[RawBord])) {
/* /*
* Save the board string and create a new game state * Save the board string and create a new game state
@ -1766,7 +1766,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
return; return;
} }
else if (line.tqcontains(pat[PlsMove]) || line.tqcontains(pat[YouMove])) { else if (line.contains(pat[PlsMove]) || line.contains(pat[YouMove])) {
KNotifyClient::event("move", i18n("Please make your move")); KNotifyClient::event("move", i18n("Please make your move"));
@ -1777,13 +1777,13 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/* /*
* Being away and coming back * Being away and coming back
*/ */
else if (line.tqcontains(pat[YouAway])) { else if (line.contains(pat[YouAway])) {
emit changePlayertqStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, true); emit changePlayertqStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, true);
actBack->setEnabled(true); actBack->setEnabled(true);
line += "<br><pre> </pre>" + i18n("(or use the corresponding menu entry to join the match)"); line += "<br><pre> </pre>" + i18n("(or use the corresponding menu entry to join the match)");
} }
else if (line.tqcontains(pat[YouBack])) { else if (line.contains(pat[YouBack])) {
emit changePlayertqStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, false); emit changePlayertqStatus(infoFIBS[FIBSUser], KFibsPlayerList::Away, false);
actBack->setEnabled(false); actBack->setEnabled(false);
@ -1795,7 +1795,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/* /*
* Catch the response of the user responding to double or resign * Catch the response of the user responding to double or resign
*/ */
else if (line.tqcontains(pat[YouGive]) || line.tqcontains(pat[RejCont]) || line.tqcontains(pat[AcptWin])) { else if (line.contains(pat[YouGive]) || line.contains(pat[RejCont]) || line.contains(pat[AcptWin])) {
actAccept->setEnabled(false); actAccept->setEnabled(false);
actReject->setEnabled(false); actReject->setEnabled(false);
@ -1806,20 +1806,20 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/* /*
* Catch the responses to newly set toggles * Catch the responses to newly set toggles
*/ */
else if (line.tqcontains(pat[GreedyY]) || line.tqcontains(pat[GreedyN])) { else if (line.contains(pat[GreedyY]) || line.contains(pat[GreedyN])) {
fibsOpt[OptGreedy]->setChecked(line.tqcontains(pat[GreedyY])); fibsOpt[OptGreedy]->setChecked(line.contains(pat[GreedyY]));
line = "<font color=\"red\">" + line + "</font>"; line = "<font color=\"red\">" + line + "</font>";
} }
else if (line.tqcontains(pat[DoubleY]) || line.tqcontains(pat[DoubleN])) { else if (line.contains(pat[DoubleY]) || line.contains(pat[DoubleN])) {
fibsOpt[OptDouble]->setChecked(line.tqcontains(pat[DoubleY])); fibsOpt[OptDouble]->setChecked(line.contains(pat[DoubleY]));
line = "<font color=\"red\">" + line + "</font>"; line = "<font color=\"red\">" + line + "</font>";
} }
else if (line.tqcontains(pat[RatingY]) || line.tqcontains(pat[RatingN])) { else if (line.contains(pat[RatingY]) || line.contains(pat[RatingN])) {
fibsOpt[OptRatings]->setChecked(line.tqcontains(pat[RatingY])); fibsOpt[OptRatings]->setChecked(line.contains(pat[RatingY]));
line = "<font color=\"red\">" + line + "</font>"; 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 * It's our turn to roll or double
*/ */
else if (line.tqcontains(pat[YouTurn]) || line.tqcontains(pat[YouRoll])) { else if (line.contains(pat[YouTurn]) || line.contains(pat[YouRoll])) {
emit allowCommand(Cube, playing); emit allowCommand(Cube, playing);
emit allowCommand(Roll, playing); emit allowCommand(Roll, playing);
@ -1843,17 +1843,17 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/* /*
* Got an invitation for a match * Got an invitation for a match
*/ */
else if (line.tqcontains(pat[Invite0]) || line.tqcontains(pat[Invite2]) || line.tqcontains(pat[Invite3])) { else if (line.contains(pat[Invite0]) || line.contains(pat[Invite2]) || line.contains(pat[Invite3])) {
rxCollect = rawline.left(rawline.tqfind(' ')); rxCollect = rawline.left(rawline.find(' '));
emit serverString("rawwho " + rxCollect); emit serverString("rawwho " + rxCollect);
if (line.tqcontains(pat[Invite0])) { if (line.contains(pat[Invite0])) {
rawline.tqreplace(pat[Invite1], ""); rawline.replace(pat[Invite1], "");
rawline = rxCollect + " "+ rawline.left(rawline.tqfind(' ')); rawline = rxCollect + " "+ rawline.left(rawline.find(' '));
} else if (line.tqcontains(pat[Invite2])) { } else if (line.contains(pat[Invite2])) {
rawline = rxCollect + " r"; rawline = rxCollect + " r";
} else if (line.tqcontains(pat[Invite3])) { } else if (line.contains(pat[Invite3])) {
invitations += rxCollect + " u"; invitations += rxCollect + " u";
} }
invitations += rawline; invitations += rawline;
@ -1862,23 +1862,23 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
// - rx status changes ------------------------------------------------------------ // - rx status changes ------------------------------------------------------------
else if (line.tqcontains(pat[WhoisBG])) { else if (line.contains(pat[WhoisBG])) {
rxtqStatus = RxWhois; rxtqStatus = RxWhois;
rxCollect = TQString("<br><u>") + line + "</u>"; rxCollect = TQString("<br><u>") + line + "</u>";
return; return;
} }
else if (line.tqcontains(pat[MotdBeg])) { else if (line.contains(pat[MotdBeg])) {
rxtqStatus = RxMotd; rxtqStatus = RxMotd;
rxCollect = ""; rxCollect = "";
return; return;
} }
else if (line.tqcontains(pat[BegRate])) { else if (line.contains(pat[BegRate])) {
rxtqStatus = RxRating; rxtqStatus = RxRating;
rxCount = 0; rxCount = 0;
rxCollect = "<br>" + line; rxCollect = "<br>" + line;
return; return;
} }
else if (line.tqcontains(pat[Goodbye])) { else if (line.contains(pat[Goodbye])) {
rxtqStatus = RxGoodbye; rxtqStatus = RxGoodbye;
rxCollect = "<br><hr><br>"; rxCollect = "<br><hr><br>";
handleServerData(rawline); // danger: recursion! handleServerData(rawline); // danger: recursion!
@ -1893,7 +1893,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/* /*
* Continue a mutli game match? We have to either leave or continue * Continue a mutli game match? We have to either leave or continue
*/ */
else if (line.tqcontains(pat[ConLeav])) { else if (line.contains(pat[ConLeav])) {
actConti->setEnabled(true); actConti->setEnabled(true);
actLeave->setEnabled(true); actLeave->setEnabled(true);
line.append("<br><pre> </pre>" + i18n("(or use the corresponding menu " 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 * Beginning and end of user updates
*/ */
else if (line.tqcontains(pat[WhoInfo])) { else if (line.contains(pat[WhoInfo])) {
rawline.tqreplace(pat[WhoInfo], ""); rawline.replace(pat[WhoInfo], "");
if (rawline.tqcontains(TQRegExp("^" + infoFIBS[FIBSUser] + " "))) { if (rawline.contains(TQRegExp("^" + infoFIBS[FIBSUser] + " "))) {
int ready; int ready;
// Using latin1() is fine, since the string is coming from FIBS. // 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); 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); emit fibsWhoInfo(rawline);
return; return;
} }
else if (line.tqcontains(pat[WhoEnde])) { else if (line.contains(pat[WhoEnde])) {
emit fibsWhoEnd(); emit fibsWhoEnd();
return; return;
} }
@ -1921,34 +1921,34 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* This message is ignored. The instruction is given elsewhere (and slightly * This message is ignored. The instruction is given elsewhere (and slightly
* delayed in the flow of time). * delayed in the flow of time).
*/ */
if (line.tqcontains(pat[TypJoin])) { if (line.contains(pat[TypJoin])) {
return; return;
} }
/* /*
* Watching other players * Watching other players
*/ */
else if (line.tqcontains(pat[BegWtch])) { else if (line.contains(pat[BegWtch])) {
emit allowCommand(Load, true); emit allowCommand(Load, true);
rawline.tqreplace(pat[BegWtch], ""); rawline.replace(pat[BegWtch], "");
rawline.truncate(rawline.length()-1); rawline.truncate(rawline.length()-1);
emit fibsStartNewGame(rawline); emit fibsStartNewGame(rawline);
load(); load();
} }
else if (line.tqcontains(pat[EndWtch])) { else if (line.contains(pat[EndWtch])) {
emit gameOver(); emit gameOver();
} }
/* /*
* Blinding of players, the actual blind is handled by * Blinding of players, the actual blind is handled by
* the player list * the player list
*/ */
else if (line.tqcontains(pat[BegBlnd])) { else if (line.contains(pat[BegBlnd])) {
rawline.tqreplace(pat[BegBlnd], ""); rawline.replace(pat[BegBlnd], "");
rawline.truncate(rawline.length()-1); rawline.truncate(rawline.length()-1);
emit changePlayertqStatus(rawline, KFibsPlayerList::Blind, true); emit changePlayertqStatus(rawline, KFibsPlayerList::Blind, true);
line = "<font color=\"red\">" + line + "</font>"; line = "<font color=\"red\">" + line + "</font>";
} }
else if (line.tqcontains(pat[EndBlnd])) { else if (line.contains(pat[EndBlnd])) {
rawline.tqreplace(pat[EndBlnd], ""); rawline.replace(pat[EndBlnd], "");
rawline.truncate(rawline.length()-1); rawline.truncate(rawline.length()-1);
emit changePlayertqStatus(rawline, KFibsPlayerList::Blind, false); emit changePlayertqStatus(rawline, KFibsPlayerList::Blind, false);
line = "<font color=\"red\">" + line + "</font>"; line = "<font color=\"red\">" + line + "</font>";
@ -1956,8 +1956,8 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/* /*
* Starting or reloading games or matches * Starting or reloading games or matches
*/ */
else if (line.tqcontains(pat[BegGame])) { else if (line.contains(pat[BegGame])) {
rawline.tqreplace(pat[BegGame], ""); rawline.replace(pat[BegGame], "");
rawline.truncate(rawline.length()-1); rawline.truncate(rawline.length()-1);
emit fibsStartNewGame(rawline); emit fibsStartNewGame(rawline);
fibsOpt[OptDouble]->setChecked(true); fibsOpt[OptDouble]->setChecked(true);
@ -1965,9 +1965,9 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
actConti->setEnabled(false); actConti->setEnabled(false);
actLeave->setEnabled(false); actLeave->setEnabled(false);
} }
else if (line.tqcontains(pat[Reload1])) { else if (line.contains(pat[Reload1])) {
rawline.tqreplace(pat[Reload1], ""); rawline.replace(pat[Reload1], "");
rawline = rawline.left(rawline.tqfind(' ')); rawline = rawline.left(rawline.find(' '));
rawline.truncate(rawline.length()-1); rawline.truncate(rawline.length()-1);
emit fibsStartNewGame(rawline); emit fibsStartNewGame(rawline);
fibsOpt[OptDouble]->setChecked(true); fibsOpt[OptDouble]->setChecked(true);
@ -1976,8 +1976,8 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
actLeave->setEnabled(false); actLeave->setEnabled(false);
load(); load();
} }
else if (line.tqcontains(pat[Reload2])) { else if (line.contains(pat[Reload2])) {
rawline.tqreplace(pat[Reload2], ""); rawline.replace(pat[Reload2], "");
emit fibsStartNewGame(rawline); emit fibsStartNewGame(rawline);
fibsOpt[OptDouble]->setChecked(true); fibsOpt[OptDouble]->setChecked(true);
fibsOpt[OptGreedy]->setChecked(false); 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 * Opponent offered resignation or the cube. We have to accept
* or reject the offer. * or reject the offer.
*/ */
else if (line.tqcontains(pat[RejAcpt])) { else if (line.contains(pat[RejAcpt])) {
actAccept->setEnabled(true); actAccept->setEnabled(true);
actReject->setEnabled(true); actReject->setEnabled(true);
line += "<br><pre> </pre>" + i18n("(or use the corresponding menu " 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 * This is strange: FIBS seems to not send a newline at the
* end of this pattern. So we work around that. * end of this pattern. So we work around that.
*/ */
else if (line.tqcontains(pat[YouAcpt])) { else if (line.contains(pat[YouAcpt])) {
actAccept->setEnabled(false); actAccept->setEnabled(false);
actReject->setEnabled(false); actReject->setEnabled(false);
rawline.tqreplace(pat[YouAcpt], ""); rawline.replace(pat[YouAcpt], "");
line.truncate(line.length()-rawline.length()); line.truncate(line.length()-rawline.length());
if (!rawline.stripWhiteSpace().isEmpty()) { if (!rawline.stripWhiteSpace().isEmpty()) {
handleServerData(rawline); handleServerData(rawline);
@ -2011,7 +2011,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
/* /*
* Ending of games * Ending of games
*/ */
else if (line.tqcontains(pat[EndLose])) { else if (line.contains(pat[EndLose])) {
if (playing) { if (playing) {
KNotifyClient::event("game over l", i18n("Sorry, you lost the game.")); KNotifyClient::event("game over l", i18n("Sorry, you lost the game."));
if (useAutoMsg[MsgLos] && !autoMsg[MsgLos].stripWhiteSpace().isEmpty()) if (useAutoMsg[MsgLos] && !autoMsg[MsgLos].stripWhiteSpace().isEmpty())
@ -2019,7 +2019,7 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
} }
emit gameOver(); emit gameOver();
} }
else if (line.tqcontains(pat[EndVict])) { else if (line.contains(pat[EndVict])) {
if (playing) { if (playing) {
KNotifyClient::event("game over w", i18n("Congratulations, you won the game!")); KNotifyClient::event("game over w", i18n("Congratulations, you won the game!"));
if (useAutoMsg[MsgWin] && !autoMsg[MsgWin].stripWhiteSpace().isEmpty()) if (useAutoMsg[MsgWin] && !autoMsg[MsgWin].stripWhiteSpace().isEmpty())
@ -2027,24 +2027,24 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
} }
emit gameOver(); emit gameOver();
} }
else if (line.tqcontains(pat[GameSav])) { else if (line.contains(pat[GameSav])) {
emit gameOver(); emit gameOver();
} }
/* /*
* User logs out. This has to be signalled to the player * User logs out. This has to be signalled to the player
* list. Get the true user names by working on the rawline. * list. Get the true user names by working on the rawline.
*/ */
else if (line.tqcontains(pat[UserLot])) { else if (line.contains(pat[UserLot])) {
rawline.tqreplace(pat[UserLot], ""); rawline.replace(pat[UserLot], "");
emit fibsLogout(rawline.left(rawline.tqfind(' '))); emit fibsLogout(rawline.left(rawline.find(' ')));
return; return;
} }
/* /*
* Emit the name of the newly logged in user. * Emit the name of the newly logged in user.
*/ */
else if (line.tqcontains(pat[UserLin])) { else if (line.contains(pat[UserLin])) {
rawline.tqreplace(pat[UserLin], ""); rawline.replace(pat[UserLin], "");
emit fibsLogin(rawline.left(rawline.tqfind(' '))); emit fibsLogin(rawline.left(rawline.find(' ')));
return; return;
} }
/* /*
@ -2052,11 +2052,11 @@ void KBgEngineFIBS::handleMessageNormal(TQString &line, TQString &rawline)
* the 'boardstyle' variable, since we will not be able to display * the 'boardstyle' variable, since we will not be able to display
* the board properly without it. * the board properly without it.
*/ */
else if (line.tqcontains(pat[BoardSY])) { else if (line.contains(pat[BoardSY])) {
// ignored // ignored
return; return;
} }
else if (line.tqcontains(pat[BoardSN])) { else if (line.contains(pat[BoardSN])) {
emit serverString("set boardstyle 3"); emit serverString("set boardstyle 3");
emit infoText(TQString("<font color=\"red\"><br>") emit infoText(TQString("<font color=\"red\"><br>")
+ i18n("You should never set the 'boardstyle' variable " + 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. * hasn't been processed, make it red, since it is a server resp.
* to something we just did. * to something we just did.
*/ */
else if (line.tqcontains(pat[TwoStar])) { else if (line.contains(pat[TwoStar])) {
line = "<font color=\"red\">" + line + "</font>"; line = "<font color=\"red\">" + line + "</font>";
} }

@ -446,7 +446,7 @@ void KBgChat::hideEvent(TQHideEvent *e)
*/ */
void KBgChat::startGame(const TQString &name) void KBgChat::startGame(const TQString &name)
{ {
int *id = d->mName2ID->tqfind(d->mName[1] = name); int *id = d->mName2ID->find(d->mName[1] = name);
if (!id) { if (!id) {
id = new int(nextId()); id = new int(nextId());
d->mName2ID->insert(name, id); d->mName2ID->insert(name, id);
@ -460,7 +460,7 @@ void KBgChat::startGame(const TQString &name)
*/ */
void KBgChat::endGame() void KBgChat::endGame()
{ {
int *id = d->mName2ID->tqfind(d->mName[1]); int *id = d->mName2ID->find(d->mName[1]);
if (id) if (id)
setSendingEntry(*id); setSendingEntry(*id);
else else
@ -472,7 +472,7 @@ void KBgChat::endGame()
*/ */
void KBgChat::fibsTalk(const TQString &name) void KBgChat::fibsTalk(const TQString &name)
{ {
int *id = d->mName2ID->tqfind(name); int *id = d->mName2ID->find(name);
if (!id) { if (!id) {
id = new int(nextId()); id = new int(nextId());
d->mName2ID->insert(name, id); d->mName2ID->insert(name, id);
@ -486,7 +486,7 @@ void KBgChat::fibsTalk(const TQString &name)
*/ */
void KBgChat::deletePlayer(const TQString &name) void KBgChat::deletePlayer(const TQString &name)
{ {
int *id = d->mName2ID->tqfind(name); int *id = d->mName2ID->find(name);
if (id) { if (id) {
removeSendingEntry(*id); removeSendingEntry(*id);
d->mName2ID->remove(name); d->mName2ID->remove(name);
@ -535,21 +535,21 @@ void KBgChat::handleCommand(int id, const TQString& msg)
*/ */
void KBgChat::handleData(const TQString &msg) void KBgChat::handleData(const TQString &msg)
{ {
TQString clip = msg.left(msg.tqfind(' ')), user, cMsg = msg; TQString clip = msg.left(msg.find(' ')), user, cMsg = msg;
TQDateTime date; TQDateTime date;
bool flag = false; bool flag = false;
int cmd = clip.toInt(&flag); int cmd = clip.toInt(&flag);
if (flag) { if (flag) {
cMsg.tqreplace(0, cMsg.tqfind(' ')+1, ""); cMsg.replace(0, cMsg.find(' ')+1, "");
user = cMsg.left(cMsg.tqfind(' ')); user = cMsg.left(cMsg.find(' '));
switch (cmd) { switch (cmd) {
case CLIP_SAYS: case CLIP_SAYS:
if (!d->mGag.tqcontains(user)) { if (!d->mGag.contains(user)) {
cMsg = i18n("<u>%1 tells you:</u> %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), "")); cMsg = i18n("<u>%1 tells you:</u> %2").tqarg(user).tqarg(cMsg.replace(TQRegExp("^" + user), ""));
cMsg = "<font color=\"red\">" + cMsg + "</font>"; cMsg = "<font color=\"red\">" + cMsg + "</font>";
emit personalMessage(cMsg); emit personalMessage(cMsg);
} else } else
@ -557,16 +557,16 @@ void KBgChat::handleData(const TQString &msg)
break; break;
case CLIP_SHOUTS: case CLIP_SHOUTS:
if ((!((KToggleAction *)d->mAct[KBgChatPrivate::Silent])->isChecked()) && (!d->mGag.tqcontains(user))) { if ((!((KToggleAction *)d->mAct[KBgChatPrivate::Silent])->isChecked()) && (!d->mGag.contains(user))) {
cMsg = i18n("<u>%1 shouts:</u> %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), "")); cMsg = i18n("<u>%1 shouts:</u> %2").tqarg(user).tqarg(cMsg.replace(TQRegExp("^" + user), ""));
cMsg = "<font color=\"black\">" + cMsg + "</font>"; cMsg = "<font color=\"black\">" + cMsg + "</font>";
} else } else
cMsg = ""; cMsg = "";
break; break;
case CLIP_WHISPERS: case CLIP_WHISPERS:
if (!d->mGag.tqcontains(user)) { if (!d->mGag.contains(user)) {
cMsg = i18n("<u>%1 whispers:</u> %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), "")); cMsg = i18n("<u>%1 whispers:</u> %2").tqarg(user).tqarg(cMsg.replace(TQRegExp("^" + user), ""));
cMsg = "<font color=\"red\">" + cMsg + "</font>"; cMsg = "<font color=\"red\">" + cMsg + "</font>";
emit personalMessage(cMsg); emit personalMessage(cMsg);
} else } else
@ -574,8 +574,8 @@ void KBgChat::handleData(const TQString &msg)
break; break;
case CLIP_KIBITZES: case CLIP_KIBITZES:
if (!d->mGag.tqcontains(user)) { if (!d->mGag.contains(user)) {
cMsg = i18n("<u>%1 kibitzes:</u> %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), "")); cMsg = i18n("<u>%1 kibitzes:</u> %2").tqarg(user).tqarg(cMsg.replace(TQRegExp("^" + user), ""));
cMsg = "<font color=\"red\">" + cMsg + "</font>"; cMsg = "<font color=\"red\">" + cMsg + "</font>";
emit personalMessage(cMsg); emit personalMessage(cMsg);
} else } else
@ -583,7 +583,7 @@ void KBgChat::handleData(const TQString &msg)
break; break;
case CLIP_YOU_SAY: case CLIP_YOU_SAY:
cMsg = i18n("<u>You tell %1:</u> %2").tqarg(user).tqarg(cMsg.tqreplace(TQRegExp("^" + user), "")); cMsg = i18n("<u>You tell %1:</u> %2").tqarg(user).tqarg(cMsg.replace(TQRegExp("^" + user), ""));
cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>"; cMsg = "<font color=\"darkgreen\">" + cMsg + "</font>";
emit personalMessage(cMsg); emit personalMessage(cMsg);
user = TQString(); user = TQString();
@ -611,10 +611,10 @@ void KBgChat::handleData(const TQString &msg)
break; break;
case CLIP_MESSAGE: case CLIP_MESSAGE:
user = cMsg.left(cMsg.tqfind(' ')+1); user = cMsg.left(cMsg.find(' ')+1);
cMsg.remove(0, cMsg.tqfind(' ')+1); cMsg.remove(0, cMsg.find(' ')+1);
date.setTime_t(cMsg.left(cMsg.tqfind(' ')+1).toUInt()); date.setTime_t(cMsg.left(cMsg.find(' ')+1).toUInt());
cMsg.remove(0, cMsg.tqfind(' ')); cMsg.remove(0, cMsg.find(' '));
cMsg = i18n("<u>User %1 left a message at %2</u>: %3").tqarg(user).tqarg(date.toString()).tqarg(cMsg); 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>"; cMsg = "<font color=\"red\">" + cMsg + "</font>";
emit personalMessage(cMsg); emit personalMessage(cMsg);
@ -644,8 +644,8 @@ void KBgChat::handleData(const TQString &msg)
/* /*
* Special treatment for non-CLIP messages * Special treatment for non-CLIP messages
*/ */
if (cMsg.tqcontains(TQRegExp("^You say to yourself: "))) { if (cMsg.contains(TQRegExp("^You say to yourself: "))) {
cMsg.tqreplace(TQRegExp("^You say to yourself: "), cMsg.replace(TQRegExp("^You say to yourself: "),
i18n("<u>You say to yourself:</u> ")); i18n("<u>You say to yourself:</u> "));
} else { } else {
kdDebug(user.isNull(), 10500) << "KBgChat::handleData unhandled message: " kdDebug(user.isNull(), 10500) << "KBgChat::handleData unhandled message: "
@ -694,7 +694,7 @@ void KBgChat::contextMenu(TQListBoxItem *i, const TQPoint &p)
d->mChat->insertSeparator(); d->mChat->insertSeparator();
if (d->mGag.tqcontains(d->mName[0]) <= 0) { if (d->mGag.contains(d->mName[0]) <= 0) {
d->mAct[KBgChatPrivate::Gag]->setText(i18n("Gag %1").tqarg(d->mName[0])); d->mAct[KBgChatPrivate::Gag]->setText(i18n("Gag %1").tqarg(d->mName[0]));
d->mAct[KBgChatPrivate::Gag]->plug(d->mChat); d->mAct[KBgChatPrivate::Gag]->plug(d->mChat);
} else { } else {
@ -797,10 +797,10 @@ void KBgChat::slotSilent()
*/ */
void KBgChat::slotCopy() void KBgChat::slotCopy()
{ {
d->mText.tqreplace(TQRegExp("<u>"), ""); d->mText.replace(TQRegExp("<u>"), "");
d->mText.tqreplace(TQRegExp("</u>"), ""); d->mText.replace(TQRegExp("</u>"), "");
d->mText.tqreplace(TQRegExp("</font>"), ""); d->mText.replace(TQRegExp("</font>"), "");
d->mText.tqreplace(TQRegExp("^.*\">"), ""); d->mText.replace(TQRegExp("^.*\">"), "");
kapp->clipboard()->setText(d->mText); kapp->clipboard()->setText(d->mText);
} }

@ -594,7 +594,7 @@ void KFibsPlayerList::showContextMenu(KListView *, TQListViewItem *i, const TQPo
if (i && d->mCol[tqStatus]->show) if (i && d->mCol[tqStatus]->show)
d->mAct[KFibsPlayerListPrivate::BlindAct]->setText d->mAct[KFibsPlayerListPrivate::BlindAct]->setText
((i->text(d->mCol[tqStatus]->index).tqcontains(d->mAbrv[Blind])) ? ((i->text(d->mCol[tqStatus]->index).contains(d->mAbrv[Blind])) ?
i18n("Unblind %1").tqarg(d->mUser) : i18n("Blind %1").tqarg(d->mUser)); i18n("Unblind %1").tqarg(d->mUser) : i18n("Blind %1").tqarg(d->mUser));
else else
d->mAct[KFibsPlayerListPrivate::BlindAct]->setText(i18n("Blind")); d->mAct[KFibsPlayerListPrivate::BlindAct]->setText(i18n("Blind"));
@ -738,9 +738,9 @@ void KFibsPlayerList::changePlayer(const TQString &line)
if ((str_entry[j] = entry[j]) == "-") if ((str_entry[j] = entry[j]) == "-")
str_entry[j] = ""; str_entry[j] = "";
} }
str_entry[tqStatus].tqreplace(Ready, 1, ready[0] == '0' ? "-" : d->mAbrv[Ready]); str_entry[tqStatus].replace(Ready, 1, ready[0] == '0' ? "-" : d->mAbrv[Ready]);
str_entry[tqStatus].tqreplace(Away, 1, away [0] == '0' ? "-" : d->mAbrv[Away ]); str_entry[tqStatus].replace(Away, 1, away [0] == '0' ? "-" : d->mAbrv[Away ]);
str_entry[tqStatus].tqreplace(Blind, 1, "-"); str_entry[tqStatus].replace(Blind, 1, "-");
// disable drawing until the end of update // disable drawing until the end of update
setUpdatesEnabled(false); setUpdatesEnabled(false);
@ -758,9 +758,9 @@ void KFibsPlayerList::changePlayer(const TQString &line)
i = new KFibsPlayerListLVI(this); i = new KFibsPlayerListLVI(this);
// count the KFibs and KBackgammon clients // count the KFibs and KBackgammon clients
if (str_entry[Client].tqcontains("KFibs")) if (str_entry[Client].contains("KFibs"))
d->mCount[0]++; d->mCount[0]++;
else if (str_entry[Client].tqcontains(PROG_NAME)) else if (str_entry[Client].contains(PROG_NAME))
d->mCount[1]++; d->mCount[1]++;
// new entry requires an update to the player count // new entry requires an update to the player count
@ -771,7 +771,7 @@ void KFibsPlayerList::changePlayer(const TQString &line)
found: found:
// getting here means the player is in the list - update private status // getting here means the player is in the list - update private status
str_entry[tqStatus].tqreplace(Blind,1,i->text(tqStatus).tqcontains str_entry[tqStatus].replace(Blind,1,i->text(tqStatus).contains
(d->mAbrv[Blind]) ? d->mAbrv[Blind] : "-"); (d->mAbrv[Blind]) ? d->mAbrv[Blind] : "-");
update: update:
@ -794,9 +794,9 @@ void KFibsPlayerList::deletePlayer(const TQString &player)
TQListViewItemIterator it(this); TQListViewItemIterator it(this);
for ( ; it.current(); ++it) { for ( ; it.current(); ++it) {
if (it.current()->text(0) == player) { if (it.current()->text(0) == player) {
if (it.current()->text(Client).tqcontains(PROG_NAME)) if (it.current()->text(Client).contains(PROG_NAME))
--d->mCount[1]; --d->mCount[1];
else if (it.current()->text(Client).tqcontains("KFibs")) else if (it.current()->text(Client).contains("KFibs"))
--d->mCount[0]; --d->mCount[0];
delete it.current(); delete it.current();
updateCaption(); updateCaption();
@ -827,7 +827,7 @@ void KFibsPlayerList::changePlayertqStatus(const TQString &player, int stat, boo
/* /*
* Update the status flag * Update the status flag
*/ */
i->setText(tqStatus, i->text(tqStatus).tqreplace(stat, 1, (flag) ? d->mAbrv[stat] : "-")); i->setText(tqStatus, i->text(tqStatus).replace(stat, 1, (flag) ? d->mAbrv[stat] : "-"));
} }

@ -85,7 +85,7 @@ void KBgEngineGNU::handleLine(const TQString &l)
/* /*
* Start of a new game/match * 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])\\."); KRegExp e("^gnubg rolls ([1-6]), .* rolls ([1-6])\\.");
e.match(line.latin1()); e.match(line.latin1());
if (int r = strcmp(e.group(1), e.group(2))) 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 * 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.)(.*$)"); KRegExp e("(^.* cannot move.)(.*$)");
e.match(line.latin1()); e.match(line.latin1());
handleLine(e.group(1)); handleLine(e.group(1));
handleLine(e.group(2)); handleLine(e.group(2));
return; 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\\? )(.+$)"); KRegExp e("(^Are you sure you want to start a new game, and discard the one in progress\\? )(.+$)");
e.match(line.latin1()); e.match(line.latin1());
handleLine(e.group(1)); handleLine(e.group(1));
@ -113,7 +113,7 @@ void KBgEngineGNU::handleLine(const TQString &l)
/* /*
* Cube handling * 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" // redoubles mess up the game counter "turn"
@ -122,7 +122,7 @@ void KBgEngineGNU::handleLine(const TQString &l)
//emit newState(st); //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 // TODO: we need some generic class for this. the class
// can be shared between all engines // can be shared between all engines
@ -155,14 +155,14 @@ void KBgEngineGNU::handleLine(const TQString &l)
/* /*
* Ignore the following messages * 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 = " "; line = " ";
} }
/* /*
* Board messages * Board messages
*/ */
if (line.tqcontains(TQRegExp("^board:"))) { if (line.contains(TQRegExp("^board:"))) {
KBgtqStatus st(line); KBgtqStatus st(line);
@ -248,7 +248,7 @@ void KBgEngineGNU::handleLine(const TQString &l)
/* /*
* Show the line... * Show the line...
*/ */
line.tqreplace(TQRegExp(" "), "&nbsp;"); line.replace(TQRegExp(" "), "&nbsp;");
if (!line.isEmpty()) if (!line.isEmpty())
emit infoText(line); emit infoText(line);
} }
@ -625,9 +625,9 @@ void KBgEngineGNU::done()
emit allowCommand(Redo, false); emit allowCommand(Redo, false);
// Transform the string to FIBS format // Transform the string to FIBS format
lastmove.tqreplace(0, 2, "move "); lastmove.replace(0, 2, "move ");
lastmove.tqreplace(TQRegExp("\\+"), " "); lastmove.replace(TQRegExp("\\+"), " ");
lastmove.tqreplace(TQRegExp("\\-"), " "); lastmove.replace(TQRegExp("\\-"), " ");
// sent it to the server // sent it to the server
handleCommand(lastmove); handleCommand(lastmove);
@ -669,7 +669,7 @@ void KBgEngineGNU::handleMove(TQString *s)
lastmove = *s; lastmove = *s;
int index = 0; int index = 0;
TQString t = s->mid(index, s->tqfind(' ', index)); TQString t = s->mid(index, s->find(' ', index));
index += 1 + t.length(); index += 1 + t.length();
int moves = t.toInt(); int moves = t.toInt();

@ -484,7 +484,7 @@ void KBgEngineOffline::redo()
void KBgEngineOffline::handleMove(TQString *s) void KBgEngineOffline::handleMove(TQString *s)
{ {
int index = 0; int index = 0;
TQString t = s->mid(index, s->tqfind(' ', index)); TQString t = s->mid(index, s->find(' ', index));
index += 1 + t.length(); index += 1 + t.length();
int moves = t.toInt(); int moves = t.toInt();
@ -510,22 +510,22 @@ void KBgEngineOffline::handleMove(TQString *s)
*/ */
for (int i = 0; i < moves; i++) { for (int i = 0; i < moves; i++) {
bool kick = false; bool kick = false;
t = s->mid(index, s->tqfind(' ', index) - index); t = s->mid(index, s->find(' ', index) - index);
index += 1 + t.length(); index += 1 + t.length();
char c = '-'; char c = '-';
if (t.tqcontains('+')) { if (t.contains('+')) {
c = '+'; c = '+';
kick = true; kick = true;
} }
TQString r = t.left(t.tqfind(c)); TQString r = t.left(t.find(c));
if (r.tqcontains("bar")) { if (r.contains("bar")) {
d->mGame[0].setBar(d->mRoll, abs(d->mGame[0].bar(d->mRoll)) - 1); d->mGame[0].setBar(d->mRoll, abs(d->mGame[0].bar(d->mRoll)) - 1);
} else { } else {
int from = r.toInt(); int from = r.toInt();
d->mGame[0].setBoard(from, d->mRoll, abs(d->mGame[0].board(from)) - 1); d->mGame[0].setBoard(from, d->mRoll, abs(d->mGame[0].board(from)) - 1);
} }
t.remove(0, 1 + r.length()); t.remove(0, 1 + r.length());
if (t.tqcontains("off")) { if (t.contains("off")) {
d->mGame[0].setHome(d->mRoll, abs(d->mGame[0].home(d->mRoll)) + 1); d->mGame[0].setHome(d->mRoll, abs(d->mGame[0].home(d->mRoll)) + 1);
} else { } else {
int to = t.toInt(); int to = t.toInt();

@ -1166,7 +1166,7 @@ void KBgBoardBar::mouseDoubleClickEvent(TQMouseEvent *e)
{ {
TQRect r = cubeRect(cellID == BAR_THEM ? CUBE_UPPER : CUBE_LOWER, true); TQRect r = cubeRect(cellID == BAR_THEM ? CUBE_UPPER : CUBE_LOWER, true);
if (board->canDouble(US) && if (board->canDouble(US) &&
board->canDouble(THEM) && r.tqcontains(e->pos())) { board->canDouble(THEM) && r.contains(e->pos())) {
if (board->getEditMode()) if (board->getEditMode())
board->queryCube(); board->queryCube();
else else
@ -1332,7 +1332,7 @@ void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e)
US : THEM); US : THEM);
for (int i = 0; i < 2; ++i) { for (int i = 0; i < 2; ++i) {
TQRect r = diceRect(i, true); TQRect r = diceRect(i, true);
if (r.tqcontains(e->pos())) { if (r.contains(e->pos())) {
if (board->getEditMode()) { if (board->getEditMode()) {
KBgBoardQDice *dlg = new KBgBoardQDice(); KBgBoardQDice *dlg = new KBgBoardQDice();
@ -1356,7 +1356,7 @@ void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e)
if (board->canDouble(w) && if (board->canDouble(w) &&
!(board->canDouble(US) && board->canDouble(THEM))) { !(board->canDouble(US) && board->canDouble(THEM))) {
TQRect r = cubeRect(w, true); TQRect r = cubeRect(w, true);
if (r.tqcontains(e->pos())) if (r.contains(e->pos()))
if (board->getEditMode()) if (board->getEditMode())
board->queryCube(); board->queryCube();
else else
@ -1367,7 +1367,7 @@ void KBgBoardHome::mouseDoubleClickEvent(TQMouseEvent * e)
/* /*
* This function determines if a checker can be dropped on this field. * This function determines if a checker can be dropped on this field.
* It checks whether the field is already owned, empty or tqcontains * It checks whether the field is already owned, empty or contains
* only one opponents piece. Then the dice are checked. * only one opponents piece. Then the dice are checked.
*/ */
bool KBgBoardField::dropPossible(int fromCellID, int newColor) bool KBgBoardField::dropPossible(int fromCellID, int newColor)
@ -1435,7 +1435,7 @@ bool KBgBoard::moveOffPossible() const
KBgBoardCell* KBgBoard::getCellByPos(const TQPoint& p) const KBgBoardCell* KBgBoard::getCellByPos(const TQPoint& p) const
{ {
for (int i = 0; i < 30; ++i) { for (int i = 0; i < 30; ++i) {
if (TQT_TQRECT_OBJECT(cells[i]->rect()).tqcontains(cells[i]->mapFromParent(p))) if (TQT_TQRECT_OBJECT(cells[i]->rect()).contains(cells[i]->mapFromParent(p)))
return cells[i]; return cells[i];
} }
return NULL; return NULL;

@ -73,7 +73,7 @@ void KBattleshipClient::slotReadData()
m_readBuffer += TQString::fromUtf8(buf); m_readBuffer += TQString::fromUtf8(buf);
delete []buf; delete []buf;
int pos; int pos;
while ((pos = m_readBuffer.tqfind("</kmessage>")) >= 0) while ((pos = m_readBuffer.find("</kmessage>")) >= 0)
{ {
pos += 11; // Length of "</kmessage>" pos += 11; // Length of "</kmessage>"
KMessage *msg = new KMessage(); KMessage *msg = new KMessage();

@ -85,7 +85,7 @@ void KBattleshipServer::slotReadClient()
m_readBuffer += TQString::fromUtf8(buf); m_readBuffer += TQString::fromUtf8(buf);
delete []buf; delete []buf;
int pos; int pos;
while ((pos = m_readBuffer.tqfind("</kmessage>")) >= 0) while ((pos = m_readBuffer.find("</kmessage>")) >= 0)
{ {
pos += 11; // Length of "</kmessage>" pos += 11; // Length of "</kmessage>"
KMessage *msg = new KMessage(); KMessage *msg = new KMessage();

@ -190,9 +190,9 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event)
int fieldx = 0; int fieldx = 0;
int fieldy = 0; int fieldy = 0;
if(ownRect.tqcontains(point)) if(ownRect.contains(point))
newRect = ownRect; newRect = ownRect;
else if(enemyRect.tqcontains(point)) else if(enemyRect.contains(point))
newRect = enemyRect; newRect = enemyRect;
else else
return false; return false;
@ -204,7 +204,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event)
j++; j++;
TQRect tempRect(i, newRect.top(), m_battlefield->gridSize(), newRect.bottom() - newRect.top()); TQRect tempRect(i, newRect.top(), m_battlefield->gridSize(), newRect.bottom() - newRect.top());
if(tempRect.tqcontains(point)) if(tempRect.contains(point))
{ {
fieldx = j; fieldx = j;
break; break;
@ -218,7 +218,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event)
j++; j++;
TQRect tempRect(newRect.left(), i, newRect.right() - newRect.left(), m_battlefield->gridSize()); TQRect tempRect(newRect.left(), i, newRect.right() - newRect.left(), m_battlefield->gridSize());
if(tempRect.tqcontains(point)) if(tempRect.contains(point))
{ {
fieldy = j; fieldy = j;
break; break;
@ -245,7 +245,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event)
int fieldx = 0; int fieldx = 0;
int fieldy = 0; int fieldy = 0;
if(ownRect.tqcontains(point)) if(ownRect.contains(point))
{ {
int j = -1; int j = -1;
@ -254,7 +254,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event)
j++; j++;
TQRect tempRect(i, ownRect.top(), m_battlefield->gridSize(), ownRect.bottom() - ownRect.top()); TQRect tempRect(i, ownRect.top(), m_battlefield->gridSize(), ownRect.bottom() - ownRect.top());
if(tempRect.tqcontains(point)) if(tempRect.contains(point))
{ {
fieldx = j; fieldx = j;
break; break;
@ -268,7 +268,7 @@ bool KBattleshipView::eventFilter(TQObject *object, TQEvent *event)
j++; j++;
TQRect tempRect(ownRect.left(), i, ownRect.right() - ownRect.left(), m_battlefield->gridSize()); TQRect tempRect(ownRect.left(), i, ownRect.right() - ownRect.left(), m_battlefield->gridSize());
if(tempRect.tqcontains(point)) if(tempRect.contains(point))
{ {
fieldy = j; fieldy = j;
break; break;

@ -320,7 +320,7 @@ void KBDestroyShipStrategy::markBorderingFields()
if (m_direction == VERTICAL) if (m_direction == VERTICAL)
{ {
while (m_fieldRect.tqcontains(col, row) && while (m_fieldRect.contains(col, row) &&
m_battleField->ownState(col, row) == KBattleField::HIT) m_battleField->ownState(col, row) == KBattleField::HIT)
{ {
row--; row--;
@ -332,24 +332,24 @@ void KBDestroyShipStrategy::markBorderingFields()
row++; row++;
i = col+1; // right of the ship i = col+1; // right of the ship
j = col-1; // left of the ship j = col-1; // left of the ship
while (m_fieldRect.tqcontains(col, row) && while (m_fieldRect.contains(col, row) &&
m_battleField->ownState(col, row) == KBattleField::HIT) m_battleField->ownState(col, row) == KBattleField::HIT)
{ {
if (m_fieldRect.tqcontains(i, row)) if (m_fieldRect.contains(i, row))
setViablePos(i, row, false); setViablePos(i, row, false);
if (m_fieldRect.tqcontains(j, row)) if (m_fieldRect.contains(j, row))
setViablePos(j, row, false); setViablePos(j, row, false);
setViablePos(col, row, false); setViablePos(col, row, false);
row++; row++;
} }
if (m_fieldRect.tqcontains(col, row)) if (m_fieldRect.contains(col, row))
{ // below the ship { // below the ship
setViablePos(col, row, false); setViablePos(col, row, false);
} }
} }
else if (m_direction == HORIZONTAL) else if (m_direction == HORIZONTAL)
{ {
while (m_fieldRect.tqcontains(col, row) && while (m_fieldRect.contains(col, row) &&
m_battleField->ownState(col, row) == KBattleField::HIT) m_battleField->ownState(col, row) == KBattleField::HIT)
{ {
col--; col--;
@ -361,17 +361,17 @@ void KBDestroyShipStrategy::markBorderingFields()
col++; col++;
i = row+1; // below the ship i = row+1; // below the ship
j = row-1; // above the ship j = row-1; // above the ship
while (m_fieldRect.tqcontains(col, row) && while (m_fieldRect.contains(col, row) &&
m_battleField->ownState(col, row) == KBattleField::HIT) m_battleField->ownState(col, row) == KBattleField::HIT)
{ {
if (m_fieldRect.tqcontains(col, i)) if (m_fieldRect.contains(col, i))
setViablePos(col, i, false); setViablePos(col, i, false);
if (m_fieldRect.tqcontains(col, j)) if (m_fieldRect.contains(col, j))
setViablePos(col, j, false); setViablePos(col, j, false);
setViablePos(col, row, false); setViablePos(col, row, false);
col++; col++;
} }
if (m_fieldRect.tqcontains(col, row)) if (m_fieldRect.contains(col, row))
{ // right of the ship { // right of the ship
setViablePos(col, row, false); setViablePos(col, row, false);
} }

@ -34,7 +34,7 @@ const TQPoint KBDiagonalShotStrategy::nextShot()
bool KBDiagonalShotStrategy::advance() bool KBDiagonalShotStrategy::advance()
{ {
while (m_fieldRect.tqcontains(m_column, m_row)) while (m_fieldRect.contains(m_column, m_row))
{ {
if(enemyFieldStateAt(m_column, m_row) != KBStrategy::SHOT) if(enemyFieldStateAt(m_column, m_row) != KBStrategy::SHOT)
return true; return true;
@ -97,7 +97,7 @@ TQPoint KBDiagonalShotStrategy::endPoint()
if(m_vertical == 0 || m_horizontal == 0) if(m_vertical == 0 || m_horizontal == 0)
return TQPoint(col, row); return TQPoint(col, row);
while(m_fieldRect.tqcontains(col, row)) while(m_fieldRect.contains(col, row))
{ {
row += m_vertical; row += m_vertical;
col += m_horizontal; col += m_horizontal;

@ -60,7 +60,7 @@ bool KShip::placedLeft()
return m_placedLeft; return m_placedLeft;
} }
bool KShip::tqcontains(int x, int y) bool KShip::contains(int x, int y)
{ {
return (x >= m_shipxstart && x <= m_shipxstop) && (y >= m_shipystart && y <= m_shipystop); return (x >= m_shipxstart && x <= m_shipxstop) && (y >= m_shipystart && y <= m_shipystop);
} }
@ -69,7 +69,7 @@ int KShip::shipTypeEnum(int x, int y)
{ {
int ret; int ret;
ret = KBattleField::WATER; ret = KBattleField::WATER;
if (tqcontains(x, y)) if (contains(x, y))
{ {
switch(m_shiptype) switch(m_shiptype)
{ {

@ -32,7 +32,7 @@ public:
int shipTypeEnum(int x, int y); int shipTypeEnum(int x, int y);
bool placedLeft(); bool placedLeft();
bool tqcontains(int x, int y); bool contains(int x, int y);
private: private:
int m_shipxstart; int m_shipxstart;

@ -126,20 +126,20 @@ bool KShipList::addNewShip(bool vertical, int fieldx, int fieldy)
{ {
TQRect ship = vertical ? TQRect(fieldx, fieldy, 1, m_shipsadded) : TQRect(fieldx, fieldy, m_shipsadded, 1); TQRect ship = vertical ? TQRect(fieldx, fieldy, 1, m_shipsadded) : TQRect(fieldx, fieldy, m_shipsadded, 1);
TQRect field = TQRect(0, 0, m_fieldx, m_fieldy); TQRect field = TQRect(0, 0, m_fieldx, m_fieldy);
if(!field.tqcontains(ship)) if(!field.contains(ship))
return false; return false;
for(KShip *placedShip = m_shiplist.first(); placedShip != 0; placedShip = m_shiplist.next()) for(KShip *placedShip = m_shiplist.first(); placedShip != 0; placedShip = m_shiplist.next())
{ {
for(int i = fieldx-1; i < (fieldx + ship.width()+1); i++) for(int i = fieldx-1; i < (fieldx + ship.width()+1); i++)
{ {
if(placedShip->tqcontains(i, fieldy - 1) || placedShip->tqcontains(i, fieldy + ship.height())) if(placedShip->contains(i, fieldy - 1) || placedShip->contains(i, fieldy + ship.height()))
return false; return false;
} }
for(int i = fieldy-1; i < (fieldy + ship.height()+1); i++) for(int i = fieldy-1; i < (fieldy + ship.height()+1); i++)
{ {
if(placedShip->tqcontains(fieldx - 1, i) || placedShip->tqcontains(fieldx + ship.width(), i)) if(placedShip->contains(fieldx - 1, i) || placedShip->contains(fieldx + ship.width(), i))
return false; return false;
} }
} }

@ -1386,13 +1386,13 @@ int Board::setASCIIState(const TQString& state)
int color2Count = 0; int color2Count = 0;
/* get moveNo if supplied */ /* get moveNo if supplied */
if ((index = state.tqfind("#"))>=0) if ((index = state.find("#"))>=0)
moveNo = state.mid(index+1,3).toInt(); moveNo = state.mid(index+1,3).toInt();
int f=12, row=0, rowEnd = 17; int f=12, row=0, rowEnd = 17;
char c = ' '; char c = ' ';
index=state.tqfind("/"); index=state.find("/");
while(index>=0) { while(index>=0) {
@ -1420,17 +1420,17 @@ int Board::setASCIIState(const TQString& state)
if (f == rowEnd) { if (f == rowEnd) {
row++; row++;
if (row <4) { if (row <4) {
index = state.tqfind("/",index); index = state.find("/",index);
f = 12 + row*11; f = 12 + row*11;
rowEnd = row*12+17; rowEnd = row*12+17;
} }
else if (row==4) { else if (row==4) {
index = state.tqfind("|",index); index = state.find("|",index);
f = 56; f = 56;
rowEnd = 65; rowEnd = 65;
} }
else if (row <9) { else if (row <9) {
index = state.tqfind("\\",index); index = state.find("\\",index);
f = 8 + row*12; f = 8 + row*12;
rowEnd = 21 + row*11; rowEnd = 21 + row*11;
} }

@ -254,10 +254,10 @@ void EvalDlgImpl::saveas()
KConfig* config = kapp->config(); KConfig* config = kapp->config();
config->setGroup("General"); config->setGroup("General");
TQStringList list = config->readListEntry("EvalSchemes"); TQStringList list = config->readListEntry("EvalSchemes");
TQListBoxItem *it = evalList->tqfindItem(name); TQListBoxItem *it = evalList->findItem(name);
if (!it) { if (!it) {
evalList->insertItem(name); evalList->insertItem(name);
it = evalList->tqfindItem(name); it = evalList->findItem(name);
list << name; list << name;
config->writeEntry("EvalSchemes", list); config->writeEntry("EvalSchemes", list);
} }

@ -184,7 +184,7 @@ void EvalScheme::setInARowValue(int stones, int value)
EvalScheme* EvalScheme::create(TQString scheme) EvalScheme* EvalScheme::create(TQString scheme)
{ {
int pos = scheme.tqfind('='); int pos = scheme.find('=');
if (pos<0) return 0; if (pos<0) return 0;
EvalScheme* evalScheme = new EvalScheme( scheme.left(pos) ); EvalScheme* evalScheme = new EvalScheme( scheme.left(pos) );

@ -522,7 +522,7 @@ void KGoldrunner::initStatusBar()
// Set the PAUSE/RESUME key-names into the status bar message. // Set the PAUSE/RESUME key-names into the status bar message.
pauseKeys = myPause->shortcut().toString(); pauseKeys = myPause->shortcut().toString();
pauseKeys = pauseKeys.tqreplace (';', "\" " + i18n("or") + " \""); pauseKeys = pauseKeys.replace (';', "\" " + i18n("or") + " \"");
gameFreeze (FALSE); gameFreeze (FALSE);
statusBar()->setItemFixed (ID_LIVES, -1); // Fix current sizes. statusBar()->setItemFixed (ID_LIVES, -1); // Fix current sizes.
@ -760,7 +760,7 @@ void KGoldrunner::optionsConfigureKeys()
// Update the PAUSE/RESUME message in the status bar. // Update the PAUSE/RESUME message in the status bar.
pauseKeys = myPause->shortcut().toString(); pauseKeys = myPause->shortcut().toString();
pauseKeys = pauseKeys.tqreplace (';', "\" " + i18n("or") + " \""); pauseKeys = pauseKeys.replace (';', "\" " + i18n("or") + " \"");
gameFreeze (KGrObject::frozen); // Refresh the status bar text. gameFreeze (KGrObject::frozen); // Refresh the status bar text.
} }

@ -825,7 +825,7 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames,
// Read the saved games into the list box. // Read the saved games into the list box.
while (! gameText.endData()) { while (! gameText.endData()) {
s = gameText.readLine(); // Read in one saved game. s = gameText.readLine(); // Read in one saved game.
pr = s.left (s.tqfind (" ", 0, FALSE)); // Get the collection prefix. pr = s.left (s.find (" ", 0, FALSE)); // Get the collection prefix.
for (i = 0; i < imax; i++) { // Get the collection name. for (i = 0; i < imax; i++) { // Get the collection name.
if (collections.at(i)->prefix == pr) { if (collections.at(i)->prefix == pr) {
s = s.insert (0, s = s.insert (0,

@ -876,7 +876,7 @@ void KGrGame::loadGame() // Re-load game, score and level.
if (! s.isNull()) { if (! s.isNull()) {
pr = s.mid (21, 7); // Get the collection prefix. pr = s.mid (21, 7); // Get the collection prefix.
pr = pr.left (pr.tqfind (" ", 0, FALSE)); pr = pr.left (pr.find (" ", 0, FALSE));
for (i = 0; i < imax; i++) { // Find the collection. for (i = 0; i < imax; i++) { // Find the collection.
if (collections.at(i)->prefix == pr) { if (collections.at(i)->prefix == pr) {
@ -1061,7 +1061,7 @@ void KGrGame::checkHighScore()
s1 >> prevDate; s1 >> prevDate;
if ((! scoreRecorded) && (score > prevScore)) { if ((! scoreRecorded) && (score > prevScore)) {
highCount++; highCount++;
// Recode the user's name as UTF-8, in case it tqcontains // Recode the user's name as UTF-8, in case it contains
// non-ASCII chars (e.g. "Kr<4B>ger" is encoded as "Krüger"). // non-ASCII chars (e.g. "Kr<4B>ger" is encoded as "Krüger").
s2 << (const char *) thisUser.utf8(); s2 << (const char *) thisUser.utf8();
s2 << (TQ_INT16) level; s2 << (TQ_INT16) level;
@ -1080,7 +1080,7 @@ void KGrGame::checkHighScore()
delete prevDate; delete prevDate;
} }
if ((! scoreRecorded) && (highCount < 10)) { if ((! scoreRecorded) && (highCount < 10)) {
// Recode the user's name as UTF-8, in case it tqcontains // Recode the user's name as UTF-8, in case it contains
// non-ASCII chars (e.g. "Kr<4B>ger" is encoded as "Krüger"). // non-ASCII chars (e.g. "Kr<4B>ger" is encoded as "Krüger").
s2 << (const char *) thisUser.utf8(); s2 << (const char *) thisUser.utf8();
s2 << (TQ_INT16) level; s2 << (TQ_INT16) level;
@ -1090,7 +1090,7 @@ void KGrGame::checkHighScore()
high1.close(); high1.close();
} }
else { else {
// Recode the user's name as UTF-8, in case it tqcontains // Recode the user's name as UTF-8, in case it contains
// non-ASCII chars (e.g. "Kr<4B>ger" is encoded as "Krüger"). // non-ASCII chars (e.g. "Kr<4B>ger" is encoded as "Krüger").
s2 << (const char *) thisUser.utf8(); s2 << (const char *) thisUser.utf8();
s2 << (TQ_INT16) level; s2 << (TQ_INT16) level;
@ -2496,9 +2496,9 @@ bool KGrGame::loadCollections (Owner o)
line = line.simplifyWhiteSpace(); line = line.simplifyWhiteSpace();
int i, j, len; int i, j, len;
len = line.length(); len = line.length();
i = 0; j = line.tqfind(' ',i); nLevels = line.left(j).toInt(); i = 0; j = line.find(' ',i); nLevels = line.left(j).toInt();
i = j+1; j = line.tqfind(' ',i); settings = line[i]; i = j+1; j = line.find(' ',i); settings = line[i];
i = j+1; j = line.tqfind(' ',i); prefix = line.mid(i,j-i); i = j+1; j = line.find(' ',i); prefix = line.mid(i,j-i);
i = j+1; name = line.right(len-i); i = j+1; name = line.right(len-i);
} }
// If first character is not a digit, the line should be an "about". // If first character is not a digit, the line should be an "about".

@ -380,7 +380,7 @@ void KLines::slotDemo()
if (!msg.isEmpty()) if (!msg.isEmpty())
{ {
lsb->showDemoText(msg); lsb->showDemoText(msg);
demoTimer.start(3500 + msg.tqcontains("\n")*1500, true); demoTimer.start(3500 + msg.contains("\n")*1500, true);
return; return;
} }
if (newBalls) if (newBalls)

@ -216,29 +216,29 @@ void Preview::drawPreview()
in.close(); in.close();
tile = tilesetRaw; tile = tilesetRaw;
tile.tqreplace(":", "/kmahjongg/pics/"); tile.replace(":", "/kmahjongg/pics/");
if (!TQFile::exists(tile)) if (!TQFile::exists(tile))
{ {
tile = tilesetRaw; tile = tilesetRaw;
tile = "pics/" + tile.right(tile.length() - tile.tqfind(":") - 1 ); tile = "pics/" + tile.right(tile.length() - tile.find(":") - 1 );
tile = locate("appdata", tile); tile = locate("appdata", tile);
} }
back = backRaw; back = backRaw;
back.tqreplace(":", "/kmahjongg/pics/"); back.replace(":", "/kmahjongg/pics/");
if (!TQFile::exists(back)) if (!TQFile::exists(back))
{ {
back = backRaw; back = backRaw;
back = "pics/" + back.right(back.length() - back.tqfind(":") - 1); back = "pics/" + back.right(back.length() - back.find(":") - 1);
back = locate("appdata", back); back = locate("appdata", back);
} }
tqlayout = layoutRaw; tqlayout = layoutRaw;
tqlayout.tqreplace(":", "/kmahjongg/pics/"); tqlayout.replace(":", "/kmahjongg/pics/");
if (!TQFile::exists(tqlayout)) if (!TQFile::exists(tqlayout))
{ {
tqlayout = layoutRaw; tqlayout = layoutRaw;
tqlayout = "pics/" + tqlayout.right(tqlayout.length() - tqlayout.tqfind(":") - 1); tqlayout = "pics/" + tqlayout.right(tqlayout.length() - tqlayout.find(":") - 1);
tqlayout = locate("appdata", tqlayout); tqlayout = locate("appdata", tqlayout);
} }
@ -373,9 +373,9 @@ void Preview::saveTheme() {
// with a + // with a +
TQRegExp p(locate("data_dir", "/kmahjongg/pics/")); TQRegExp p(locate("data_dir", "/kmahjongg/pics/"));
back.tqreplace(p,with); back.replace(p,with);
tile.tqreplace(p,with); tile.replace(p,with);
tqlayout.tqreplace(p,with); tqlayout.replace(p,with);
// Get the name of the file to save // Get the name of the file to save

@ -249,7 +249,7 @@ void Ball::collisionDetect(double oldx, double oldy)
m_collisionLock = true; m_collisionLock = true;
// move this ball to where it was barely touching // move this ball to where it was barely touching
double ballAngle = m_vector.direction(); double ballAngle = m_vector.direction();
while (collisions(true).tqcontains(item) > 0) while (collisions(true).contains(item) > 0)
move(x() - cos(ballAngle) / 2.0, y() + sin(ballAngle) / 2.0); move(x() - cos(ballAngle) / 2.0, y() + sin(ballAngle) / 2.0);
// make a 2 pixel separation // make a 2 pixel separation

@ -838,7 +838,7 @@ Puddle::Puddle(TQCanvas *canvas)
TQBrush brush; TQBrush brush;
TQPixmap pic; TQPixmap pic;
if (!TQPixmapCache::tqfind("puddle", pic)) if (!TQPixmapCache::find("puddle", pic))
{ {
pic.load(locate("appdata", "pics/puddle.png")); pic.load(locate("appdata", "pics/puddle.png"));
TQPixmapCache::insert("puddle", pic); TQPixmapCache::insert("puddle", pic);
@ -891,7 +891,7 @@ Sand::Sand(TQCanvas *canvas)
TQBrush brush; TQBrush brush;
TQPixmap pic; TQPixmap pic;
if (!TQPixmapCache::tqfind("sand", pic)) if (!TQPixmapCache::find("sand", pic))
{ {
pic.load(locate("appdata", "pics/sand.png")); pic.load(locate("appdata", "pics/sand.png"));
TQPixmapCache::insert("sand", pic); TQPixmapCache::insert("sand", pic);
@ -990,7 +990,7 @@ void Putter::setOrigin(int _x, int _y)
void Putter::setAngle(Ball *ball) void Putter::setAngle(Ball *ball)
{ {
angle = angleMap.tqcontains(ball)? angleMap[ball] : 0; angle = angleMap.contains(ball)? angleMap[ball] : 0;
finishMe(); finishMe();
} }
@ -1182,7 +1182,7 @@ HoleResult Hole::result(TQPoint p, double s, bool * /*wasCenter*/)
Cup::Cup(TQCanvas *canvas) Cup::Cup(TQCanvas *canvas)
: Hole(TQColor("#808080"), canvas) : Hole(TQColor("#808080"), canvas)
{ {
if (!TQPixmapCache::tqfind("cup", pixmap)) if (!TQPixmapCache::find("cup", pixmap))
{ {
pixmap.load(locate("appdata", "pics/cup.png")); pixmap.load(locate("appdata", "pics/cup.png"));
TQPixmapCache::insert("cup", pixmap); TQPixmapCache::insert("cup", pixmap);
@ -2207,7 +2207,7 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWi
course->resize(width, height); course->resize(width, height);
TQPixmap pic; TQPixmap pic;
if (!TQPixmapCache::tqfind("grass", pic)) if (!TQPixmapCache::find("grass", pic))
{ {
pic.load(locate("appdata", "pics/grass.png")); pic.load(locate("appdata", "pics/grass.png"));
TQPixmapCache::insert("grass", pic); TQPixmapCache::insert("grass", pic);
@ -2430,7 +2430,7 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e)
return; return;
} }
// only items we keep track of // only items we keep track of
if ((!(items.tqcontainsRef(list.first()) || list.first() == whiteBall || extraMoveable.tqcontainsRef(list.first())))) if ((!(items.containsRef(list.first()) || list.first() == whiteBall || extraMoveable.containsRef(list.first()))))
{ {
emit newSelectedItem(&holeInfo); emit newSelectedItem(&holeInfo);
return; return;
@ -2785,7 +2785,7 @@ void KolfGame::timeout()
// later undo the shot // later undo the shot
for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it)
{ {
if (!course->rect().tqcontains(TQPoint((*it).ball()->x(), (*it).ball()->y()))) if (!course->rect().contains(TQPoint((*it).ball()->x(), (*it).ball()->y())))
{ {
(*it).ball()->setState(Stopped); (*it).ball()->setState(Stopped);
@ -3533,12 +3533,12 @@ void KolfGame::openFile()
cfg->setGroup(*it); cfg->setGroup(*it);
const int len = (*it).length(); const int len = (*it).length();
const int dashIndex = (*it).tqfind("-"); const int dashIndex = (*it).find("-");
const int holeNum = (*it).left(dashIndex).toInt(); const int holeNum = (*it).left(dashIndex).toInt();
if (holeNum > _highestHole) if (holeNum > _highestHole)
_highestHole = holeNum; _highestHole = holeNum;
const int atIndex = (*it).tqfind("@"); const int atIndex = (*it).find("@");
const TQString name = (*it).mid(dashIndex + 1, atIndex - (dashIndex + 1)); const TQString name = (*it).mid(dashIndex + 1, atIndex - (dashIndex + 1));
if (holeNum != curHole) if (holeNum != curHole)
@ -3552,8 +3552,8 @@ void KolfGame::openFile()
numItems++; numItems++;
const int commaIndex = (*it).tqfind(","); const int commaIndex = (*it).find(",");
const int pipeIndex = (*it).tqfind("|"); const int pipeIndex = (*it).find("|");
const int x = (*it).mid(atIndex + 1, commaIndex - (atIndex + 1)).toInt(); const int x = (*it).mid(atIndex + 1, commaIndex - (atIndex + 1)).toInt();
const int y = (*it).mid(commaIndex + 1, pipeIndex - (commaIndex + 1)).toInt(); const int y = (*it).mid(commaIndex + 1, pipeIndex - (commaIndex + 1)).toInt();
@ -3610,7 +3610,7 @@ void KolfGame::openFile()
break; break;
} }
if (!loaded && name != "hole" && missingPlugins.tqcontains(name) <= 0) if (!loaded && name != "hole" && missingPlugins.contains(name) <= 0)
missingPlugins.append(name); missingPlugins.append(name);
} }
@ -3978,7 +3978,7 @@ void KolfGame::save()
// wipe out all groups from this hole // wipe out all groups from this hole
for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it) for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it)
{ {
int holeNum = (*it).left((*it).tqfind("-")).toInt(); int holeNum = (*it).left((*it).find("-")).toInt();
if (holeNum == curHole) if (holeNum == curHole)
cfg->deleteGroup(*it); cfg->deleteGroup(*it);
} }

@ -90,7 +90,7 @@ TQString KComboBoxDialog::getItem( const TQString &_text, const TQString &_capti
config->setGroup( "Notification Messages" ); config->setGroup( "Notification Messages" );
prevAnswer = config->readEntry( dontAskAgainName ); prevAnswer = config->readEntry( dontAskAgainName );
if ( !prevAnswer.isEmpty() ) if ( !prevAnswer.isEmpty() )
if ( _items.tqcontains( prevAnswer ) > 0 ) if ( _items.contains( prevAnswer ) > 0 )
return prevAnswer; return prevAnswer;
} }

@ -57,7 +57,7 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *tqparent, const char
scroller = new TQScrollView(playerPage); scroller = new TQScrollView(playerPage);
bigLayout->addWidget(scroller); bigLayout->addWidget(scroller);
tqlayout = new TQVBox(scroller->viewport()); tqlayout = new TQVBox(scroller->viewport());
if (!TQPixmapCache::tqfind("grass", grass)) if (!TQPixmapCache::find("grass", grass))
{ {
grass.load(locate("appdata", "pics/grass.png")); grass.load(locate("appdata", "pics/grass.png"));
TQPixmapCache::insert("grass", grass); TQPixmapCache::insert("grass", grass);
@ -235,7 +235,7 @@ void NewGameDialog::removeCourse()
return; return;
TQString file = *names.at(curItem); TQString file = *names.at(curItem);
if (externCourses.tqcontains(file) < 1) if (externCourses.contains(file) < 1)
return; return;
names.remove(file); names.remove(file);
@ -248,7 +248,7 @@ void NewGameDialog::removeCourse()
void NewGameDialog::selectionChanged() void NewGameDialog::selectionChanged()
{ {
const int curItem = courseList->currentItem(); const int curItem = courseList->currentItem();
remove->setEnabled(!(curItem < 0 || externCourses.tqcontains(*names.at(curItem)) < 1)); remove->setEnabled(!(curItem < 0 || externCourses.contains(*names.at(curItem)) < 1));
} }
void NewGameDialog::addCourse() void NewGameDialog::addCourse()
@ -259,7 +259,7 @@ void NewGameDialog::addCourse()
for (TQStringList::Iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) for (TQStringList::Iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt)
{ {
if (names.tqcontains(*fileIt) > 0) if (names.contains(*fileIt) > 0)
{ {
hasDuplicates = true; hasDuplicates = true;
continue; continue;
@ -316,7 +316,7 @@ PlayerEditor::PlayerEditor(TQString startName, TQColor startColor, TQWidget *tqp
{ {
TQHBoxLayout *tqlayout = new TQHBoxLayout(this, KDialogBase::spacingHint()); TQHBoxLayout *tqlayout = new TQHBoxLayout(this, KDialogBase::spacingHint());
if (!TQPixmapCache::tqfind("grass", grass)) if (!TQPixmapCache::find("grass", grass))
{ {
grass.load(locate("appdata", "pics/grass.png")); grass.load(locate("appdata", "pics/grass.png"));
TQPixmapCache::insert("grass", grass); TQPixmapCache::insert("grass", grass);

@ -34,7 +34,7 @@ Slope::Slope(TQRect rect, TQCanvas *canvas)
setZ(-50); setZ(-50);
if (!TQPixmapCache::tqfind("grass", grass)) if (!TQPixmapCache::find("grass", grass))
{ {
grass.load(locate("appdata", "pics/grass.png")); grass.load(locate("appdata", "pics/grass.png"));
TQPixmapCache::insert("grass", grass); TQPixmapCache::insert("grass", grass);

@ -249,7 +249,7 @@ void Dealer::newHint(MoveHint *mh)
bool Dealer::isMoving(Card *c) const bool Dealer::isMoving(Card *c) const
{ {
return movingCards.tqfind(c) != movingCards.end(); return movingCards.find(c) != movingCards.end();
} }
void Dealer::contentsMouseMoveEvent(TQMouseEvent* e) void Dealer::contentsMouseMoveEvent(TQMouseEvent* e)
@ -277,13 +277,13 @@ void Dealer::contentsMouseMoveEvent(TQMouseEvent* e)
continue; continue;
if (c->source() == movingCards.first()->source()) if (c->source() == movingCards.first()->source())
continue; continue;
if (sources.tqfindIndex(c->source()) != -1) if (sources.findIndex(c->source()) != -1)
continue; continue;
sources.append(c->source()); sources.append(c->source());
} else { } else {
if ((*it)->rtti() == Pile::RTTI) { if ((*it)->rtti() == Pile::RTTI) {
Pile *p = static_cast<Pile*>(*it); Pile *p = static_cast<Pile*>(*it);
if (p->isEmpty() && !sources.tqcontains(p)) if (p->isEmpty() && !sources.contains(p))
sources.append(p); sources.append(p);
} else { } else {
kdDebug(11111) << "unknown object " << *it << " " << (*it)->rtti() << endl; kdDebug(11111) << "unknown object " << *it << " " << (*it)->rtti() << endl;
@ -314,7 +314,7 @@ void Dealer::contentsMouseMoveEvent(TQMouseEvent* e)
void Dealer::mark(Card *c) void Dealer::mark(Card *c)
{ {
c->setSelected(true); c->setSelected(true);
if (!marked.tqcontains(c)) if (!marked.contains(c))
marked.append(c); marked.append(c);
} }

@ -24,7 +24,7 @@ GameStatsImpl::GameStatsImpl(TQWidget* aParent, const char* aname)
if (list.count() <= i) if (list.count() <= i)
list.append("unknown"); list.append("unknown");
list[index] = i18n((*it)->name); list[index] = i18n((*it)->name);
list[index].tqreplace('&',""); list[index].replace('&',"");
} }
GameType->insertStringList(list); GameType->insertStringList(list);
showGameType(0); showGameType(0);

@ -42,7 +42,7 @@ public:
} }
virtual TQSize cardOffset( bool _spread, bool, const Card *c) const { virtual TQSize cardOffset( bool _spread, bool, const Card *c) const {
kdDebug(11111) << "cardOffset " << _spread << " " << (c? c->name() : "(null)") << endl; kdDebug(11111) << "cardOffset " << _spread << " " << (c? c->name() : "(null)") << endl;
if (cardlist.tqcontains(const_cast<Card * const>(c))) if (cardlist.contains(const_cast<Card * const>(c)))
return TQSize(+dspread(), 0); return TQSize(+dspread(), 0);
return TQSize(0, 0); return TQSize(0, 0);
} }

@ -218,7 +218,7 @@ void Pile::moveBy(double dx, double dy)
int Pile::indexOf(const Card *c) const int Pile::indexOf(const Card *c) const
{ {
assert(c->source() == this); assert(c->source() == this);
return m_cards.tqfindIndex(const_cast<Card*>(c)); // the list is of non-const cards return m_cards.findIndex(const_cast<Card*>(c)); // the list is of non-const cards
} }
Card *Pile::at(int index) const Card *Pile::at(int index) const
@ -338,7 +338,7 @@ void Pile::add( Card* _card, bool _facedown, bool _spread )
void Pile::remove(Card *c) void Pile::remove(Card *c)
{ {
assert(m_cards.tqcontains(c)); assert(m_cards.contains(c));
m_cards.remove(c); m_cards.remove(c);
} }

@ -114,7 +114,7 @@ pWidget::pWidget()
TQStringList list2; TQStringList list2;
for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
TQString file = *it; TQString file = *it;
int rindex = file.tqfindRev('.'); int rindex = file.findRev('.');
if (rindex != -1) { if (rindex != -1) {
TQString ext = file.mid(rindex + 1).lower(); TQString ext = file.mid(rindex + 1).lower();
if (ext == "jpeg" || ext == "png" || ext == "jpg") { if (ext == "jpeg" || ext == "png" || ext == "jpg") {
@ -125,7 +125,7 @@ pWidget::pWidget()
} }
wallpapers->setItems(list2); wallpapers->setItems(list2);
wallpapers->setCurrentItem(list2.tqfindIndex("No-Ones-Laughing-3")); wallpapers->setCurrentItem(list2.findIndex("No-Ones-Laughing-3"));
changeWallpaper(); changeWallpaper();
@ -344,8 +344,8 @@ void pWidget::newGameType()
if ((*it)->gameindex == id) { if ((*it)->gameindex == id) {
dill = (*it)->createGame(this); dill = (*it)->createGame(this);
TQString name = (*it)->name; TQString name = (*it)->name;
name = name.tqreplace(TQRegExp("[&']"), ""); name = name.replace(TQRegExp("[&']"), "");
name = name.tqreplace(TQRegExp("[ ]"), "_").lower(); name = name.replace(TQRegExp("[ ]"), "_").lower();
dill->setAnchorName("game_" + name); dill->setAnchorName("game_" + name);
connect(dill, TQT_SIGNAL(saveGame()), TQT_SLOT(saveGame())); connect(dill, TQT_SIGNAL(saveGame()), TQT_SLOT(saveGame()));
connect(dill, TQT_SIGNAL(gameInfo(const TQString&)), connect(dill, TQT_SIGNAL(gameInfo(const TQString&)),

@ -88,7 +88,7 @@ PokerGame::dealCards(PokerPlayer *player, bool skip[])
void void
PokerGame::activatePlayer(PokerPlayer *player) PokerGame::activatePlayer(PokerPlayer *player)
{ {
if (!m_activePlayers.tqcontains(player)) { if (!m_activePlayers.contains(player)) {
m_activePlayers.append(player); m_activePlayers.append(player);
m_removedPlayers.remove(player); m_removedPlayers.remove(player);
} }
@ -98,7 +98,7 @@ PokerGame::activatePlayer(PokerPlayer *player)
void void
PokerGame::inactivatePlayer(PokerPlayer *player) PokerGame::inactivatePlayer(PokerPlayer *player)
{ {
if (m_activePlayers.tqcontains(player)) { if (m_activePlayers.contains(player)) {
m_activePlayers.remove(player); m_activePlayers.remove(player);
m_removedPlayers.append(player); m_removedPlayers.append(player);
} }
@ -554,7 +554,7 @@ void kpok::bet()
// Check if player 1 is out -> for players > 2 // Check if player 1 is out -> for players > 2
// TODO: maybe if (!m_activePlayers.tqcontains(humanPlayer)) // TODO: maybe if (!m_activePlayers.contains(humanPlayer))
// {exchangeCards(); bet(); displayerWinner_computer();return;} // {exchangeCards(); bet(); displayerWinner_computer();return;}

@ -116,7 +116,7 @@ public:
PokerPlayer * getActivePlayer(unsigned int nr) { return m_activePlayers.at(nr); } PokerPlayer * getActivePlayer(unsigned int nr) { return m_activePlayers.at(nr); }
void activatePlayer(PokerPlayer *player); void activatePlayer(PokerPlayer *player);
void inactivatePlayer(PokerPlayer *player); void inactivatePlayer(PokerPlayer *player);
bool isActivePlayer(PokerPlayer *player) const { return m_activePlayers.tqcontains(player); } bool isActivePlayer(PokerPlayer *player) const { return m_activePlayers.contains(player); }
// Misc // Misc
// FIXME: clearDirty should only be called by a save method // FIXME: clearDirty should only be called by a save method

@ -114,5 +114,5 @@ bool Move::wasTurned(uint x, uint y) const
{ {
// findIndex returns the first index where the item is found, or -1 // findIndex returns the first index where the item is found, or -1
// if not found. // if not found.
return (m_turnedPieces.tqfindIndex(10 * x + y) != -1); return (m_turnedPieces.findIndex(10 * x + y) != -1);
} }

@ -163,7 +163,7 @@ void Game::showSettings(){
// since the filename may contain underscore, they // since the filename may contain underscore, they
// are replaced with spaces in the menu entry // are replaced with spaces in the menu entry
TQString s = TQFileInfo( *it ).baseName(); TQString s = TQFileInfo( *it ).baseName();
s = s.tqreplace(TQRegExp("_"), " "); s = s.replace(TQRegExp("_"), " ");
list.append(s); list.append(s);
} }
} }

@ -216,7 +216,7 @@ void PixServer::drawBrick(TQPainter *p ,int i)
TQColor light(180,180,180); TQColor light(180,180,180);
TQColor dark(100,100,100); TQColor dark(100,100,100);
int topSq = board->getNext(N, i); //tqfind 'address' of neighbouring squares int topSq = board->getNext(N, i); //find 'address' of neighbouring squares
int botSq = board->getNext(S, i); int botSq = board->getNext(S, i);
int rightSq = board->getNext(E ,i); int rightSq = board->getNext(E ,i);
int leftSq = board->getNext(W, i); int leftSq = board->getNext(W, i);

@ -311,7 +311,7 @@ void
MainWindow::openURL(KURL _url) { MainWindow::openURL(KURL _url) {
KConfig *cfg=(KApplication::kApplication())->config(); KConfig *cfg=(KApplication::kApplication())->config();
// int namepos = _url.path().tqfindRev('/') + 1; // NOTE: tqfindRev can return -1 // int namepos = _url.path().findRev('/') + 1; // NOTE: findRev can return -1
// TQString levelName = _url.path().mid(namepos); // TQString levelName = _url.path().mid(namepos);
TQString levelName = _url.fileName(); TQString levelName = _url.fileName();

@ -40,7 +40,7 @@ ModalLabel::ModalLabel(const TQString &text, TQWidget *tqparent,
for (int linePos=0; linePos < (int) text.length(); linePos += lineLen+1) { for (int linePos=0; linePos < (int) text.length(); linePos += lineLen+1) {
lineLen = text.tqfind('\n', linePos); lineLen = text.find('\n', linePos);
if (lineLen < 0) lineLen = text.length() - linePos; if (lineLen < 0) lineLen = text.length() - linePos;
else lineLen -= linePos; else lineLen -= linePos;

@ -815,7 +815,7 @@ void MyMainView::collisions()
if((sprite->rtti()!=S_EXPLOSION) if((sprite->rtti()!=S_EXPLOSION)
&& !((sprite->rtti()!=S_SUN)&&(ship[pl]->getHitPoints()==0))) && !((sprite->rtti()!=S_SUN)&&(ship[pl]->getHitPoints()==0)))
if(ship[pl]->collidesWith(sprite)) if(ship[pl]->collidesWith(sprite))
if(!hitlist.tqcontains(sprite)) if(!hitlist.contains(sprite))
hitlist.append(sprite); hitlist.append(sprite);
} }
@ -906,7 +906,7 @@ void MyMainView::collisions()
sprite = (*it); sprite = (*it);
if(sprite->rtti()==S_BULLET) if(sprite->rtti()==S_BULLET)
if(mine->collidesWith(sprite)) if(mine->collidesWith(sprite))
if(!hitlist.tqcontains(sprite)) if(!hitlist.contains(sprite))
hitlist.append(sprite); hitlist.append(sprite);
} }
if(hitlist.count()>0) if(hitlist.count()>0)
@ -932,13 +932,13 @@ void MyMainView::collisions()
{ {
case S_BULLET: case S_BULLET:
if(sun->collidesWith(sprite)) if(sun->collidesWith(sprite))
if(!hitlist.tqcontains(sprite)) if(!hitlist.contains(sprite))
hitlist.append(sprite); hitlist.append(sprite);
break; break;
case S_MINE: case S_MINE:
if(!((MobileSprite*)sprite)->isStopped()) if(!((MobileSprite*)sprite)->isStopped())
if(sun->collidesWith(sprite)) if(sun->collidesWith(sprite))
if(!hitlist.tqcontains(sprite)) if(!hitlist.contains(sprite))
hitlist.append(sprite); hitlist.append(sprite);
break; break;
} }

@ -293,7 +293,7 @@ void PlayGround::mouseReleaseEvent( TQMouseEvent *event )
setCursor(arrow); setCursor(arrow);
// If we are not moving the object to the editable area // If we are not moving the object to the editable area
if (!dirtyArea.tqcontains(event->pos())) if (!dirtyArea.contains(event->pos()))
{ {
// ... then register its deletion (if coming from the editable area), and return // ... then register its deletion (if coming from the editable area), and return
if (draggedZOrder == -1) return; if (draggedZOrder == -1) return;
@ -524,7 +524,7 @@ bool PlayGround::zone(TQPoint &position)
int draggedNumber; int draggedNumber;
for (draggedNumber = 0; for (draggedNumber = 0;
draggedNumber < decorations; draggedNumber < decorations;
draggedNumber++) if (objectsLayout[draggedNumber].tqcontains(position)) draggedNumber++) if (objectsLayout[draggedNumber].contains(position))
{ {
position.setX(position.x() - objectsLayout[draggedNumber].x()); position.setX(position.x() - objectsLayout[draggedNumber].x());
position.setY(position.y() - objectsLayout[draggedNumber].y()); position.setY(position.y() - objectsLayout[draggedNumber].y());
@ -541,7 +541,7 @@ bool PlayGround::zone(TQPoint &position)
for (draggedZOrder = toDraw.count()-1; draggedZOrder >= 0; draggedZOrder--) for (draggedZOrder = toDraw.count()-1; draggedZOrder >= 0; draggedZOrder--)
{ {
currentObject = toDraw.at(draggedZOrder); currentObject = toDraw.at(draggedZOrder);
if (!currentObject->getPosition().tqcontains(position)) continue; if (!currentObject->getPosition().contains(position)) continue;
TQRect toUpdate(currentObject->getPosition()); TQRect toUpdate(currentObject->getPosition());
draggedObject = *currentObject; draggedObject = *currentObject;
@ -563,7 +563,7 @@ bool PlayGround::zone(TQPoint &position)
} }
// If we are on the gameboard itself, then play "tuberling" sound // If we are on the gameboard itself, then play "tuberling" sound
if (editableArea.tqcontains(position)) if (editableArea.contains(position))
topLevel->playSound(editableSound); topLevel->playSound(editableSound);
return false; return false;

@ -219,7 +219,7 @@ void TopLevel::readOptions()
config->setGroup("General"); config->setGroup("General");
option = config->readEntry("Sound", "on"); option = config->readEntry("Sound", "on");
soundEnabled = option.tqfind("on") == 0; soundEnabled = option.find("on") == 0;
option = config->readEntry("GameboardNumber", "0"); option = config->readEntry("GameboardNumber", "0");
selectedGameboard = option.toInt(); selectedGameboard = option.toInt();
@ -290,7 +290,7 @@ void TopLevel::fileNew()
void TopLevel::fileOpen() void TopLevel::fileOpen()
{ {
TQString dir = locate("data", "ktuberling/museum/miss.tuberling"); TQString dir = locate("data", "ktuberling/museum/miss.tuberling");
dir.truncate(dir.tqfindRev('/') + 1); dir.truncate(dir.findRev('/') + 1);
KURL url = KFileDialog::getOpenURL(dir, "*.tuberling"); KURL url = KFileDialog::getOpenURL(dir, "*.tuberling");
@ -340,7 +340,7 @@ void TopLevel::fileSave()
TQString name = url.path(); TQString name = url.path();
int suffix; int suffix;
suffix = name.tqfindRev('.'); suffix = name.findRev('.');
if (suffix == -1) if (suffix == -1)
{ {
name += ".tuberling"; name += ".tuberling";
@ -379,7 +379,7 @@ void TopLevel::filePicture()
int suffix; int suffix;
TQString end; TQString end;
suffix = name.tqfindRev('.'); suffix = name.findRev('.');
if (suffix == -1) if (suffix == -1)
{ {
name += ".xpm"; name += ".xpm";

@ -113,7 +113,7 @@ else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad # might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) tqcontains '*'. # if $src (and thus $dsttmp) contains '*'.
if [ -f "$src" -o -d "$src" ] if [ -f "$src" -o -d "$src" ]
then then

@ -42,10 +42,10 @@ Kwin4Doc::Kwin4Doc(TQWidget *tqparent, const char *) : KGame(1234,TQT_TQOBJECT(t
this,TQT_SLOT(slotPropertyChanged(KGamePropertyBase *,KGame *))); this,TQT_SLOT(slotPropertyChanged(KGamePropertyBase *,KGame *)));
dataHandler()->Debug(); dataHandler()->Debug();
//kdDebug(12010) << "Property 7 policy=" << dataHandler()->tqfind(7)->policy() << endl; //kdDebug(12010) << "Property 7 policy=" << dataHandler()->find(7)->policy() << endl;
setPolicy(KGame::PolicyDirty,true); setPolicy(KGame::PolicyDirty,true);
//kdDebug(12010) << "Property 7 policy=" << dataHandler()->tqfind(7)->policy() << endl; //kdDebug(12010) << "Property 7 policy=" << dataHandler()->find(7)->policy() << endl;
// Game design // Game design
setMaxPlayers(2); setMaxPlayers(2);

@ -111,7 +111,7 @@ KDE_EXPORT Score firstScore();
* You can replace the score item (for e.g. displaying it differently) with * You can replace the score item (for e.g. displaying it differently) with
* setScoreItem or add an item with addScoreItem. * setScoreItem or add an item with addScoreItem.
* *
* The players list tqcontains : * The players list contains :
* <ul> * <ul>
* <li> the player name (as defined by the user in the configuration * <li> the player name (as defined by the user in the configuration
* dialog) </li> * dialog) </li>

@ -320,7 +320,7 @@ PlayerInfos::PlayerInfos()
TQMap<TQString, TQString>::const_iterator it; TQMap<TQString, TQString>::const_iterator it;
for (it=entries.begin(); it!=entries.end(); ++it) { for (it=entries.begin(); it!=entries.end(); ++it) {
TQString key = it.key(); TQString key = it.key();
if ( key.tqfind(prefix)==0 ) { if ( key.find(prefix)==0 ) {
TQString name = key.right(key.length()-prefix.length()); TQString name = key.right(key.length()-prefix.length());
if ( name!="name" || !isNameUsed(it.data()) ) if ( name!="name" || !isNameUsed(it.data()) )
internal->hsConfig().writeEntry(_id+1, name, it.data()); internal->hsConfig().writeEntry(_id+1, name, it.data());

@ -154,13 +154,13 @@ Score::~Score()
const TQVariant &Score::data(const TQString &name) const const TQVariant &Score::data(const TQString &name) const
{ {
Q_ASSERT( _data.tqcontains(name) ); Q_ASSERT( _data.contains(name) );
return _data[name]; return _data[name];
} }
void Score::setData(const TQString &name, const TQVariant &value) void Score::setData(const TQString &name, const TQVariant &value)
{ {
Q_ASSERT( _data.tqcontains(name) ); Q_ASSERT( _data.contains(name) );
Q_ASSERT( _data[name].type()==value.type() ); Q_ASSERT( _data[name].type()==value.type() );
_data[name] = value; _data[name] = value;
} }

@ -466,7 +466,7 @@ void KCardDialog::insertCardIcons()
{ {
KSimpleConfig cfg(*it); KSimpleConfig cfg(*it);
cfg.setGroup(TQString::tqfromLatin1("KDE Backdeck")); cfg.setGroup(TQString::tqfromLatin1("KDE Backdeck"));
TQString path = (*it).left((*it).tqfindRev('/') + 1); TQString path = (*it).left((*it).findRev('/') + 1);
assert(path[path.length() - 1] == '/'); assert(path[path.length() - 1] == '/');
TQPixmap pixmap(path + cfg.readEntry("Preview", "12c.png")); TQPixmap pixmap(path + cfg.readEntry("Preview", "12c.png"));

@ -262,7 +262,7 @@ bool KChatBase::insertSendingEntry(const TQString& text, int id, int index)
kdWarning(11000) << "KChatBase: Cannot add an entry to the combo box" << endl; kdWarning(11000) << "KChatBase: Cannot add an entry to the combo box" << endl;
return false; return false;
} }
if (d->mIndex2Id.tqfindIndex(id) != -1) { if (d->mIndex2Id.findIndex(id) != -1) {
kdError(11000) << "KChatBase: Cannot add more than one entry with the same ID! " << endl; kdError(11000) << "KChatBase: Cannot add more than one entry with the same ID! " << endl;
kdError(11000) << "KChatBase: Text="<<text<<endl; kdError(11000) << "KChatBase: Text="<<text<<endl;
return false; return false;
@ -324,13 +324,13 @@ void KChatBase::setSendingEntry(int id)
int KChatBase::findIndex(int id) const int KChatBase::findIndex(int id) const
{ {
return d->mIndex2Id.tqfindIndex(id); return d->mIndex2Id.findIndex(id);
} }
int KChatBase::nextId() const int KChatBase::nextId() const
{ {
int i = SendToAll + 1; int i = SendToAll + 1;
while (d->mIndex2Id.tqfindIndex(i) != -1) { while (d->mIndex2Id.findIndex(i) != -1) {
i++; i++;
} }
return i; return i;
@ -362,7 +362,7 @@ TQListBoxItem* KChatBase::layoutMessage(const TQString& fromName, const TQString
//TODO: KChatBaseConfigure? - e.g. color //TODO: KChatBaseConfigure? - e.g. color
TQListBoxItem* message; TQListBoxItem* message;
if (text.startsWith("/me ")) { if (text.startsWith("/me ")) {
// tqreplace "/me" by a nice star. leave one space after the star // replace "/me" by a nice star. leave one space after the star
TQPixmap pix; TQPixmap pix;
pix.load(locate("data", TQString::tqfromLatin1("kdegames/pics/star.png"))); pix.load(locate("data", TQString::tqfromLatin1("kdegames/pics/star.png")));

@ -78,7 +78,7 @@ public slots:
signals: signals:
/** /**
* This signal is emitted when the "debug messages" page couldn't tqfind * This signal is emitted when the "debug messages" page couldn't find
* the name of a message id. This is usually the case for user-defined * the name of a message id. This is usually the case for user-defined
* messages. KGameDebugDialog asks you to give the msgid a name. * messages. KGameDebugDialog asks you to give the msgid a name.
* @param messageid The ID of the message. As given to @ref * @param messageid The ID of the message. As given to @ref

@ -714,7 +714,7 @@ void KGameDialogConnectionConfig::slotPlayerLeftGame(KPlayer* p)
// disconnect first // disconnect first
this->disconnect(p); this->disconnect(p);
if (!item(p)) { if (!item(p)) {
kdError(11001) << k_funcinfo << ": cannot tqfind " << p->id() kdError(11001) << k_funcinfo << ": cannot find " << p->id()
<< " in list" << endl; << " in list" << endl;
return; return;
} }

@ -1093,7 +1093,7 @@ void KGame::setupGameContinue(TQDataStream& stream, TQ_UINT32 sender)
for ( player=newPlayerList.first(); player != 0; player=newPlayerList.next() ) for ( player=newPlayerList.first(); player != 0; player=newPlayerList.next() )
{ {
// Already in the list // Already in the list
if (inactivateIds.tqfind(player->id())!=inactivateIds.end()) if (inactivateIds.find(player->id())!=inactivateIds.end())
{ {
continue; continue;
} }
@ -1109,7 +1109,7 @@ void KGame::setupGameContinue(TQDataStream& stream, TQ_UINT32 sender)
for ( player=d->mPlayerList.first(); player != 0; player=d->mPlayerList.next() ) for ( player=d->mPlayerList.first(); player != 0; player=d->mPlayerList.next() )
{ {
// Already in the list // Already in the list
if (inactivateIds.tqfind(player->id())!=inactivateIds.end()) if (inactivateIds.find(player->id())!=inactivateIds.end())
{ {
continue; continue;
} }
@ -1171,9 +1171,9 @@ void KGame::setupGameContinue(TQDataStream& stream, TQ_UINT32 sender)
// Now send out the player list which the client can activate // Now send out the player list which the client can activate
for ( player=newPlayerList.first(); player != 0; player=newPlayerList.next() ) for ( player=newPlayerList.first(); player != 0; player=newPlayerList.next() )
{ {
kdDebug(11001) << " newplayerlist tqcontains " << player->id() << endl; kdDebug(11001) << " newplayerlist contains " << player->id() << endl;
// Only activate what is not in the list // Only activate what is not in the list
if (inactivateIds.tqfind(player->id())!=inactivateIds.end()) if (inactivateIds.find(player->id())!=inactivateIds.end())
{ {
continue; continue;
} }
@ -1443,7 +1443,7 @@ void KGame::emitSignal(KGamePropertyBase *me)
} }
KGamePropertyBase* KGame::findProperty(int id) const KGamePropertyBase* KGame::findProperty(int id) const
{ return d->mProperties->tqfind(id); } { return d->mProperties->find(id); }
KGame::GamePolicy KGame::policy() const KGame::GamePolicy KGame::policy() const
{ {

@ -162,7 +162,7 @@ bool KGameChat::isToGroupMessage(int id) const
bool KGameChat::isToPlayerMessage(int id) const bool KGameChat::isToPlayerMessage(int id) const
{ {
return d->mSendId2PlayerId.tqcontains(id); } return d->mSendId2PlayerId.contains(id); }
TQString KGameChat::sendToPlayerEntry(const TQString& name) const TQString KGameChat::sendToPlayerEntry(const TQString& name) const
{ return i18n("Send to %1").tqarg(name); } { return i18n("Send to %1").tqarg(name); }

@ -322,7 +322,7 @@ public:
* experience some strange behaviour if you use the message server directly! * experience some strange behaviour if you use the message server directly!
* *
* @return a pointer to the message server if this is the MASTER KGame * @return a pointer to the message server if this is the MASTER KGame
* object. Note that it might be possible that no KGame object tqcontains * object. Note that it might be possible that no KGame object contains
* the KMessageServer at all! It might even run stand alone! * the KMessageServer at all! It might even run stand alone!
**/ **/
KMessageServer* messageServer() const; KMessageServer* messageServer() const;

@ -238,7 +238,7 @@ public:
int id() const { return mId; } int id() const { return mId; }
/** /**
* @return a type_info of the data this property tqcontains. This is used * @return a type_info of the data this property contains. This is used
* e.g. by KGameDebugDialog * e.g. by KGameDebugDialog
**/ **/
virtual const type_info* typeinfo() { return &typeid(this); } virtual const type_info* typeinfo() { return &typeid(this); }
@ -403,7 +403,7 @@ private:
* <li> A Mixture (very dirty) * <li> A Mixture (very dirty)
* </ul> * </ul>
* I repeat: we do <em>not</em> recommend the third option ("a mixture"). Unless * I repeat: we do <em>not</em> recommend the third option ("a mixture"). Unless
* you have a good reason for this you will probably introduce some hard to tqfind * you have a good reason for this you will probably introduce some hard to find
* (and to fix) bugs. * (and to fix) bugs.
* *
* @section Always consistent (clean): * @section Always consistent (clean):
@ -488,7 +488,7 @@ private:
* which result in inconsistent properties (like "game running" on client A but * which result in inconsistent properties (like "game running" on client A but
* "game ended/paused" on client B). But note that there is a very good reason * "game ended/paused" on client B). But note that there is a very good reason
* for the existence of these different concepts of KGameProperty. I have * for the existence of these different concepts of KGameProperty. I have
* myself experienced such a "strange error" and it took me several days to tqfind * myself experienced such a "strange error" and it took me several days to find
* the reason until I could fix it. So I personally recommend the "clean" way. * the reason until I could fix it. So I personally recommend the "clean" way.
* On the other hand if you want to port a non-network game to a network game * On the other hand if you want to port a non-network game to a network game
* you will probably start with "dirty" properties as it is you will not have to * you will probably start with "dirty" properties as it is you will not have to

@ -117,7 +117,7 @@ bool KGamePropertyHandler::processMessage(TQDataStream &stream, int id, bool isS
int cmd; int cmd;
KGameMessage::extractPropertyCommand(stream, propertyId, cmd); KGameMessage::extractPropertyCommand(stream, propertyId, cmd);
//kdDebug(11001) << k_funcinfo << ": Got COMMAND for id= "<<propertyId <<endl; //kdDebug(11001) << k_funcinfo << ": Got COMMAND for id= "<<propertyId <<endl;
p = d->mIdDict.tqfind(propertyId); p = d->mIdDict.find(propertyId);
if (p) { if (p) {
if (!isSender || p->policy()==KGamePropertyBase::PolicyClean) { if (!isSender || p->policy()==KGamePropertyBase::PolicyClean) {
p->command(stream, cmd, isSender); p->command(stream, cmd, isSender);
@ -127,7 +127,7 @@ bool KGamePropertyHandler::processMessage(TQDataStream &stream, int id, bool isS
} }
return true; return true;
} }
p = d->mIdDict.tqfind(propertyId); p = d->mIdDict.find(propertyId);
if (p) { if (p) {
//kdDebug(11001) << k_funcinfo << ": Loading " << propertyId << endl; //kdDebug(11001) << k_funcinfo << ": Loading " << propertyId << endl;
if (!isSender || p->policy()==KGamePropertyBase::PolicyClean) { if (!isSender || p->policy()==KGamePropertyBase::PolicyClean) {
@ -151,7 +151,7 @@ bool KGamePropertyHandler::removeProperty(KGamePropertyBase* data)
bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, TQString name) bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, TQString name)
{ {
//kdDebug(11001) << k_funcinfo << ": " << data->id() << endl; //kdDebug(11001) << k_funcinfo << ": " << data->id() << endl;
if (d->mIdDict.tqfind(data->id())) { if (d->mIdDict.find(data->id())) {
// this id already exists // this id already exists
kdError(11001) << " -> cannot add property " << data->id() << endl; kdError(11001) << " -> cannot add property " << data->id() << endl;
return false; return false;
@ -172,8 +172,8 @@ bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, TQString name)
TQString KGamePropertyHandler::propertyName(int id) const TQString KGamePropertyHandler::propertyName(int id) const
{ {
TQString s; TQString s;
if (d->mIdDict.tqfind(id)) { if (d->mIdDict.find(id)) {
if (d->mNameMap.tqcontains(id)) { if (d->mNameMap.contains(id)) {
s = i18n("%1 (%2)").tqarg(d->mNameMap[id]).tqarg(id); s = i18n("%1 (%2)").tqarg(d->mNameMap[id]).tqarg(id);
} else { } else {
s = i18n("Unnamed - ID: %1").tqarg(id); s = i18n("Unnamed - ID: %1").tqarg(id);
@ -326,9 +326,9 @@ bool KGamePropertyHandler::sendProperty(TQDataStream &s)
return sent; return sent;
} }
KGamePropertyBase *KGamePropertyHandler::tqfind(int id) KGamePropertyBase *KGamePropertyHandler::find(int id)
{ {
return d->mIdDict.tqfind(id); return d->mIdDict.find(id);
} }
void KGamePropertyHandler::clear() void KGamePropertyHandler::clear()
@ -338,7 +338,7 @@ void KGamePropertyHandler::clear()
while (it.toFirst()) { while (it.toFirst()) {
KGamePropertyBase* p = it.toFirst(); KGamePropertyBase* p = it.toFirst();
p->unregisterData(); p->unregisterData();
if (d->mIdDict.tqfind(p->id())) { if (d->mIdDict.find(p->id())) {
// shouldn't happen - but if mOwner in KGamePropertyBase is NULL // shouldn't happen - but if mOwner in KGamePropertyBase is NULL
// this might be possible // this might be possible
removeProperty(p); removeProperty(p);

@ -195,7 +195,7 @@ public:
* @param id The ID of the property. See KGamePropertyBase::id * @param id The ID of the property. See KGamePropertyBase::id
* @return The KGameProperty this ID is assigned to * @return The KGameProperty this ID is assigned to
**/ **/
KGamePropertyBase *tqfind(int id); KGamePropertyBase *find(int id);
/** /**
* Clear the KGamePropertyHandler. Note that the properties are * Clear the KGamePropertyHandler. Note that the properties are

@ -139,7 +139,7 @@ public:
void remove( const type& d ) void remove( const type& d )
{ {
Iterator it=tqfind(d); Iterator it=find(d);
remove(it); remove(it);
} }

@ -265,7 +265,7 @@ void KMessageClient::processMessage (const TQByteArray &msg)
TQ_UINT32 id; TQ_UINT32 id;
in_stream >> id; in_stream >> id;
if (d->clientList.tqcontains (id)) if (d->clientList.contains (id))
kdWarning (11001) << k_funcinfo << ": Adding a client that already existed!" << endl; kdWarning (11001) << k_funcinfo << ": Adding a client that already existed!" << endl;
else else
d->clientList.append (id); d->clientList.append (id);
@ -280,7 +280,7 @@ void KMessageClient::processMessage (const TQByteArray &msg)
TQ_INT8 broken; TQ_INT8 broken;
in_stream >> id >> broken; in_stream >> id >> broken;
if (!d->clientList.tqcontains (id)) if (!d->clientList.contains (id))
kdWarning (11001) << k_funcinfo << ": Removing a client that doesn't exist!" << endl; kdWarning (11001) << k_funcinfo << ": Removing a client that doesn't exist!" << endl;
else else
d->clientList.remove (id); d->clientList.remove (id);

@ -388,7 +388,7 @@ void KPlayer::networkTransmission(TQDataStream &stream,int msgid,TQ_UINT32 sende
KGamePropertyBase* KPlayer::findProperty(int id) const KGamePropertyBase* KPlayer::findProperty(int id) const
{ {
return d->mProperties.tqfind(id); return d->mProperties.find(id);
} }
bool KPlayer::addProperty(KGamePropertyBase* data) bool KPlayer::addProperty(KGamePropertyBase* data)

@ -58,7 +58,7 @@ class KPlayerPrivate;
* you gain a *very* big advantage: you can exchange a KGameIO whenever you * you gain a *very* big advantage: you can exchange a KGameIO whenever you
* want! You can e.g. remove the KGameIO of a local (human) player and just * want! You can e.g. remove the KGameIO of a local (human) player and just
* replace it by a computerIO on the fly! So from that point on all playerInputs * replace it by a computerIO on the fly! So from that point on all playerInputs
* are done by the computerIO instead of the human player. You also can tqreplace * are done by the computerIO instead of the human player. You also can replace
* all network players by computer players when the network connection is broken * all network players by computer players when the network connection is broken
* or a player wants to quit. * or a player wants to quit.
* So remember: use KGameIO whenever possible! A KPlayer should just * So remember: use KGameIO whenever possible! A KPlayer should just

@ -242,9 +242,9 @@ void KGameProgress::drawText(TQPainter *p)
// the current value and the maximum value respectively. // the current value and the maximum value respectively.
TQString s(format_); TQString s(format_);
s.tqreplace(TQRegExp(TQString::tqfromLatin1("%p")), TQString::number(recalcValue(100))); s.replace(TQRegExp(TQString::tqfromLatin1("%p")), TQString::number(recalcValue(100)));
s.tqreplace(TQRegExp(TQString::tqfromLatin1("%v")), TQString::number(value())); s.replace(TQRegExp(TQString::tqfromLatin1("%v")), TQString::number(value()));
s.tqreplace(TQRegExp(TQString::tqfromLatin1("%m")), TQString::number(maxValue())); s.replace(TQRegExp(TQString::tqfromLatin1("%m")), TQString::number(maxValue()));
p->setPen(text_color); p->setPen(text_color);
TQFont font = p->font(); TQFont font = p->font();

@ -498,9 +498,9 @@ class Hexagonal : public Generic<Type>, public HexagonalBase
CoordList n = neighbours(*it, insideOnly); CoordList n = neighbours(*it, insideOnly);
CoordList::const_iterator it2; CoordList::const_iterator it2;
for (it2=n.begin(); it2!=n.end(); ++it2) for (it2=n.begin(); it2!=n.end(); ++it2)
if ( center.tqfind(*it2)==center.end() if ( center.find(*it2)==center.end()
&& ring.tqfind(*it2)==ring.end() && ring.find(*it2)==ring.end()
&& newRing.tqfind(*it2)==newRing.end() ) && newRing.find(*it2)==newRing.end() )
newRing.append(*it2); newRing.append(*it2);
center.append(*it); center.append(*it);
} }

@ -81,7 +81,7 @@
** **
** Do whatever you want with this code (i.e. the files gtetris.h, ** Do whatever you want with this code (i.e. the files gtetris.h,
** gtetris.cpp, tpiece.h and tpiece.cpp). It is basically a weekend hack ** gtetris.cpp, tpiece.h and tpiece.cpp). It is basically a weekend hack
** and it would bring joy to my heart if anyone in any way would tqfind ** and it would bring joy to my heart if anyone in any way would find
** it useful. ** it useful.
** **
** Nostalgia, comments and/or praise can be sent to: Eirik.Eng@troll.no ** Nostalgia, comments and/or praise can be sent to: Eirik.Eng@troll.no

@ -68,7 +68,7 @@ void KeyData::setEnabled(uint index, bool enabled)
{ {
for (uint k=0; k<_cols[index]->count(); k++) { for (uint k=0; k<_cols[index]->count(); k++) {
TQMap<KAction *, SpecialData>::Iterator it = TQMap<KAction *, SpecialData>::Iterator it =
_specActions.tqfind(_cols[index]->action(k)); _specActions.find(_cols[index]->action(k));
if ( it==_specActions.end() ) if ( it==_specActions.end() )
_cols[index]->action(k)->setEnabled(enabled); _cols[index]->action(k)->setEnabled(enabled);
else (*it).enabled = enabled; else (*it).enabled = enabled;

@ -136,7 +136,7 @@ void NetMeeting::cleanReject(const TQString &str)
// Read incoming data // Read incoming data
void NetMeeting::readNotifier(int fd) void NetMeeting::readNotifier(int fd)
{ {
int i = sm.tqfind(fd); int i = sm.find(fd);
Q_ASSERT( i!=-1 ); Q_ASSERT( i!=-1 );
switch ( sm[i]->read() ) { switch ( sm[i]->read() ) {
case -1: readError(i); break; case -1: readError(i); break;

@ -31,7 +31,7 @@ void SocketManager::clean()
sockets.resize(0); sockets.resize(0);
} }
int SocketManager::tqfind(int fd) int SocketManager::find(int fd)
{ {
for(uint i=0; i<sockets.size(); i++) for(uint i=0; i<sockets.size(); i++)
if ( sockets[i]->fd()==fd ) return i; if ( sockets[i]->fd()==fd ) return i;

@ -40,7 +40,7 @@ class SocketManager
Socket *operator [](uint i) { return sockets[i]; } Socket *operator [](uint i) { return sockets[i]; }
/** @return the index of the socket (-1 if not present). */ /** @return the index of the socket (-1 if not present). */
int tqfind(int fd); int find(int fd);
/** /**
* Append a socket at the end of the array of sockets. * Append a socket at the end of the array of sockets.

@ -75,7 +75,7 @@ void KChildConnect::Receive(TQString input)
// Call us recursive until there are no CR left // Call us recursive until there are no CR left
len=KEMESSAGE_CR.length(); len=KEMESSAGE_CR.length();
pos=input.tqfind(KEMESSAGE_CR); pos=input.find(KEMESSAGE_CR);
if (pos>0) if (pos>0)
{ {
tmp=input.left(pos); tmp=input.left(pos);

@ -61,7 +61,7 @@ void KEMessage::AddData(TQString key, const char *data,int size)
KGM_TYPE KEMessage::QueryType(TQString key) KGM_TYPE KEMessage::QueryType(TQString key)
{ {
KMessageEntry *entry; KMessageEntry *entry;
entry=dict.tqfind(key); entry=dict.find(key);
if (!entry) return (KGM_TYPE)0; if (!entry) return (KGM_TYPE)0;
return entry->QueryType(); return entry->QueryType();
} }
@ -69,7 +69,7 @@ KGM_TYPE KEMessage::QueryType(TQString key)
bool KEMessage::HasKey(TQString key) bool KEMessage::HasKey(TQString key)
{ {
KMessageEntry *entry; KMessageEntry *entry;
entry=dict.tqfind(key); entry=dict.find(key);
if (!entry) return false; if (!entry) return false;
return true; return true;
} }
@ -78,7 +78,7 @@ bool KEMessage::GetData(TQString key,short &s)
{ {
short *result; short *result;
KMessageEntry *entry; KMessageEntry *entry;
entry=dict.tqfind(key); entry=dict.find(key);
if (!entry) return false; if (!entry) return false;
if (entry->QueryType()!=KGM_TYPE_SHORT) return false; if (entry->QueryType()!=KGM_TYPE_SHORT) return false;
// printf("GetShortData: %p for %s\n",entry->QueryData(),(char *)key); // printf("GetShortData: %p for %s\n",entry->QueryData(),(char *)key);
@ -91,7 +91,7 @@ bool KEMessage::GetData(TQString key,long &l)
{ {
long *result; long *result;
KMessageEntry *entry; KMessageEntry *entry;
entry=dict.tqfind(key); entry=dict.find(key);
if (!entry) return false; if (!entry) return false;
if (entry->QueryType()!=KGM_TYPE_LONG) return false; if (entry->QueryType()!=KGM_TYPE_LONG) return false;
result=(long *)entry->QueryData(); result=(long *)entry->QueryData();
@ -103,7 +103,7 @@ bool KEMessage::GetData(TQString key,float &f)
{ {
float *result; float *result;
KMessageEntry *entry; KMessageEntry *entry;
entry=dict.tqfind(key); entry=dict.find(key);
if (!entry) return false; if (!entry) return false;
if (entry->QueryType()!=KGM_TYPE_FLOAT) return false; if (entry->QueryType()!=KGM_TYPE_FLOAT) return false;
// printf("GetFloatData: %p for %s\n",entry->QueryData(),(char *)key); // printf("GetFloatData: %p for %s\n",entry->QueryData(),(char *)key);
@ -115,7 +115,7 @@ bool KEMessage::GetData(TQString key,float &f)
bool KEMessage::GetData(TQString key,char * &c,int &size) bool KEMessage::GetData(TQString key,char * &c,int &size)
{ {
KMessageEntry *entry; KMessageEntry *entry;
entry=dict.tqfind(key); entry=dict.find(key);
if (!entry) return false; if (!entry) return false;
if (entry->QueryType()!=KGM_TYPE_DATA) return false; if (entry->QueryType()!=KGM_TYPE_DATA) return false;
c=entry->QueryData(); c=entry->QueryData();
@ -179,19 +179,19 @@ TQString KEMessage::StringToEntry(TQString str,KMessageEntry *entry)
len=KEMESSAGE_SEP.length(); len=KEMESSAGE_SEP.length();
if (!entry) return TQString(); if (!entry) return TQString();
pos=str.tqfind(KEMESSAGE_SEP,0); pos=str.find(KEMESSAGE_SEP,0);
if (pos<0) return TQString(); // wrong format if (pos<0) return TQString(); // wrong format
key=str.left(pos); key=str.left(pos);
oldpos=pos; oldpos=pos;
pos=str.tqfind(KEMESSAGE_SEP,oldpos+len); pos=str.find(KEMESSAGE_SEP,oldpos+len);
if (pos<0) return TQString(); // wrong format if (pos<0) return TQString(); // wrong format
size=str.mid(oldpos+len,pos-oldpos-len); size=str.mid(oldpos+len,pos-oldpos-len);
oldpos=pos; oldpos=pos;
pos=str.tqfind(KEMESSAGE_SEP,oldpos+len); pos=str.find(KEMESSAGE_SEP,oldpos+len);
if (pos<0) return TQString(); // wrong format if (pos<0) return TQString(); // wrong format
type=str.mid(oldpos+len,pos-oldpos-len); type=str.mid(oldpos+len,pos-oldpos-len);
@ -226,7 +226,7 @@ TQString KEMessage::ToString()
s=KEMESSAGE_HEAD+KEMESSAGE_CR; s=KEMESSAGE_HEAD+KEMESSAGE_CR;
for (it=keys.first();it!=0;it=keys.next()) for (it=keys.first();it!=0;it=keys.next())
{ {
entry=dict.tqfind(TQCString(it)); entry=dict.find(TQCString(it));
s+=EntryToString(it,entry); s+=EntryToString(it,entry);
} }
s+=KEMESSAGE_TAIL+KEMESSAGE_CR; s+=KEMESSAGE_TAIL+KEMESSAGE_CR;
@ -251,14 +251,14 @@ bool KEMessage::AddStringMsg(TQString str)
len=KEMESSAGE_CR.length(); len=KEMESSAGE_CR.length();
pos=str.tqfind(KEMESSAGE_CR); pos=str.find(KEMESSAGE_CR);
if (pos<0) return false; // wrong format if (pos<0) return false; // wrong format
if (str.left(pos)!=(KEMESSAGE_HEAD)) return false; // wrong message if (str.left(pos)!=(KEMESSAGE_HEAD)) return false; // wrong message
do do
{ {
oldpos=pos; oldpos=pos;
pos=str.tqfind(KEMESSAGE_CR,oldpos+len); pos=str.find(KEMESSAGE_CR,oldpos+len);
if (pos<0) return false; // wrong format if (pos<0) return false; // wrong format
data=str.mid(oldpos+len,pos-oldpos-len); data=str.mid(oldpos+len,pos-oldpos-len);
if (data!=(KEMESSAGE_TAIL)) if (data!=(KEMESSAGE_TAIL))
@ -315,7 +315,7 @@ KEMessage &KEMessage::operator=(KEMessage &msg)
// printf("Assigning = KEMessage from %p to %p\n",&msg,this); // printf("Assigning = KEMessage from %p to %p\n",&msg,this);
for (it=msg.keys.first();it!=0;it=msg.keys.next()) for (it=msg.keys.first();it!=0;it=msg.keys.next())
{ {
entry=msg.dict.tqfind(TQCString(it)); entry=msg.dict.find(TQCString(it));
newentry=new KMessageEntry; newentry=new KMessageEntry;
*newentry=*entry; *newentry=*entry;
AddEntry(TQCString(it),newentry); AddEntry(TQCString(it),newentry);

@ -55,7 +55,7 @@ bool KInputChildProcess::exec()
s=inputbuffer+s; s=inputbuffer+s;
// printf("ChildABC '%s'\n",(const char *)s); // printf("ChildABC '%s'\n",(const char *)s);
// fflush(stdout); // fflush(stdout);
pos=s.tqfindRev(KEMESSAGE_CR); pos=s.findRev(KEMESSAGE_CR);
if (pos<0) if (pos<0)
{ {
inputbuffer=s; inputbuffer=s;

@ -115,7 +115,7 @@ void KProcessConnect::slotReceivedStdout(KProcess *, char *buffer, int buflen)
} }
// Append old unresolved input // Append old unresolved input
s=inputbuffer+s; s=inputbuffer+s;
pos=s.tqfindRev(KEMESSAGE_CR); pos=s.findRev(KEMESSAGE_CR);
// printf("String '%s' pos=%d len=%d\n",(const char *)s,pos,s.length()); // printf("String '%s' pos=%d len=%d\n",(const char *)s,pos,s.length());
if (pos<0) if (pos<0)
{ {

@ -267,7 +267,7 @@ void KRemoteConnect::socketRead(KSocket *sock)
// Append old unresolved input // Append old unresolved input
s=inputbuffer+s; s=inputbuffer+s;
pos=s.tqfindRev(KEMESSAGE_CR); pos=s.findRev(KEMESSAGE_CR);
// printf("String '%s' pos=%d len=%d\n",(const char *)s,pos,s.length()); // printf("String '%s' pos=%d len=%d\n",(const char *)s,pos,s.length());
if (pos<0) if (pos<0)
{ {

@ -593,7 +593,7 @@ void LSkatView::drawTabText(TQPainter *p,TQRect rect,TQString s,int *ts)
// p->drawRect(rect); // p->drawRect(rect);
while(s.length()>0 && (lcnt==0 || ts[lcnt-1]) ) while(s.length()>0 && (lcnt==0 || ts[lcnt-1]) )
{ {
int lpos=s.tqfind("\t"); int lpos=s.find("\t");
int rpos=s.length()-lpos-1; int rpos=s.length()-lpos-1;
if (lpos<0) if (lpos<0)
{ {

@ -75,7 +75,7 @@ void KChildConnect::Receive(TQString input)
// Call us recursive until there are no CR left // Call us recursive until there are no CR left
len=KEMESSAGE_CR.length(); len=KEMESSAGE_CR.length();
pos=input.tqfind(KEMESSAGE_CR); pos=input.find(KEMESSAGE_CR);
if (pos>0) if (pos>0)
{ {
tmp=input.left(pos); tmp=input.left(pos);

@ -61,7 +61,7 @@ void KEMessage::AddData(TQString key,const char *data,int size)
KGM_TYPE KEMessage::QueryType(TQString key) KGM_TYPE KEMessage::QueryType(TQString key)
{ {
KMessageEntry *entry; KMessageEntry *entry;
entry=dict.tqfind(key); entry=dict.find(key);
if (!entry) return (KGM_TYPE)0; if (!entry) return (KGM_TYPE)0;
return entry->QueryType(); return entry->QueryType();
} }
@ -69,7 +69,7 @@ KGM_TYPE KEMessage::QueryType(TQString key)
bool KEMessage::HasKey(TQString key) bool KEMessage::HasKey(TQString key)
{ {
KMessageEntry *entry; KMessageEntry *entry;
entry=dict.tqfind(key); entry=dict.find(key);
if (!entry) return false; if (!entry) return false;
return true; return true;
} }
@ -78,7 +78,7 @@ bool KEMessage::GetData(TQString key,short &s)
{ {
short *result; short *result;
KMessageEntry *entry; KMessageEntry *entry;
entry=dict.tqfind(key); entry=dict.find(key);
if (!entry) return false; if (!entry) return false;
if (entry->QueryType()!=KGM_TYPE_SHORT) return false; if (entry->QueryType()!=KGM_TYPE_SHORT) return false;
// printf("GetShortData: %p for %s\n",entry->QueryData(),(char *)key); // printf("GetShortData: %p for %s\n",entry->QueryData(),(char *)key);
@ -91,7 +91,7 @@ bool KEMessage::GetData(TQString key,long &l)
{ {
long *result; long *result;
KMessageEntry *entry; KMessageEntry *entry;
entry=dict.tqfind(key); entry=dict.find(key);
if (!entry) return false; if (!entry) return false;
if (entry->QueryType()!=KGM_TYPE_LONG) return false; if (entry->QueryType()!=KGM_TYPE_LONG) return false;
result=(long *)entry->QueryData(); result=(long *)entry->QueryData();
@ -103,7 +103,7 @@ bool KEMessage::GetData(TQString key,float &f)
{ {
float *result; float *result;
KMessageEntry *entry; KMessageEntry *entry;
entry=dict.tqfind(key); entry=dict.find(key);
if (!entry) return false; if (!entry) return false;
if (entry->QueryType()!=KGM_TYPE_FLOAT) return false; if (entry->QueryType()!=KGM_TYPE_FLOAT) return false;
// printf("GetFloatData: %p for %s\n",entry->QueryData(),(char *)key); // printf("GetFloatData: %p for %s\n",entry->QueryData(),(char *)key);
@ -115,7 +115,7 @@ bool KEMessage::GetData(TQString key,float &f)
bool KEMessage::GetData(TQString key,char * &c,int &size) bool KEMessage::GetData(TQString key,char * &c,int &size)
{ {
KMessageEntry *entry; KMessageEntry *entry;
entry=dict.tqfind(key); entry=dict.find(key);
if (!entry) return false; if (!entry) return false;
if (entry->QueryType()!=KGM_TYPE_DATA) return false; if (entry->QueryType()!=KGM_TYPE_DATA) return false;
c=entry->QueryData(); c=entry->QueryData();
@ -179,19 +179,19 @@ TQString KEMessage::StringToEntry(TQString str,KMessageEntry *entry)
len=KEMESSAGE_SEP.length(); len=KEMESSAGE_SEP.length();
if (!entry) return TQString(); if (!entry) return TQString();
pos=str.tqfind(KEMESSAGE_SEP,0); pos=str.find(KEMESSAGE_SEP,0);
if (pos<0) return TQString(); // wrong format if (pos<0) return TQString(); // wrong format
key=str.left(pos); key=str.left(pos);
oldpos=pos; oldpos=pos;
pos=str.tqfind(KEMESSAGE_SEP,oldpos+len); pos=str.find(KEMESSAGE_SEP,oldpos+len);
if (pos<0) return TQString(); // wrong format if (pos<0) return TQString(); // wrong format
size=str.mid(oldpos+len,pos-oldpos-len); size=str.mid(oldpos+len,pos-oldpos-len);
oldpos=pos; oldpos=pos;
pos=str.tqfind(KEMESSAGE_SEP,oldpos+len); pos=str.find(KEMESSAGE_SEP,oldpos+len);
if (pos<0) return TQString(); // wrong format if (pos<0) return TQString(); // wrong format
type=str.mid(oldpos+len,pos-oldpos-len); type=str.mid(oldpos+len,pos-oldpos-len);
@ -226,7 +226,7 @@ TQString KEMessage::ToString()
s=KEMESSAGE_HEAD+KEMESSAGE_CR; s=KEMESSAGE_HEAD+KEMESSAGE_CR;
for (it=keys.first();it!=0;it=keys.next()) for (it=keys.first();it!=0;it=keys.next())
{ {
entry=dict.tqfind(TQCString(it)); entry=dict.find(TQCString(it));
s+=EntryToString(it,entry); s+=EntryToString(it,entry);
} }
s+=KEMESSAGE_TAIL+KEMESSAGE_CR; s+=KEMESSAGE_TAIL+KEMESSAGE_CR;
@ -251,14 +251,14 @@ bool KEMessage::AddStringMsg(TQString str)
len=KEMESSAGE_CR.length(); len=KEMESSAGE_CR.length();
pos=str.tqfind(KEMESSAGE_CR); pos=str.find(KEMESSAGE_CR);
if (pos<0) return false; // wrong format if (pos<0) return false; // wrong format
if (str.left(pos)!=(KEMESSAGE_HEAD)) return false; // wrong message if (str.left(pos)!=(KEMESSAGE_HEAD)) return false; // wrong message
do do
{ {
oldpos=pos; oldpos=pos;
pos=str.tqfind(KEMESSAGE_CR,oldpos+len); pos=str.find(KEMESSAGE_CR,oldpos+len);
if (pos<0) return false; // wrong format if (pos<0) return false; // wrong format
data=str.mid(oldpos+len,pos-oldpos-len); data=str.mid(oldpos+len,pos-oldpos-len);
if (data!=(KEMESSAGE_TAIL)) if (data!=(KEMESSAGE_TAIL))
@ -315,7 +315,7 @@ KEMessage &KEMessage::operator=(KEMessage &msg)
// printf("Assigning = KEMessage from %p to %p\n",&msg,this); // printf("Assigning = KEMessage from %p to %p\n",&msg,this);
for (it=msg.keys.first();it!=0;it=msg.keys.next()) for (it=msg.keys.first();it!=0;it=msg.keys.next())
{ {
entry=msg.dict.tqfind(TQCString(it)); entry=msg.dict.find(TQCString(it));
newentry=new KMessageEntry; newentry=new KMessageEntry;
*newentry=*entry; *newentry=*entry;
AddEntry(TQCString(it),newentry); AddEntry(TQCString(it),newentry);

@ -55,7 +55,7 @@ bool KInputChildProcess::exec()
s=inputbuffer+s; s=inputbuffer+s;
// printf("ChildABC '%s'\n",(const char *)s); // printf("ChildABC '%s'\n",(const char *)s);
// fflush(stdout); // fflush(stdout);
pos=s.tqfindRev(KEMESSAGE_CR); pos=s.findRev(KEMESSAGE_CR);
if (pos<0) if (pos<0)
{ {
inputbuffer=s; inputbuffer=s;

Loading…
Cancel
Save