summaryrefslogtreecommitdiffstats
path: root/kmouth
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
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')
-rw-r--r--kmouth/phrasebook/phrasebook.cpp10
-rw-r--r--kmouth/phrasebook/phrasebookdialog.cpp2
-rw-r--r--kmouth/speech.cpp22
-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
7 files changed, 46 insertions, 46 deletions
diff --git a/kmouth/phrasebook/phrasebook.cpp b/kmouth/phrasebook/phrasebook.cpp
index 2efc2e6..7ff932b 100644
--- a/kmouth/phrasebook/phrasebook.cpp
+++ b/kmouth/phrasebook/phrasebook.cpp
@@ -282,10 +282,10 @@ int PhraseBook::save (TQWidget *tqparent, const TQString &title, KURL &url, bool
bool result;
if (fdlg.currentFilter() == "*.phrasebook") {
- if (url.fileName (false).tqcontains('.') == 0) {
+ if (url.fileName (false).contains('.') == 0) {
url.setFileName (url.fileName(false) + ".phrasebook");
}
- else if (url.fileName (false).right (11).tqcontains (".phrasebook", false) == 0) {
+ else if (url.fileName (false).right (11).contains (".phrasebook", false) == 0) {
int filetype = KMessageBox::questionYesNoCancel (0,TQString("<qt>%1</qt>").tqarg(i18n("Your chosen filename <i>%1</i> has a different extension than <i>.phrasebook</i>. "
"Do you wish to add <i>.phrasebook</i> to the filename?").tqarg(url.filename())),i18n("File Extension"),i18n("Add"),i18n("Do Not Add"));
if (filetype == KMessageBox::Cancel) {
@@ -298,7 +298,7 @@ int PhraseBook::save (TQWidget *tqparent, const TQString &title, KURL &url, bool
result = save (url, true);
}
else if (fdlg.currentFilter() == "*.txt") {
- if (url.fileName (false).right (11).tqcontains (".phrasebook", false) == 0) {
+ if (url.fileName (false).right (11).contains (".phrasebook", false) == 0) {
result = save (url, false);
}
else {
@@ -480,9 +480,9 @@ const char *PhraseBookDrag::format (int i) const {
TQByteArray PhraseBookDrag::tqencodedData (const char* mime) const {
TQCString m(mime);
m = m.lower();
- if (m.tqcontains("xml-phrasebook"))
+ if (m.contains("xml-phrasebook"))
return xmlphrasebook.tqencodedData(mime);
- else if (m.tqcontains("xml"))
+ else if (m.contains("xml"))
return xml.tqencodedData(mime);
else
return plain.tqencodedData(mime);
diff --git a/kmouth/phrasebook/phrasebookdialog.cpp b/kmouth/phrasebook/phrasebookdialog.cpp
index 6e4deda..dff69e8 100644
--- a/kmouth/phrasebook/phrasebookdialog.cpp
+++ b/kmouth/phrasebook/phrasebookdialog.cpp
@@ -383,7 +383,7 @@ TQString PhraseBookDialog::displayPath (TQString filename) {
TQFileInfo file(filename);
TQString path = file.dirPath();
TQString dispPath = "";
- uint position = path.tqfind("/kmouth/books/")+TQString("/kmouth/books/").length();
+ uint position = path.find("/kmouth/books/")+TQString("/kmouth/books/").length();
while (path.length() > position) {
file.setFile(path);
diff --git a/kmouth/speech.cpp b/kmouth/speech.cpp
index 300bfb1..f74e1fd 100644
--- a/kmouth/speech.cpp
+++ b/kmouth/speech.cpp
@@ -51,7 +51,7 @@ TQString Speech::prepareCommand (TQString command, const TQString &text,
TQValueStack<bool> stack; // saved isdoublequote values during parsing of braces
bool issinglequote=false; // inside '...' ?
bool isdoublequote=false; // inside "..." ?
- int notqreplace=0; // nested braces when within ${...}
+ int noreplace=0; // nested braces when within ${...}
TQString escText = KShellProcess::quote(text);
// character sequences that change the state or need to be otherwise processed
@@ -71,17 +71,17 @@ TQString Speech::prepareCommand (TQString command, const TQString &text,
if ((command[i]=='(') || (command[i]=='{')) { // (...) or {...}
// assert(isdoublequote == false)
stack.push(isdoublequote);
- if (notqreplace > 0)
+ if (noreplace > 0)
// count nested braces when within ${...}
- notqreplace++;
+ noreplace++;
i++;
}
else if (command[i]=='$') { // $(...) or ${...}
stack.push(isdoublequote);
isdoublequote = false;
- if ((notqreplace > 0) || (command[i+1]=='{'))
+ if ((noreplace > 0) || (command[i+1]=='{'))
// count nested braces when within ${...}
- notqreplace++;
+ noreplace++;
i+=2;
}
else if ((command[i]==')') || (command[i]=='}')) {
@@ -90,9 +90,9 @@ TQString Speech::prepareCommand (TQString command, const TQString &text,
isdoublequote = stack.pop();
else
qWarning("Parse error.");
- if (notqreplace > 0)
+ if (noreplace > 0)
// count nested braces when within ${...}
- notqreplace--;
+ noreplace--;
i++;
}
else if (command[i]=='\'') {
@@ -107,7 +107,7 @@ TQString Speech::prepareCommand (TQString command, const TQString &text,
i+=2;
else if (command[i]=='`') {
// Replace all `...` with safer $(...)
- command.tqreplace (i, 1, "$(");
+ command.replace (i, 1, "$(");
TQRegExp re_backticks("(`|\\\\`|\\\\\\\\|\\\\\\$)");
for (int i2=re_backticks.search(command,i+2);
i2!=-1;
@@ -115,7 +115,7 @@ TQString Speech::prepareCommand (TQString command, const TQString &text,
)
{
if (command[i2] == '`') {
- command.tqreplace (i2, 1, ")");
+ command.replace (i2, 1, ")");
i2=command.length(); // leave loop
}
else {
@@ -126,7 +126,7 @@ TQString Speech::prepareCommand (TQString command, const TQString &text,
}
// Leave i unchanged! We need to process "$("
}
- else if (notqreplace > 0) { // do not replace macros within ${...}
+ else if (noreplace > 0) { // do not replace macros within ${...}
if (issinglequote)
i+=re_singlequote.matchedLength();
else if (isdoublequote)
@@ -161,7 +161,7 @@ TQString Speech::prepareCommand (TQString command, const TQString &text,
else if (issinglequote)
v="'"+v+"'";
- command.tqreplace (i, match.length(), v);
+ command.replace (i, match.length(), v);
i+=v.length();
}
}
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()];
}