summaryrefslogtreecommitdiffstats
path: root/kmouth/wordcompletion
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
commita53c68f02a359d234dee62dfa3bdd12bb17b13b5 (patch)
tree5a800b73c31a1a1251ab533dc614b521f1378ce3 /kmouth/wordcompletion
parent389971def351e67fcf01c3dbe6b83c4d721dd755 (diff)
downloadtdeaccessibility-a53c68f02a359d234dee62dfa3bdd12bb17b13b5.tar.gz
tdeaccessibility-a53c68f02a359d234dee62dfa3bdd12bb17b13b5.zip
rename the following methods:
tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmouth/wordcompletion')
-rw-r--r--kmouth/wordcompletion/klanguagebutton.cpp8
-rw-r--r--kmouth/wordcompletion/klanguagebuttonhelper.cpp2
-rw-r--r--kmouth/wordcompletion/wordcompletion.cpp14
-rw-r--r--kmouth/wordcompletion/wordlist.cpp34
4 files changed, 29 insertions, 29 deletions
diff --git a/kmouth/wordcompletion/klanguagebutton.cpp b/kmouth/wordcompletion/klanguagebutton.cpp
index e34881a..537e728 100644
--- a/kmouth/wordcompletion/klanguagebutton.cpp
+++ b/kmouth/wordcompletion/klanguagebutton.cpp
@@ -60,12 +60,12 @@ static inline void checkInsertPos( TQPopupMenu *popup, const TQString & str,
static inline TQPopupMenu * checkInsertIndex( TQPopupMenu *popup,
const TQStringList *tags, const TQString &submenu )
{
- int pos = tags->tqfindIndex( submenu );
+ int pos = tags->findIndex( submenu );
TQPopupMenu *pi = 0;
if ( pos != -1 )
{
- TQMenuItem *p = popup->tqfindItem( pos );
+ TQMenuItem *p = popup->findItem( pos );
pi = p ? p->popup() : 0;
}
if ( !pi )
@@ -189,7 +189,7 @@ void KLanguageButton::clear()
bool KLanguageButton::containsTag( const TQString &str ) const
{
- return m_tags->tqcontains( str ) > 0;
+ return m_tags->contains( str ) > 0;
}
TQString KLanguageButton::currentTag() const
@@ -228,7 +228,7 @@ void KLanguageButton::setCurrentItem( int i )
void KLanguageButton::setCurrentItem( const TQString &code )
{
- int i = m_tags->tqfindIndex( code );
+ int i = m_tags->findIndex( code );
if ( code.isNull() )
i = 0;
if ( i != -1 )
diff --git a/kmouth/wordcompletion/klanguagebuttonhelper.cpp b/kmouth/wordcompletion/klanguagebuttonhelper.cpp
index 12059c1..8f1785e 100644
--- a/kmouth/wordcompletion/klanguagebuttonhelper.cpp
+++ b/kmouth/wordcompletion/klanguagebuttonhelper.cpp
@@ -48,7 +48,7 @@ void loadLanguageList(KLanguageButton *combo)
it != langlist.end(); ++it )
{
TQString fpath = (*it).left((*it).length() - 14);
- int index = fpath.tqfindRev('/');
+ int index = fpath.findRev('/');
TQString nid = fpath.mid(index + 1);
KSimpleConfig entry(*it);
diff --git a/kmouth/wordcompletion/wordcompletion.cpp b/kmouth/wordcompletion/wordcompletion.cpp
index a5d7a4e..5abd4b7 100644
--- a/kmouth/wordcompletion/wordcompletion.cpp
+++ b/kmouth/wordcompletion/wordcompletion.cpp
@@ -46,7 +46,7 @@ TQString WordCompletion::makeCompletion(const TQString &text) {
d->lastText = text;
KCompletion::clear();
- int border = text.tqfindRev(TQRegExp("\\W"));
+ int border = text.findRev(TQRegExp("\\W"));
TQString suffix = text.right (text.length() - border - 1).lower();
TQString prefix = text.left (border + 1);
@@ -84,7 +84,7 @@ TQStringList WordCompletion::wordLists(const TQString &language) {
}
TQString WordCompletion::languageOfWordList(const TQString &wordlist) {
- if (d->dictDetails.tqcontains(wordlist))
+ if (d->dictDetails.contains(wordlist))
return d->dictDetails[wordlist].language;
else
return TQString();
@@ -137,7 +137,7 @@ bool WordCompletion::setWordList(const TQString &wordlist) {
d->wordsToSave = false;
d->map.clear();
- bool result = d->dictDetails.tqcontains (wordlist);
+ bool result = d->dictDetails.contains (wordlist);
if (result)
d->current = wordlist;
else
@@ -177,13 +177,13 @@ void WordCompletion::addSentence (const TQString &sentence) {
TQStringList::ConstIterator it;
for (it = words.begin(); it != words.end(); ++it) {
- if (!(*it).tqcontains(TQRegExp("\\d|_"))) {
+ if (!(*it).contains(TQRegExp("\\d|_"))) {
TQString key = (*it).lower();
- if (d->map.tqcontains(key))
+ if (d->map.contains(key))
d->map[key] += 1;
else
d->map[key] = 1;
- if (d->addedWords.tqcontains(key))
+ if (d->addedWords.contains(key))
d->addedWords[key] += 1;
else
d->addedWords[key] = 1;
@@ -208,7 +208,7 @@ void WordCompletion::save () {
stream << "WPDictFile\n";
TQMap<TQString,int>::ConstIterator it;
for (it = d->map.begin(); it != d->map.end(); ++it) {
- if (d->addedWords.tqcontains(it.key())) {
+ if (d->addedWords.contains(it.key())) {
stream << it.key() << "\t" << d->addedWords[it.key()] << "\t1\n";
stream << it.key() << "\t" << it.data() - d->addedWords[it.key()] << "\t2\n";
}
diff --git a/kmouth/wordcompletion/wordlist.cpp b/kmouth/wordcompletion/wordlist.cpp
index 15c4ea2..11a15a1 100644
--- a/kmouth/wordcompletion/wordlist.cpp
+++ b/kmouth/wordcompletion/wordlist.cpp
@@ -139,9 +139,9 @@ void addWords (WordMap &map, TQString line) {
TQStringList::ConstIterator it;
for (it = words.begin(); it != words.end(); ++it) {
- if (!(*it).tqcontains(TQRegExp("\\d|_"))) {
+ if (!(*it).contains(TQRegExp("\\d|_"))) {
TQString key = (*it).lower();
- if (map.tqcontains(key))
+ if (map.contains(key))
map[key] += 1;
else
map[key] = 1;
@@ -152,7 +152,7 @@ void addWords (WordMap &map, TQString line) {
void addWords (WordMap &map, WordMap add) {
WordList::WordMap::ConstIterator it;
for (it = add.begin(); it != add.end(); ++it)
- if (map.tqcontains(it.key()))
+ if (map.contains(it.key()))
map[it.key()] += it.data();
else
map[it.key()] = it.data();
@@ -186,7 +186,7 @@ void addWordsFromFile (WordMap &map, TQString filename, TQTextStream::Encoding e
bool ok;
int weight = list[1].toInt(&ok);
if (ok && (weight > 0)) {
- if (map.tqcontains(list[0]))
+ if (map.contains(list[0]))
map[list[0]] += weight;
else
map[list[0]] = weight;
@@ -261,7 +261,7 @@ WordMap mergeFiles (TQMap<TQString,int> files, KProgressDialog *pdlg) {
maxWeight = weight;
for (iter = fileMap.begin(); iter != fileMap.end(); ++iter)
- if (map.tqcontains(iter.key()))
+ if (map.contains(iter.key()))
map[iter.key()] += iter.data() * factor;
else
map[iter.key()] = iter.data() * factor;
@@ -394,14 +394,14 @@ void loadAffFile(const TQString &filename, AffMap &prefixes, AffMap &suffixes) {
if (s.startsWith("PFX")) {
AffList list;
- if (prefixes.tqcontains (fields[1][0]))
+ if (prefixes.contains (fields[1][0]))
list = prefixes[fields[1][0]];
list << e;
prefixes[fields[1][0]] = list;
}
else if (s.startsWith("SFX")) {
AffList list;
- if (suffixes.tqcontains (fields[1][0]))
+ if (suffixes.contains (fields[1][0]))
list = suffixes[fields[1][0]];
list << e;
suffixes[fields[1][0]] = list;
@@ -432,7 +432,7 @@ inline bool checkCondition (const TQString &word, const TQStringList &condition)
it != condition.end();
++it, ++idx)
{
- if ((*it).tqcontains(word[idx]) == ((*it)[0] == '^'))
+ if ((*it).contains(word[idx]) == ((*it)[0] == '^'))
return false;
}
return true;
@@ -445,7 +445,7 @@ inline bool checkCondition (const TQString &word, const TQStringList &condition)
*/
inline void checkWord(const TQString &word, const TQString &modifiers, bool cross, const WordMap &map, WordMap &checkedMap, const AffMap &suffixes) {
for (uint i = 0; i < modifiers.length(); i++) {
- if (suffixes.tqcontains(modifiers[i])) {
+ if (suffixes.contains(modifiers[i])) {
AffList sList = suffixes[modifiers[i]];
AffList::ConstIterator sIt;
@@ -454,7 +454,7 @@ inline void checkWord(const TQString &word, const TQString &modifiers, bool cros
&& (checkCondition(word, (*sIt).condition)))
{
TQString sWord = word.left(word.length()-(*sIt).charsToRemove) + (*sIt).add;
- if (map.tqcontains(sWord))
+ if (map.contains(sWord))
checkedMap[sWord] = map[sWord];
}
}
@@ -467,19 +467,19 @@ inline void checkWord(const TQString &word, const TQString &modifiers, bool cros
* @param modifiers discribes which pre- and suffixes are valid
*/
void checkWord (const TQString &word, const TQString &modifiers, const WordMap &map, WordMap &checkedMap, const AffMap &prefixes, const AffMap &suffixes) {
- if (map.tqcontains(word))
+ if (map.contains(word))
checkedMap[word] = map[word];
checkWord(word, modifiers, true, map, checkedMap, suffixes);
for (uint i = 0; i < modifiers.length(); i++) {
- if (prefixes.tqcontains(modifiers[i])) {
+ if (prefixes.contains(modifiers[i])) {
AffList pList = prefixes[modifiers[i]];
AffList::ConstIterator pIt;
for (pIt = pList.begin(); pIt != pList.end(); ++pIt) {
TQString pWord = (*pIt).add + word;
- if (map.tqcontains(pWord))
+ if (map.contains(pWord))
checkedMap[pWord] = map[pWord];
checkWord(pWord, modifiers, false, map, checkedMap, suffixes);
@@ -520,14 +520,14 @@ WordMap spellCheck (WordMap map, TQString dictionary, KProgressDialog *pdlg) {
while (!stream.atEnd()) {
TQString s = stream.readLine();
- if (s.tqcontains("/")) {
- TQString word = s.left(s.tqfind("/")).lower();
- TQString modifiers = s.right(s.length() - s.tqfind("/"));
+ if (s.contains("/")) {
+ TQString word = s.left(s.find("/")).lower();
+ TQString modifiers = s.right(s.length() - s.find("/"));
checkWord(word, modifiers, map, checkedMap, prefixes, suffixes);
}
else {
- if (!s.isEmpty() && !s.isNull() && map.tqcontains(s.lower()))
+ if (!s.isEmpty() && !s.isNull() && map.contains(s.lower()))
checkedMap[s.lower()] = map[s.lower()];
}