summaryrefslogtreecommitdiffstats
path: root/kmouth/wordcompletion/wordcompletion.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-17 22:17:08 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-17 22:17:08 +0000
commitf138d74fe16092003b06f5bde9663841929cde7f (patch)
treee9c497a0e59bc7d34264ac9404740d2ea76f3de4 /kmouth/wordcompletion/wordcompletion.cpp
parent3a3c4b256baee79bdcfe72c5e01b9ded9b525900 (diff)
downloadtdeaccessibility-f138d74fe16092003b06f5bde9663841929cde7f.tar.gz
tdeaccessibility-f138d74fe16092003b06f5bde9663841929cde7f.zip
TQt4 port kdeaccessibility
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1237325 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmouth/wordcompletion/wordcompletion.cpp')
-rw-r--r--kmouth/wordcompletion/wordcompletion.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/kmouth/wordcompletion/wordcompletion.cpp b/kmouth/wordcompletion/wordcompletion.cpp
index 268872a..a5d7a4e 100644
--- a/kmouth/wordcompletion/wordcompletion.cpp
+++ b/kmouth/wordcompletion/wordcompletion.cpp
@@ -38,7 +38,7 @@ WordCompletion::~WordCompletion() {
delete d;
}
-typedef QPair<int,TQString> Match;
+typedef TQPair<int,TQString> Match;
typedef TQValueList<Match> MatchList;
TQString WordCompletion::makeCompletion(const TQString &text) {
@@ -46,7 +46,7 @@ TQString WordCompletion::makeCompletion(const TQString &text) {
d->lastText = text;
KCompletion::clear();
- int border = text.findRev(TQRegExp("\\W"));
+ int border = text.tqfindRev(TQRegExp("\\W"));
TQString suffix = text.right (text.length() - border - 1).lower();
TQString prefix = text.left (border + 1);
@@ -84,10 +84,10 @@ TQStringList WordCompletion::wordLists(const TQString &language) {
}
TQString WordCompletion::languageOfWordList(const TQString &wordlist) {
- if (d->dictDetails.contains(wordlist))
+ if (d->dictDetails.tqcontains(wordlist))
return d->dictDetails[wordlist].language;
else
- return TQString::null;
+ return TQString();
}
TQString WordCompletion::currentWordList() {
@@ -137,7 +137,7 @@ bool WordCompletion::setWordList(const TQString &wordlist) {
d->wordsToSave = false;
d->map.clear();
- bool result = d->dictDetails.contains (wordlist);
+ bool result = d->dictDetails.tqcontains (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).contains(TQRegExp("\\d|_"))) {
+ if (!(*it).tqcontains(TQRegExp("\\d|_"))) {
TQString key = (*it).lower();
- if (d->map.contains(key))
+ if (d->map.tqcontains(key))
d->map[key] += 1;
else
d->map[key] = 1;
- if (d->addedWords.contains(key))
+ if (d->addedWords.tqcontains(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.contains(it.key())) {
+ if (d->addedWords.tqcontains(it.key())) {
stream << it.key() << "\t" << d->addedWords[it.key()] << "\t1\n";
stream << it.key() << "\t" << it.data() - d->addedWords[it.key()] << "\t2\n";
}