summaryrefslogtreecommitdiffstats
path: root/kbabel/kbabeldict/modules/pocompendium/pocompendium.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-12 01:36:19 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-12 01:36:19 +0000
commit99a2774ca6f1cab334de5d43fe36fc44ae889a4c (patch)
treeeff34cf0762227f6baf2a93e8fef48d4bed2651c /kbabel/kbabeldict/modules/pocompendium/pocompendium.cpp
parent1c104292188541106338d4940b0f04beeb4301a0 (diff)
downloadtdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.tar.gz
tdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.zip
TQt4 convert kdesdk
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1236185 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbabel/kbabeldict/modules/pocompendium/pocompendium.cpp')
-rw-r--r--kbabel/kbabeldict/modules/pocompendium/pocompendium.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/kbabel/kbabeldict/modules/pocompendium/pocompendium.cpp b/kbabel/kbabeldict/modules/pocompendium/pocompendium.cpp
index 5220f88a..1911be72 100644
--- a/kbabel/kbabeldict/modules/pocompendium/pocompendium.cpp
+++ b/kbabel/kbabeldict/modules/pocompendium/pocompendium.cpp
@@ -22,11 +22,11 @@
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
- the Qt library by Trolltech AS, Norway (or with modified versions
- of Qt that use the same license as Qt), and distribute linked
+ the TQt library by Trolltech AS, Norway (or with modified versions
+ of TQt that use the same license as TQt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
- Qt. If you modify this file, you may extend this exception to
+ TQt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
@@ -63,8 +63,8 @@ using namespace KBabel;
static KStaticDeleter< TQDict<CompendiumData> > compDataDeleter;
TQDict<CompendiumData> *PoCompendium::_compDict = 0;
-PoCompendium::PoCompendium(TQObject *parent, const char *name)
- : SearchEngine(parent, name)
+PoCompendium::PoCompendium(TQObject *tqparent, const char *name)
+ : SearchEngine(tqparent, name)
{
prefWidget=0;
data=0;
@@ -160,9 +160,9 @@ void PoCompendium::readSettings(KConfigBase *config)
restoreSettings();
}
-PrefWidget *PoCompendium::preferencesWidget(TQWidget *parent)
+PrefWidget *PoCompendium::preferencesWidget(TQWidget *tqparent)
{
- prefWidget = new CompendiumPreferencesWidget(parent,"pocompendium_prefwidget");
+ prefWidget = new CompendiumPreferencesWidget(tqparent,"pocompendium_prefwidget");
kdDebug(KBABEL_SEARCH) << "PreferencesWidget is " << prefWidget << endl;
connect(prefWidget, TQT_SIGNAL(applySettings()), this, TQT_SLOT(applySettings()));
connect(prefWidget, TQT_SIGNAL(restoreSettings())
@@ -232,7 +232,7 @@ bool PoCompendium::searchCaseInsensitive(const TQString& text, uint pluralForm,
TQValueList<int>::ConstIterator it;
for( it = indexList->begin(); it != indexList->end(); ++it )
{
- if(foundIndices.contains(*it))
+ if(foundIndices.tqcontains(*it))
{
continue;
}
@@ -288,7 +288,7 @@ bool PoCompendium::searchTextOnly(const TQString& text, uint pluralForm, TQPtrLi
TQValueList<int>::ConstIterator it;
for( it = indexList->begin(); it != indexList->end(); ++it )
{
- if(foundIndices.contains(*it))
+ if(foundIndices.tqcontains(*it))
{
continue;
}
@@ -346,12 +346,12 @@ bool PoCompendium::searchWords(const TQString& searchStr, uint pluralForm, TQPtr
if(stop)
break;
- if(foundIndices.contains(*it))
+ if(foundIndices.tqcontains(*it))
{
continue;
}
- if(checkedIndices.contains(*it))
+ if(checkedIndices.tqcontains(*it))
{
continue;
}
@@ -397,7 +397,7 @@ bool PoCompendium::searchWords(const TQString& searchStr, uint pluralForm, TQPtr
s=" "+*wit+" ";
o=" "+origStr+" ";
}
- if(o.contains(s))
+ if(o.tqcontains(s))
{
found=true;
}
@@ -421,7 +421,7 @@ bool PoCompendium::searchWords(const TQString& searchStr, uint pluralForm, TQPtr
if(!found && matchContains && !wholeWords)
{
- TQString s=maskString(searchStr);
+ TQString s=tqmaskString(searchStr);
TQRegExp searchReg(s);
if(searchReg.search(origStr) >= 0)
@@ -430,7 +430,7 @@ bool PoCompendium::searchWords(const TQString& searchStr, uint pluralForm, TQPtr
if(!found && matchIsContained && !wholeWords)
{
- TQString s=maskString(origStr);
+ TQString s=tqmaskString(origStr);
TQRegExp reg(s);
if(reg.search(searchStr) >= 0)
@@ -445,7 +445,7 @@ bool PoCompendium::searchWords(const TQString& searchStr, uint pluralForm, TQPtr
for ( TQStringList::Iterator wit2 = list.begin()
; wit2 != list.end(); ++wit2 )
{
- TQString s=maskString(*wit2);
+ TQString s=tqmaskString(*wit2);
TQRegExp reg(s);
if(reg.search(origStr) >= 0)
@@ -491,7 +491,7 @@ bool PoCompendium::searchNGram(const TQString& searchStr, uint pluralForm, TQPtr
TQRegExp searchReg;
if(matchContains)
{
- TQString s=maskString(searchStr);
+ TQString s=tqmaskString(searchStr);
searchReg.setPattern(s);
}
@@ -519,7 +519,7 @@ bool PoCompendium::searchNGram(const TQString& searchStr, uint pluralForm, TQPtr
emit progress( 50+(50*(checkCounter+1))/catalogInfo.total);
}
- if(checkedIndices.contains(i))
+ if(checkedIndices.tqcontains(i))
{
continue;
}
@@ -532,7 +532,7 @@ bool PoCompendium::searchNGram(const TQString& searchStr, uint pluralForm, TQPtr
continue;
}
- if(foundIndices.contains(i))
+ if(foundIndices.tqcontains(i))
{
continue;
}
@@ -564,7 +564,7 @@ bool PoCompendium::searchNGram(const TQString& searchStr, uint pluralForm, TQPtr
if(!found && matchIsContained)
{
- TQString s=maskString(origStr);
+ TQString s=tqmaskString(origStr);
TQRegExp reg(s);
if(reg.search(searchStr) >= 0)
@@ -580,7 +580,7 @@ bool PoCompendium::searchNGram(const TQString& searchStr, uint pluralForm, TQPtr
for ( TQStringList::Iterator wit2 = list.begin()
; wit2 != list.end(); ++wit2 )
{
- TQString s=maskString(*wit2);
+ TQString s=tqmaskString(*wit2);
if(wholeWords)
{
@@ -689,7 +689,7 @@ bool PoCompendium::startSearch(const TQString& text, uint pluralForm, const Sear
// search without whitespace
searchTextOnly(searchStr, pluralForm, results, foundIndices, checkedIndices);
- // now, search based on words (contains, is contained, etc)
+ // now, search based on words (tqcontains, is contained, etc)
searchWords(searchStr, pluralForm, results, foundIndices, checkedIndices);
@@ -797,9 +797,9 @@ void PoCompendium::slotLoadCompendium()
TQString path=url;
- if(path.contains("@LANG@"))
+ if(path.tqcontains("@LANG@"))
{
- path.replace("@LANG@",langCode);
+ path.tqreplace("@LANG@",langCode);
}
KURL u=KCmdLineArgs::makeURL(path.local8Bit());
realURL = u.url();
@@ -864,21 +864,21 @@ void PoCompendium::recheckData()
loading=false;
}
-TQString PoCompendium::maskString(TQString s)
+TQString PoCompendium::tqmaskString(TQString s)
{
- s.replace("\\","\\\\");
- s.replace("\?","\\?");
- s.replace("[","\\[");
- s.replace(".","\\.");
- s.replace("*","\\*");
- s.replace("+","\\+");
- s.replace("^","\\^");
- s.replace("$","\\$");
- s.replace("(","\\(");
- s.replace(")","\\)");
- s.replace("{","\\{");
- s.replace("}","\\}");
- s.replace("|","\\|");
+ s.tqreplace("\\","\\\\");
+ s.tqreplace("\?","\\?");
+ s.tqreplace("[","\\[");
+ s.tqreplace(".","\\.");
+ s.tqreplace("*","\\*");
+ s.tqreplace("+","\\+");
+ s.tqreplace("^","\\^");
+ s.tqreplace("$","\\$");
+ s.tqreplace("(","\\(");
+ s.tqreplace(")","\\)");
+ s.tqreplace("{","\\{");
+ s.tqreplace("}","\\}");
+ s.tqreplace("|","\\|");
return s;
}
@@ -917,7 +917,7 @@ void PoCompendium::addResult(SearchResult *result, TQPtrList<SearchResult>& res)
void PoCompendium::setLanguageCode(const TQString& lang)
{
- if(initialized && url.contains("@LANG@") && lang!=langCode
+ if(initialized && url.tqcontains("@LANG@") && lang!=langCode
&& !loadTimer->isActive() )
{
initialized=false;
@@ -938,7 +938,7 @@ TQString PoCompendium::translate(const TQString& text, uint pluralForm)
if(error || !data || data->active())
{
- return TQString::null;
+ return TQString();
}
@@ -950,7 +950,7 @@ TQString PoCompendium::translate(const TQString& text, uint pluralForm)
return data->catalog()->msgstr(*index).first();
}
- return TQString::null;
+ return TQString();
}
TQString PoCompendium::fuzzyTranslation(const TQString& text, int &score, const uint pluralForm)
@@ -965,7 +965,7 @@ TQString PoCompendium::fuzzyTranslation(const TQString& text, int &score, const
if(error || !data || data->active())
{
- return TQString::null;
+ return TQString();
}
// try to find fuzzy string
@@ -1029,7 +1029,7 @@ TQString PoCompendium::fuzzyTranslation(const TQString& text, int &score, const
return data->catalog()->msgstr(best_matching).first();
}
- return TQString::null;
+ return TQString();
}
@@ -1041,7 +1041,7 @@ TQString PoCompendium::searchTranslation(const TQString& text, int &sc, const ui
}
if(isSearching())
- return TQString::null;
+ return TQString();
clearResults();
stop = false;
@@ -1058,13 +1058,13 @@ TQString PoCompendium::searchTranslation(const TQString& text, int &sc, const ui
if(error || !data)
{
active = false;
- return TQString::null;
+ return TQString();
}
if(data->active())
{
active = false;
- return TQString::null;
+ return TQString();
}
emit started();
@@ -1120,7 +1120,7 @@ TQString PoCompendium::searchTranslation(const TQString& text, int &sc, const ui
return res.first()->translation;
}
- // now, search based on words (contains, is contained, etc)
+ // now, search based on words (tqcontains, is contained, etc)
searchWords(searchStr, pluralForm, res, foundIndices, checkedIndices);
if( matchNGram ||
@@ -1145,7 +1145,7 @@ TQString PoCompendium::searchTranslation(const TQString& text, int &sc, const ui
sc = 0;
- return TQString::null;
+ return TQString();
}
@@ -1181,7 +1181,7 @@ void PoCompendium::unregisterData()
void PoCompendium::registerData()
{
- data = compendiumDict()->find(realURL);
+ data = compendiumDict()->tqfind(realURL);
if(!data)
{
data = new CompendiumData;