diff options
Diffstat (limited to 'khangman/khangman/khangmanview.cpp')
-rw-r--r-- | khangman/khangman/khangmanview.cpp | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/khangman/khangman/khangmanview.cpp b/khangman/khangman/khangmanview.cpp index 82dd4485..34269d9a 100644 --- a/khangman/khangman/khangmanview.cpp +++ b/khangman/khangman/khangmanview.cpp @@ -102,30 +102,30 @@ void KHangManView::replaceLetters(const TQString& sChar) // Replace letter in the word if (Prefs::oneLetter()) { // We just replace the next instance. - for (int count=0; count < m_word.tqcontains(sChar, false); count++) { + for (int count=0; count < m_word.contains(sChar, false); count++) { - index = m_word.tqfind(sChar, index, false); + index = m_word.find(sChar, index, false); if (m_goodWord.at(2*index)=='_') { - m_goodWord.tqreplace((2*index), 1, m_word.at(index)); + m_goodWord.replace((2*index), 1, m_word.at(index)); kdDebug() << "m_goodword " << m_goodWord << endl; - if (count == m_word.tqcontains(sChar, false)-1) + if (count == m_word.contains(sChar, false)-1) b_end = true; break; } else index++; - if (count == m_word.tqcontains(sChar, false)-1) + if (count == m_word.contains(sChar, false)-1) b_end = true; } } else { - for (int count=0; count < m_word.tqcontains(sChar, false); count++) { + for (int count=0; count < m_word.contains(sChar, false); count++) { //searching for letter location - index = m_word.tqfind(sChar, index, false); + index = m_word.find(sChar, index, false); //we replace it... - m_goodWord.tqreplace((2*index), 1,m_word.at(index)); + m_goodWord.replace((2*index), 1,m_word.at(index)); index++; } } @@ -146,7 +146,7 @@ void KHangManView::replaceLetters(const TQString& sChar) if (!Prefs::oneLetter()) m_guessedLetters << sChar; //appends the list only if not in One Letter only mode... - if (m_word.tqcontains(sChar, false) == 1) + if (m_word.contains(sChar, false) == 1) m_guessedLetters << sChar; //append if only one instance if (Prefs::oneLetter() && b_end) @@ -159,28 +159,28 @@ bool KHangManView::containsChar(const TQString &sChar) bool b = false; if (m_accentedLetters && !Prefs::accentedLetters()) { if (sChar=="i") - b = m_word.tqcontains(TQString::fromUtf8("í"), false); + b = m_word.contains(TQString::fromUtf8("í"), false); if (sChar=="a") - b = m_word.tqcontains(TQString::fromUtf8("à"), false) - || m_word.tqcontains(TQString::fromUtf8("á"), false) - || m_word.tqcontains(TQString::fromUtf8("ã"), false); + b = m_word.contains(TQString::fromUtf8("à"), false) + || m_word.contains(TQString::fromUtf8("á"), false) + || m_word.contains(TQString::fromUtf8("ã"), false); if (sChar=="u") - b = m_word.tqcontains(TQString::fromUtf8("ü"), false) - || m_word.tqcontains(TQString::fromUtf8("ù"), false); + b = m_word.contains(TQString::fromUtf8("ü"), false) + || m_word.contains(TQString::fromUtf8("ù"), false); if (sChar=="o") - b = m_word.tqcontains(TQString::fromUtf8("ò"), false) - || m_word.tqcontains(TQString::fromUtf8("ó"), false) - || m_word.tqcontains(TQString::fromUtf8("õ"), false); + b = m_word.contains(TQString::fromUtf8("ò"), false) + || m_word.contains(TQString::fromUtf8("ó"), false) + || m_word.contains(TQString::fromUtf8("õ"), false); if (sChar=="e") - b = m_word.tqcontains(TQString::fromUtf8("è"), false) - || m_word.tqcontains(TQString::fromUtf8("é"), false); + b = m_word.contains(TQString::fromUtf8("è"), false) + || m_word.contains(TQString::fromUtf8("é"), false); } - return (b || m_word.tqcontains(sChar, false)); + return (b || m_word.contains(sChar, false)); } @@ -379,7 +379,7 @@ void KHangManView::slotTry() } // Handle the guess. - if (!m_guessedLetters.tqcontains(guess.lower())) { + if (!m_guessedLetters.contains(guess.lower())) { // The letter is not already guessed. if (containsChar(guess)) { @@ -389,11 +389,11 @@ void KHangManView::slotTry() TQString stripWord = m_goodWord; TQString sword = m_word; if (dd > 0) { - stripWord.tqreplace(2*c, 1, ""); - stripWord.tqreplace(2*c-1, 1, ""); + stripWord.replace(2*c, 1, ""); + stripWord.replace(2*c-1, 1, ""); - stripWord.tqreplace(2*(dd-1), 1, ""); - stripWord.tqreplace(2*(dd-1)-1, 1, ""); + stripWord.replace(2*(dd-1), 1, ""); + stripWord.replace(2*(dd-1)-1, 1, ""); } TQStringList rightChars = TQStringList::split(" ", stripWord, true); @@ -442,7 +442,7 @@ void KHangManView::slotTry() m_guessedLetters << guess.lower(); m_guessedLetters << guess.upper(); - m_missedLetters = m_missedLetters.tqreplace((2 * m_numMissedLetters), + m_missedLetters = m_missedLetters.replace((2 * m_numMissedLetters), 1, guess.lower()); m_numMissedLetters++; update(); @@ -496,7 +496,7 @@ void KHangManView::slotTry() int x = 0; int y = 0; - if (m_missedLetters.tqcontains(guess, false) > 0) { + if (m_missedLetters.contains(guess, false) > 0) { // FIXME: popup should be better placed. TQPoint abspos = popup->pos(); @@ -513,7 +513,7 @@ void KHangManView::slotTry() m_letterInput->setEnabled(false); } - if (m_goodWord.tqcontains(guess, false) > 0) { + if (m_goodWord.contains(guess, false) > 0) { TQPoint abspos = popup->pos(); if (Prefs::mode() == 0) { @@ -631,35 +631,35 @@ void KHangManView::game() // If needed, display white space or - if in word or semi dot. // 1. Find dashes. - int f = m_word.tqfind( "-" ); + int f = m_word.find( "-" ); if (f>0) { - m_goodWord.tqreplace(2*f, 1, "-"); + m_goodWord.replace(2*f, 1, "-"); - int g = m_word.tqfind( "-", f+1); + int g = m_word.find( "-", f+1); if (g>0) - m_goodWord.tqreplace(2*g, 3, "-"); + m_goodWord.replace(2*g, 3, "-"); if (g>1) m_goodWord.append("_"); } // 2. Find white space. - c = m_word.tqfind( " " ); + c = m_word.find( " " ); if (c > 0) { - m_goodWord.tqreplace(2*c, 1, " "); - dd = m_word.tqfind( " ", c+1); + m_goodWord.replace(2*c, 1, " "); + dd = m_word.find( " ", c+1); if (dd > 0) - m_goodWord.tqreplace(2*dd, c+1, " "); + m_goodWord.replace(2*dd, c+1, " "); } // 3. Find · - int e = m_word.tqfind( TQString::fromUtf8("·") ); + int e = m_word.find( TQString::fromUtf8("·") ); if (e>0) - m_goodWord.tqreplace(2*e, 1, TQString::fromUtf8("·") ); + m_goodWord.replace(2*e, 1, TQString::fromUtf8("·") ); // 4. Find ' - int h = m_word.tqfind( "'" ); + int h = m_word.find( "'" ); if (h>0) - m_goodWord.tqreplace(2*h, 1, "'"); + m_goodWord.replace(2*h, 1, "'"); } |