diff options
Diffstat (limited to 'kbabel/kbabeldict/modules/tmx/tmxcompendium.cpp')
-rw-r--r-- | kbabel/kbabeldict/modules/tmx/tmxcompendium.cpp | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/kbabel/kbabeldict/modules/tmx/tmxcompendium.cpp b/kbabel/kbabeldict/modules/tmx/tmxcompendium.cpp index 415992bf..fd5fcd29 100644 --- a/kbabel/kbabeldict/modules/tmx/tmxcompendium.cpp +++ b/kbabel/kbabeldict/modules/tmx/tmxcompendium.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. @@ -58,8 +58,8 @@ static KStaticDeleter< TQDict<TmxCompendiumData> > compDataDeleter; TQDict<TmxCompendiumData> *TmxCompendium::_compDict = 0; -TmxCompendium::TmxCompendium(TQObject *parent, const char *name) - : SearchEngine(parent, name) +TmxCompendium::TmxCompendium(TQObject *tqparent, const char *name) + : SearchEngine(tqparent, name) { prefWidget=0; data=0; @@ -152,9 +152,9 @@ void TmxCompendium::readSettings(KConfigBase *config) restoreSettings(); } -PrefWidget *TmxCompendium::preferencesWidget(TQWidget *parent) +PrefWidget *TmxCompendium::preferencesWidget(TQWidget *tqparent) { - prefWidget = new TmxCompendiumPreferencesWidget(parent,"tmxcompendium_prefwidget"); + prefWidget = new TmxCompendiumPreferencesWidget(tqparent,"tmxcompendium_prefwidget"); connect(prefWidget, TQT_SIGNAL(applySettings()), this, TQT_SLOT(applySettings())); connect(prefWidget, TQT_SIGNAL(restoreSettings()) , this, TQT_SLOT(restoreSettings())); @@ -240,8 +240,8 @@ bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const Sea TranslationInfo *info = new TranslationInfo; info->location = directory(realURL,0); - info->translator = TQString::null; - info->description = TQString::null; + info->translator = TQString(); + info->description = TQString(); result->descriptions.append(info); results.append(result); @@ -267,7 +267,7 @@ bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const Sea TQValueList<int>::ConstIterator it; for( it = indexList->begin(); it != indexList->end(); ++it ) { - if(foundIndices.contains(*it)) + if(foundIndices.tqcontains(*it)) { continue; } @@ -294,8 +294,8 @@ bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const Sea TranslationInfo *info = new TranslationInfo; info->location = directory(realURL,0); - info->translator = TQString::null; - info->description = TQString::null; + info->translator = TQString(); + info->description = TQString(); result->descriptions.append(info); addResult(result); @@ -319,12 +319,12 @@ bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const Sea if(stop) break; - if(foundIndices.contains(*it)) + if(foundIndices.tqcontains(*it)) { continue; } - if(checkedIndices.contains(*it)) + if(checkedIndices.tqcontains(*it)) { continue; } @@ -365,7 +365,7 @@ bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const Sea s=" "+*wit+" "; o=" "+origStr+" "; } - if(o.contains(s)) + if(o.tqcontains(s)) { found=true; } @@ -389,7 +389,7 @@ bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const Sea if(!found && matchContains && !wholeWords) { - TQString s=maskString(searchStr); + TQString s=tqmaskString(searchStr); TQRegExp searchReg(s); if(searchReg.search(origStr) >= 0) @@ -398,7 +398,7 @@ bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const Sea if(!found && matchIsContained && !wholeWords) { - TQString s=maskString(origStr); + TQString s=tqmaskString(origStr); TQRegExp reg(s); if(reg.search(searchStr) >= 0) @@ -413,7 +413,7 @@ bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const Sea 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) @@ -436,8 +436,8 @@ bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const Sea TranslationInfo *info = new TranslationInfo; info->location = directory(realURL,0); - info->translator = TQString::null; - info->description = TQString::null; + info->translator = TQString(); + info->description = TQString(); result->descriptions.append(info); addResult(result); @@ -454,7 +454,7 @@ bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const Sea TQRegExp searchReg; if(matchContains) { - TQString s=maskString(searchStr); + TQString s=tqmaskString(searchStr); searchReg.setPattern(s); } @@ -471,7 +471,7 @@ bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const Sea i++; - if(checkedIndices.contains(i)) + if(checkedIndices.tqcontains(i)) { continue; } @@ -479,7 +479,7 @@ bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const Sea checkedIndices.append(i); checkCounter++; - if(foundIndices.contains(i)) + if(foundIndices.tqcontains(i)) { continue; } @@ -523,7 +523,7 @@ bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const Sea if(!found && matchIsContained) { - TQString s=maskString(origStr); + TQString s=tqmaskString(origStr); TQRegExp reg(s); if(reg.search(searchStr) >= 0) @@ -538,7 +538,7 @@ bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const Sea for ( TQStringList::Iterator wit2 = list.begin() ; wit2 != list.end(); ++wit2 ) { - TQString s=maskString(*wit2); + TQString s=tqmaskString(*wit2); if(wholeWords) { @@ -577,8 +577,8 @@ bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const Sea TranslationInfo *info = new TranslationInfo; info->location = directory(realURL,0); - info->translator = TQString::null; - info->description = TQString::null; + info->translator = TQString(); + info->description = TQString(); result->descriptions.append(info); addResult(result); @@ -687,9 +687,9 @@ void TmxCompendium::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(); @@ -746,21 +746,21 @@ void TmxCompendium::recheckData() loading=false; } -TQString TmxCompendium::maskString(TQString s) const +TQString TmxCompendium::tqmaskString(TQString s) const { - 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; } @@ -797,7 +797,7 @@ void TmxCompendium::addResult(SearchResult *result) void TmxCompendium::setLanguageCode(const TQString& lang) { - if(initialized && url.contains("@LANG@") && lang!=langCode + if(initialized && url.tqcontains("@LANG@") && lang!=langCode && !loadTimer->isActive() ) { initialized=false; @@ -818,7 +818,7 @@ TQString TmxCompendium::translate(const TQString& text, uint pluralForm) if(error || !data || data->active()) { - return TQString::null; + return TQString(); } @@ -829,7 +829,7 @@ TQString TmxCompendium::translate(const TQString& text, uint pluralForm) return data->msgstr(*index); } - return TQString::null; + return TQString(); } TQString TmxCompendium::fuzzyTranslation(const TQString& text, int &score, uint pluralForm) @@ -844,7 +844,7 @@ TQString TmxCompendium::fuzzyTranslation(const TQString& text, int &score, uint if(error || !data || data->active()) { - return TQString::null; + return TQString(); } // try to find fuzzy string @@ -907,7 +907,7 @@ TQString TmxCompendium::fuzzyTranslation(const TQString& text, int &score, uint return data->msgstr(best_matching); } - return TQString::null; + return TQString(); } @@ -943,7 +943,7 @@ void TmxCompendium::unregisterData() void TmxCompendium::registerData() { - data = compendiumDict()->find(realURL); + data = compendiumDict()->tqfind(realURL); if(!data) { data = new TmxCompendiumData; |