diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-12 01:36:19 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-12 01:36:19 +0000 |
commit | 99a2774ca6f1cab334de5d43fe36fc44ae889a4c (patch) | |
tree | eff34cf0762227f6baf2a93e8fef48d4bed2651c /kbabel/kbabeldict/modules/pocompendium | |
parent | 1c104292188541106338d4940b0f04beeb4301a0 (diff) | |
download | tdesdk-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')
9 files changed, 98 insertions, 94 deletions
diff --git a/kbabel/kbabeldict/modules/pocompendium/compendiumdata.cpp b/kbabel/kbabeldict/modules/pocompendium/compendiumdata.cpp index 9eb816bd..f5c37dd5 100644 --- a/kbabel/kbabeldict/modules/pocompendium/compendiumdata.cpp +++ b/kbabel/kbabeldict/modules/pocompendium/compendiumdata.cpp @@ -20,11 +20,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. @@ -42,8 +42,8 @@ using namespace KBabel; -CompendiumData::CompendiumData(TQObject *parent) - : TQObject(parent) +CompendiumData::CompendiumData(TQObject *tqparent) + : TQObject(tqparent) , _active(false) , _error(false) , _initialized(false) @@ -53,7 +53,7 @@ CompendiumData::CompendiumData(TQObject *parent) , _wordDict(9887) , _textonlyDict(9887) { - _catalog = new Catalog(this, "CompendiumData::catalog", TQString::null); + _catalog = new Catalog(this, "CompendiumData::catalog", TQString()); _exactDict.setAutoDelete(true); _allDict.setAutoDelete(true); _wordDict.setAutoDelete(true); @@ -79,7 +79,7 @@ bool CompendiumData::load(KURL url) emit progressStarts(i18n("Loading PO compendium")); connect(_catalog, TQT_SIGNAL(signalProgress(int)), this, TQT_SIGNAL(progress(int))); - ConversionStatus stat=_catalog->openURL(url); + ConversiontqStatus stat=_catalog->openURL(url); disconnect(_catalog, TQT_SIGNAL(signalProgress(int)) , this, TQT_SIGNAL(progress(int))); @@ -91,7 +91,7 @@ bool CompendiumData::load(KURL url) _error = true; _errorMsg = i18n("Error while trying to read file for PO Compendium module:\n%1") - .arg(url.prettyURL()); + .tqarg(url.prettyURL()); emit progressEnds(); diff --git a/kbabel/kbabeldict/modules/pocompendium/compendiumdata.h b/kbabel/kbabeldict/modules/pocompendium/compendiumdata.h index d5668b4a..6d229d74 100644 --- a/kbabel/kbabeldict/modules/pocompendium/compendiumdata.h +++ b/kbabel/kbabeldict/modules/pocompendium/compendiumdata.h @@ -20,11 +20,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. @@ -46,12 +46,13 @@ namespace KBabel class Catalog; } -class CompendiumData : public QObject +class CompendiumData : public TQObject { Q_OBJECT + TQ_OBJECT public: - CompendiumData(TQObject *parent=0); + CompendiumData(TQObject *tqparent=0); bool load(KURL url); diff --git a/kbabel/kbabeldict/modules/pocompendium/pc_factory.cpp b/kbabel/kbabeldict/modules/pocompendium/pc_factory.cpp index 37ae63a4..0d3d2d24 100644 --- a/kbabel/kbabeldict/modules/pocompendium/pc_factory.cpp +++ b/kbabel/kbabeldict/modules/pocompendium/pc_factory.cpp @@ -20,11 +20,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. @@ -54,8 +54,8 @@ KInstance *PcFactory::s_instance = 0; KAboutData *PcFactory::s_about = 0; -PcFactory::PcFactory( TQObject *parent, const char *name) - : KLibFactory(parent,name) +PcFactory::PcFactory( TQObject *tqparent, const char *name) + : KLibFactory(tqparent,name) { } @@ -75,7 +75,7 @@ PcFactory::~PcFactory() } -TQObject *PcFactory::createObject( TQObject *parent, const char *name +TQObject *PcFactory::createObject( TQObject *tqparent, const char *name , const char *classname, const TQStringList &) { if(TQCString(classname) != "SearchEngine") @@ -84,7 +84,7 @@ TQObject *PcFactory::createObject( TQObject *parent, const char *name return 0; } - return new PoCompendium(parent,name); + return new PoCompendium(tqparent,name); } diff --git a/kbabel/kbabeldict/modules/pocompendium/pc_factory.h b/kbabel/kbabeldict/modules/pocompendium/pc_factory.h index 1b0b8820..b92cfcb0 100644 --- a/kbabel/kbabeldict/modules/pocompendium/pc_factory.h +++ b/kbabel/kbabeldict/modules/pocompendium/pc_factory.h @@ -20,11 +20,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. @@ -42,12 +42,13 @@ class KAboutData; class PcFactory : public KLibFactory { Q_OBJECT + TQ_OBJECT public: - PcFactory( TQObject *parent=0, const char *name=0); + PcFactory( TQObject *tqparent=0, const char *name=0); ~PcFactory(); - virtual TQObject *createObject( TQObject *parent=0, const char *name=0 - , const char *classname="TQObject" + virtual TQObject *createObject( TQObject *tqparent=0, const char *name=0 + , const char *classname=TQOBJECT_OBJECT_NAME_STRING , const TQStringList &args = TQStringList()); static KInstance *instance(); 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; diff --git a/kbabel/kbabeldict/modules/pocompendium/pocompendium.h b/kbabel/kbabeldict/modules/pocompendium/pocompendium.h index 50ef9428..70386572 100644 --- a/kbabel/kbabeldict/modules/pocompendium/pocompendium.h +++ b/kbabel/kbabeldict/modules/pocompendium/pocompendium.h @@ -20,11 +20,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. @@ -51,9 +51,10 @@ class TQTimer; class PoCompendium : public SearchEngine { Q_OBJECT + TQ_OBJECT public: - PoCompendium(TQObject *parent=0, const char *name=0); + PoCompendium(TQObject *tqparent=0, const char *name=0); virtual ~PoCompendium(); virtual bool isReady() const; @@ -67,7 +68,7 @@ public: virtual void saveSettings(KConfigBase *config); virtual void readSettings(KConfigBase *config); - virtual PrefWidget *preferencesWidget(TQWidget *parent); + virtual PrefWidget *preferencesWidget(TQWidget *tqparent); virtual const KAboutData *about() const; @@ -98,7 +99,7 @@ protected slots: protected: void loadCompendium(); void addResult(SearchResult *, TQPtrList<SearchResult>& allResults); - TQString maskString(TQString string); + TQString tqmaskString(TQString string); void registerData(); void unregisterData(); diff --git a/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.cpp b/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.cpp index 1f3a8b37..9cbeb381 100644 --- a/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.cpp +++ b/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.cpp @@ -20,11 +20,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. @@ -44,14 +44,14 @@ #include "preferenceswidget.h" #include "pwidget.h" -CompendiumPreferencesWidget::CompendiumPreferencesWidget(TQWidget *parent, const char* name) - : PrefWidget(parent,name) +CompendiumPreferencesWidget::CompendiumPreferencesWidget(TQWidget *tqparent, const char* name) + : PrefWidget(tqparent,name) , changed(false) { - TQVBoxLayout *layout = new TQVBoxLayout(this); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this); prefWidget = new CompendiumPWidget(this); - layout->addWidget(prefWidget); + tqlayout->addWidget(prefWidget); connect(prefWidget->caseBtn, TQT_SIGNAL(toggled(bool)) , this, TQT_SLOT(setChanged())); diff --git a/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.h b/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.h index 3a22bc31..e67a00d9 100644 --- a/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.h +++ b/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.h @@ -20,11 +20,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. @@ -42,9 +42,10 @@ class CompendiumPWidget; class CompendiumPreferencesWidget : public PrefWidget { Q_OBJECT + TQ_OBJECT public: - CompendiumPreferencesWidget(TQWidget *parent=0, const char* name=0); + CompendiumPreferencesWidget(TQWidget *tqparent=0, const char* name=0); virtual ~CompendiumPreferencesWidget(); virtual void apply(); diff --git a/kbabel/kbabeldict/modules/pocompendium/pwidget.ui b/kbabel/kbabeldict/modules/pocompendium/pwidget.ui index 8f54b087..f1883a88 100644 --- a/kbabel/kbabeldict/modules/pocompendium/pwidget.ui +++ b/kbabel/kbabeldict/modules/pocompendium/pwidget.ui @@ -8,7 +8,7 @@ <cstring>PWidget</cstring> </property> <property stdset="1"> - <name>geometry</name> + <name>tqgeometry</name> <rect> <x>0</x> <y>0</y> @@ -236,14 +236,14 @@ <enum>Expanding</enum> </property> <property> - <name>sizeHint</name> + <name>tqsizeHint</name> <size> <width>20</width> <height>20</height> </size> </property> <property> - <name>sizeHint</name> + <name>tqsizeHint</name> <size> <width>20</width> <height>20</height> |