diff options
Diffstat (limited to 'kbabel/kbabeldict/modules/tmx')
-rw-r--r-- | kbabel/kbabeldict/modules/tmx/pc_factory.cpp | 8 | ||||
-rw-r--r-- | kbabel/kbabeldict/modules/tmx/pc_factory.h | 8 | ||||
-rw-r--r-- | kbabel/kbabeldict/modules/tmx/preferenceswidget.cpp | 94 | ||||
-rw-r--r-- | kbabel/kbabeldict/modules/tmx/preferenceswidget.h | 6 | ||||
-rw-r--r-- | kbabel/kbabeldict/modules/tmx/tmxcompendium.cpp | 164 | ||||
-rw-r--r-- | kbabel/kbabeldict/modules/tmx/tmxcompendium.h | 42 | ||||
-rw-r--r-- | kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.cpp | 64 | ||||
-rw-r--r-- | kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.h | 52 |
8 files changed, 219 insertions, 219 deletions
diff --git a/kbabel/kbabeldict/modules/tmx/pc_factory.cpp b/kbabel/kbabeldict/modules/tmx/pc_factory.cpp index a3dcfdf9..eaea5194 100644 --- a/kbabel/kbabeldict/modules/tmx/pc_factory.cpp +++ b/kbabel/kbabeldict/modules/tmx/pc_factory.cpp @@ -54,7 +54,7 @@ KInstance *PcFactory::s_instance = 0; KAboutData *PcFactory::s_about = 0; -PcFactory::PcFactory( QObject *parent, const char *name) +PcFactory::PcFactory( TQObject *parent, const char *name) : KLibFactory(parent,name) { } @@ -75,10 +75,10 @@ PcFactory::~PcFactory() } -QObject *PcFactory::createObject( QObject *parent, const char *name - , const char *classname, const QStringList &) +TQObject *PcFactory::createObject( TQObject *parent, const char *name + , const char *classname, const TQStringList &) { - if(QCString(classname) != "SearchEngine") + if(TQCString(classname) != "SearchEngine") { kdError() << "not a SearchEngine requested" << endl; return 0; diff --git a/kbabel/kbabeldict/modules/tmx/pc_factory.h b/kbabel/kbabeldict/modules/tmx/pc_factory.h index 5ef08277..74739e0a 100644 --- a/kbabel/kbabeldict/modules/tmx/pc_factory.h +++ b/kbabel/kbabeldict/modules/tmx/pc_factory.h @@ -45,12 +45,12 @@ class PcFactory : public KLibFactory { Q_OBJECT public: - PcFactory( QObject *parent=0, const char *name=0); + PcFactory( TQObject *parent=0, const char *name=0); ~PcFactory(); - virtual QObject *createObject( QObject *parent=0, const char *name=0 - , const char *classname="QObject" - , const QStringList &args = QStringList()); + virtual TQObject *createObject( TQObject *parent=0, const char *name=0 + , const char *classname="TQObject" + , const TQStringList &args = TQStringList()); static KInstance *instance(); diff --git a/kbabel/kbabeldict/modules/tmx/preferenceswidget.cpp b/kbabel/kbabeldict/modules/tmx/preferenceswidget.cpp index 1202496d..85d38294 100644 --- a/kbabel/kbabeldict/modules/tmx/preferenceswidget.cpp +++ b/kbabel/kbabeldict/modules/tmx/preferenceswidget.cpp @@ -32,13 +32,13 @@ your version. **************************************************************************** */ -#include <qcheckbox.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> #include <kfiledialog.h> -#include <qpushbutton.h> -#include <qwhatsthis.h> +#include <tqpushbutton.h> +#include <tqwhatsthis.h> #include <klineedit.h> #include <klocale.h> #include <kurlrequester.h> @@ -46,68 +46,68 @@ #include "preferenceswidget.h" #include "pwidget.h" -TmxCompendiumPreferencesWidget::TmxCompendiumPreferencesWidget(QWidget *parent, const char* name) +TmxCompendiumPreferencesWidget::TmxCompendiumPreferencesWidget(TQWidget *parent, const char* name) : PrefWidget(parent,name) , changed(false) { - QVBoxLayout *layout = new QVBoxLayout(this); + TQVBoxLayout *layout = new TQVBoxLayout(this); prefWidget = new TmxCompendiumPWidget(this); layout->addWidget(prefWidget); - connect(prefWidget->caseBtn, SIGNAL(toggled(bool)) - , this, SLOT(setChanged())); - connect(prefWidget->equalBtn, SIGNAL(toggled(bool)) - , this, SLOT(setChanged())); - connect(prefWidget->ngramBtn, SIGNAL(toggled(bool)) - , this, SLOT(setChanged())); - connect(prefWidget->isContainedBtn, SIGNAL(toggled(bool)) - , this, SLOT(setChanged())); - connect(prefWidget->containsBtn, SIGNAL(toggled(bool)) - , this, SLOT(setChanged())); - connect(prefWidget->hasWordBtn, SIGNAL(toggled(bool)) - , this, SLOT(setChanged())); - connect(prefWidget->wholeBtn, SIGNAL(toggled(bool)) - , this, SLOT(setChanged())); + connect(prefWidget->caseBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(setChanged())); + connect(prefWidget->equalBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(setChanged())); + connect(prefWidget->ngramBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(setChanged())); + connect(prefWidget->isContainedBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(setChanged())); + connect(prefWidget->containsBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(setChanged())); + connect(prefWidget->hasWordBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(setChanged())); + connect(prefWidget->wholeBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(setChanged())); - connect(prefWidget->urlInput->lineEdit(),SIGNAL(textChanged(const QString&)) - , this, SLOT(setChanged())); - - connect(prefWidget->equalBtn, SIGNAL(toggled(bool)) - , this, SLOT(equalBtnToggled(bool))); - connect(prefWidget->ngramBtn, SIGNAL(toggled(bool)) - , this, SLOT(ngramBtnToggled(bool))); - connect(prefWidget->isContainedBtn, SIGNAL(toggled(bool)) - , this, SLOT(isContainedBtnToggled(bool))); - connect(prefWidget->containsBtn, SIGNAL(toggled(bool)) - , this, SLOT(containsBtnToggled(bool))); - connect(prefWidget->hasWordBtn, SIGNAL(toggled(bool)) - , this, SLOT(hasWordBtnToggled(bool))); - - - QString whatsthis=i18n("<qt><p><b>Parameters</b></p>" + connect(prefWidget->urlInput->lineEdit(),TQT_SIGNAL(textChanged(const TQString&)) + , this, TQT_SLOT(setChanged())); + + connect(prefWidget->equalBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(equalBtnToggled(bool))); + connect(prefWidget->ngramBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(ngramBtnToggled(bool))); + connect(prefWidget->isContainedBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(isContainedBtnToggled(bool))); + connect(prefWidget->containsBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(containsBtnToggled(bool))); + connect(prefWidget->hasWordBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(hasWordBtnToggled(bool))); + + + TQString whatsthis=i18n("<qt><p><b>Parameters</b></p>" "<p>Here you can fine-tune searching within the PO file. " "For example, if you want to perform a case sensitive search.</p></qt>" ); - QWhatsThis::add(prefWidget->caseBtn,whatsthis); - QWhatsThis::add(prefWidget->wholeBtn,whatsthis); + TQWhatsThis::add(prefWidget->caseBtn,whatsthis); + TQWhatsThis::add(prefWidget->wholeBtn,whatsthis); whatsthis = i18n("<qt><p><b>Comparison Options</b></p>" "<p>Choose here which messages you want to have treated as a matching " "message.</p></qt>"); - QWhatsThis::add(prefWidget->equalBtn,whatsthis); - QWhatsThis::add(prefWidget->containsBtn,whatsthis); - QWhatsThis::add(prefWidget->isContainedBtn,whatsthis); - QWhatsThis::add(prefWidget->hasWordBtn,whatsthis); + TQWhatsThis::add(prefWidget->equalBtn,whatsthis); + TQWhatsThis::add(prefWidget->containsBtn,whatsthis); + TQWhatsThis::add(prefWidget->isContainedBtn,whatsthis); + TQWhatsThis::add(prefWidget->hasWordBtn,whatsthis); whatsthis = i18n("<qt><p><b>3-Gram-matching</b></p>" "<p>A message matches another if most of its 3-letter groups are " "contained in the other message. e.g. 'abc123' matches 'abcx123c12'.</p></qt>"); - QWhatsThis::add(prefWidget->ngramBtn,whatsthis); + TQWhatsThis::add(prefWidget->ngramBtn,whatsthis); whatsthis = i18n("<qt><p><b>Location</b></p>" "<p>Configure here which file is to be used for searching." "</p></qt>"); - QWhatsThis::add(prefWidget->urlInput,whatsthis); + TQWhatsThis::add(prefWidget->urlInput,whatsthis); } TmxCompendiumPreferencesWidget::~TmxCompendiumPreferencesWidget() @@ -139,7 +139,7 @@ void TmxCompendiumPreferencesWidget::standard() changed=true; } -void TmxCompendiumPreferencesWidget::setURL(const QString url) +void TmxCompendiumPreferencesWidget::setURL(const TQString url) { prefWidget->urlInput->setURL(url); changed=false; @@ -190,7 +190,7 @@ void TmxCompendiumPreferencesWidget::setMatchWords(bool on) -QString TmxCompendiumPreferencesWidget::url() +TQString TmxCompendiumPreferencesWidget::url() { changed=false; return prefWidget->urlInput->url(); diff --git a/kbabel/kbabeldict/modules/tmx/preferenceswidget.h b/kbabel/kbabeldict/modules/tmx/preferenceswidget.h index c8356c3d..e2a4b900 100644 --- a/kbabel/kbabeldict/modules/tmx/preferenceswidget.h +++ b/kbabel/kbabeldict/modules/tmx/preferenceswidget.h @@ -46,14 +46,14 @@ class TmxCompendiumPreferencesWidget : public PrefWidget Q_OBJECT public: - TmxCompendiumPreferencesWidget(QWidget *parent=0, const char* name=0); + TmxCompendiumPreferencesWidget(TQWidget *parent=0, const char* name=0); virtual ~TmxCompendiumPreferencesWidget(); virtual void apply(); virtual void cancel(); virtual void standard(); - void setURL(const QString url); + void setURL(const TQString url); void setMatchEqual(bool); void setMatchNGram(bool); void setMatchIsContained(bool); @@ -62,7 +62,7 @@ public: void setWholeWords(bool); void setCaseSensitive(bool); - QString url(); + TQString url(); bool matchEqual(); bool matchNGram(); bool matchIsContained(); diff --git a/kbabel/kbabeldict/modules/tmx/tmxcompendium.cpp b/kbabel/kbabeldict/modules/tmx/tmxcompendium.cpp index 152bc536..415992bf 100644 --- a/kbabel/kbabeldict/modules/tmx/tmxcompendium.cpp +++ b/kbabel/kbabeldict/modules/tmx/tmxcompendium.cpp @@ -41,8 +41,8 @@ #include <kinstance.h> #include <kio/netaccess.h> -#include <qtextstream.h> -#include <qtimer.h> +#include <tqtextstream.h> +#include <tqtimer.h> #include "tmxcompendiumdata.h" #include "tmxcompendium.h" @@ -55,10 +55,10 @@ #define NGRAM_LEN 3 #define LIM_NGRAM 50 -static KStaticDeleter< QDict<TmxCompendiumData> > compDataDeleter; -QDict<TmxCompendiumData> *TmxCompendium::_compDict = 0; +static KStaticDeleter< TQDict<TmxCompendiumData> > compDataDeleter; +TQDict<TmxCompendiumData> *TmxCompendium::_compDict = 0; -TmxCompendium::TmxCompendium(QObject *parent, const char *name) +TmxCompendium::TmxCompendium(TQObject *parent, const char *name) : SearchEngine(parent, name) { prefWidget=0; @@ -81,8 +81,8 @@ TmxCompendium::TmxCompendium(QObject *parent, const char *name) matchWords=true; - loadTimer = new QTimer(this); - connect(loadTimer,SIGNAL(timeout()),this,SLOT(slotLoadCompendium())); + loadTimer = new TQTimer(this); + connect(loadTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(slotLoadCompendium())); } TmxCompendium::~TmxCompendium() @@ -137,7 +137,7 @@ void TmxCompendium::readSettings(KConfigBase *config) matchWords = config->readBoolEntry("MatchWords",true); matchNGram = config->readBoolEntry("MatchNGram",true); - QString newPath = config->readEntry("Compendium","http://i18n.kde.org/po_overview/@LANG@.messages"); + TQString newPath = config->readEntry("Compendium","http://i18n.kde.org/po_overview/@LANG@.messages"); if(!initialized) { url = newPath; @@ -152,12 +152,12 @@ void TmxCompendium::readSettings(KConfigBase *config) restoreSettings(); } -PrefWidget *TmxCompendium::preferencesWidget(QWidget *parent) +PrefWidget *TmxCompendium::preferencesWidget(TQWidget *parent) { prefWidget = new TmxCompendiumPreferencesWidget(parent,"tmxcompendium_prefwidget"); - connect(prefWidget, SIGNAL(applySettings()), this, SLOT(applySettings())); - connect(prefWidget, SIGNAL(restoreSettings()) - , this, SLOT(restoreSettings())); + connect(prefWidget, TQT_SIGNAL(applySettings()), this, TQT_SLOT(applySettings())); + connect(prefWidget, TQT_SIGNAL(restoreSettings()) + , this, TQT_SLOT(restoreSettings())); restoreSettings(); @@ -170,23 +170,23 @@ const KAboutData *TmxCompendium::about() const } -QString TmxCompendium::name() const +TQString TmxCompendium::name() const { return i18n("TMX Compendium"); } -QString TmxCompendium::id() const +TQString TmxCompendium::id() const { return "tmxcompendium"; } -QString TmxCompendium::lastError() +TQString TmxCompendium::lastError() { return errorMsg; } -bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const SearchFilter*) +bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const SearchFilter*) { if(autoUpdate && prefWidget && prefWidget->settingsChanged()) { @@ -223,8 +223,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear emit started(); - QValueList<int> foundIndices; - QValueList<int> checkedIndices; + TQValueList<int> foundIndices; + TQValueList<int> checkedIndices; uint checkCounter=0; const int *index = data->exactDict(text); @@ -240,8 +240,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear TranslationInfo *info = new TranslationInfo; info->location = directory(realURL,0); - info->translator = QString::null; - info->description = QString::null; + info->translator = TQString::null; + info->description = TQString::null; result->descriptions.append(info); results.append(result); @@ -250,7 +250,7 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear emit resultFound(result); } - QString searchStr=TmxCompendiumData::simplify(text); + TQString searchStr=TmxCompendiumData::simplify(text); if(!caseSensitive) @@ -258,13 +258,13 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear searchStr = searchStr.lower(); } - QString temp = searchStr; + TQString temp = searchStr; temp = temp.lower(); - const QValueList<int> *indexList = data->allDict(temp); + const TQValueList<int> *indexList = data->allDict(temp); if(indexList) { - QValueList<int>::ConstIterator it; + TQValueList<int>::ConstIterator it; for( it = indexList->begin(); it != indexList->end(); ++it ) { if(foundIndices.contains(*it)) @@ -272,7 +272,7 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear continue; } - QString origStr = data->msgid(*it); + TQString origStr = data->msgid(*it); origStr = TmxCompendiumData::simplify(origStr); @@ -294,8 +294,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear TranslationInfo *info = new TranslationInfo; info->location = directory(realURL,0); - info->translator = QString::null; - info->description = QString::null; + info->translator = TQString::null; + info->description = TQString::null; result->descriptions.append(info); addResult(result); @@ -303,8 +303,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear } } - QStringList wList = TmxCompendiumData::wordList(searchStr); - for ( QStringList::Iterator wit = wList.begin() + TQStringList wList = TmxCompendiumData::wordList(searchStr); + for ( TQStringList::Iterator wit = wList.begin() ; wit != wList.end(); ++wit ) { if(stop) @@ -313,7 +313,7 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear indexList = data->wordDict((*wit).lower()); if(indexList) { - QValueList<int>::ConstIterator it; + TQValueList<int>::ConstIterator it; for( it = indexList->begin(); it != indexList->end(); ++it ) { if(stop) @@ -339,7 +339,7 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear kapp->processEvents(100); - QString origStr = data->msgid(*it); + TQString origStr = data->msgid(*it); origStr = TmxCompendiumData::simplify(origStr); @@ -357,8 +357,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear } else { - QString s=*wit; - QString o=origStr; + TQString s=*wit; + TQString o=origStr; if(wholeWords) { @@ -389,8 +389,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear if(!found && matchContains && !wholeWords) { - QString s=maskString(searchStr); - QRegExp searchReg(s); + TQString s=maskString(searchStr); + TQRegExp searchReg(s); if(searchReg.search(origStr) >= 0) found=true; @@ -398,8 +398,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear if(!found && matchIsContained && !wholeWords) { - QString s=maskString(origStr); - QRegExp reg(s); + TQString s=maskString(origStr); + TQRegExp reg(s); if(reg.search(searchStr) >= 0) { @@ -408,13 +408,13 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear } if(!found && matchWords && !wholeWords) { - QStringList list = TmxCompendiumData::wordList(searchStr); + TQStringList list = TmxCompendiumData::wordList(searchStr); - for ( QStringList::Iterator wit2 = list.begin() + for ( TQStringList::Iterator wit2 = list.begin() ; wit2 != list.end(); ++wit2 ) { - QString s=maskString(*wit2); - QRegExp reg(s); + TQString s=maskString(*wit2); + TQRegExp reg(s); if(reg.search(origStr) >= 0) { @@ -436,8 +436,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear TranslationInfo *info = new TranslationInfo; info->location = directory(realURL,0); - info->translator = QString::null; - info->description = QString::null; + info->translator = TQString::null; + info->description = TQString::null; result->descriptions.append(info); addResult(result); @@ -451,10 +451,10 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear (!wholeWords && (matchContains || matchIsContained || matchWords)) ) { - QRegExp searchReg; + TQRegExp searchReg; if(matchContains) { - QString s=maskString(searchStr); + TQString s=maskString(searchStr); searchReg.setPattern(s); } @@ -497,7 +497,7 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear emit progress( (100*(checkCounter+1))/data->numberOfEntries()); } - QString origStr = data->msgid(i); + TQString origStr = data->msgid(i); origStr = TmxCompendiumData::simplify(origStr); if(!caseSensitive) @@ -523,8 +523,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear if(!found && matchIsContained) { - QString s=maskString(origStr); - QRegExp reg(s); + TQString s=maskString(origStr); + TQRegExp reg(s); if(reg.search(searchStr) >= 0) { @@ -533,19 +533,19 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear } if(!found && matchWords) { - QStringList list = TmxCompendiumData::wordList(searchStr); + TQStringList list = TmxCompendiumData::wordList(searchStr); - for ( QStringList::Iterator wit2 = list.begin() + for ( TQStringList::Iterator wit2 = list.begin() ; wit2 != list.end(); ++wit2 ) { - QString s=maskString(*wit2); + TQString s=maskString(*wit2); if(wholeWords) { origStr = " "+origStr+" "; s=" "+s+" "; } - QRegExp reg(s); + TQRegExp reg(s); if(reg.search(origStr) >= 0) { @@ -577,8 +577,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear TranslationInfo *info = new TranslationInfo; info->location = directory(realURL,0); - info->translator = QString::null; - info->description = QString::null; + info->translator = TQString::null; + info->description = TQString::null; result->descriptions.append(info); addResult(result); @@ -629,7 +629,7 @@ void TmxCompendium::applySettings() bool needLoading=false; - QString newPath = prefWidget->url(); + TQString newPath = prefWidget->url(); if(!initialized) { url = newPath; @@ -685,7 +685,7 @@ void TmxCompendium::slotLoadCompendium() } - QString path=url; + TQString path=url; if(path.contains("@LANG@")) { @@ -718,7 +718,7 @@ void TmxCompendium::slotLoadCompendium() } else { - connect(data, SIGNAL(progressEnds()), this, SLOT(recheckData())); + connect(data, TQT_SIGNAL(progressEnds()), this, TQT_SLOT(recheckData())); } } else @@ -737,7 +737,7 @@ void TmxCompendium::recheckData() { if(data) { - disconnect(data, SIGNAL(progressEnds()), this, SLOT(recheckData())); + disconnect(data, TQT_SIGNAL(progressEnds()), this, TQT_SLOT(recheckData())); error = data->hasErrors(); errorMsg = data->errorMsg(); @@ -746,7 +746,7 @@ void TmxCompendium::recheckData() loading=false; } -QString TmxCompendium::maskString(QString s) const +TQString TmxCompendium::maskString(TQString s) const { s.replace('\\',"\\\\"); s.replace('?',"\\?"); @@ -795,7 +795,7 @@ void TmxCompendium::addResult(SearchResult *result) } -void TmxCompendium::setLanguageCode(const QString& lang) +void TmxCompendium::setLanguageCode(const TQString& lang) { if(initialized && url.contains("@LANG@") && lang!=langCode && !loadTimer->isActive() ) @@ -806,7 +806,7 @@ void TmxCompendium::setLanguageCode(const QString& lang) langCode=lang; } -QString TmxCompendium::translate(const QString& text, uint pluralForm) +TQString TmxCompendium::translate(const TQString& text, uint pluralForm) { if(!initialized) { @@ -818,7 +818,7 @@ QString TmxCompendium::translate(const QString& text, uint pluralForm) if(error || !data || data->active()) { - return QString::null; + return TQString::null; } @@ -829,10 +829,10 @@ QString TmxCompendium::translate(const QString& text, uint pluralForm) return data->msgstr(*index); } - return QString::null; + return TQString::null; } -QString TmxCompendium::fuzzyTranslation(const QString& text, int &score, uint pluralForm) +TQString TmxCompendium::fuzzyTranslation(const TQString& text, int &score, uint pluralForm) { if(!initialized) { @@ -844,7 +844,7 @@ QString TmxCompendium::fuzzyTranslation(const QString& text, int &score, uint pl if(error || !data || data->active()) { - return QString::null; + return TQString::null; } // try to find fuzzy string @@ -855,7 +855,7 @@ QString TmxCompendium::fuzzyTranslation(const QString& text, int &score, uint pl int best_match = 0; int total = data->numberOfEntries(); - QString searchStr = TmxCompendiumData::simplify(text); + TQString searchStr = TmxCompendiumData::simplify(text); //kdDebug(750) << "find best match for " << searchStr << endl; @@ -883,7 +883,7 @@ QString TmxCompendium::fuzzyTranslation(const QString& text, int &score, uint pl } // get a message from the catalog - QString origStr = data->msgid(i); + TQString origStr = data->msgid(i); origStr = TmxCompendiumData::simplify(origStr); // don't match too long strings for short search string @@ -907,7 +907,7 @@ QString TmxCompendium::fuzzyTranslation(const QString& text, int &score, uint pl return data->msgstr(best_matching); } - return QString::null; + return TQString::null; } @@ -915,14 +915,14 @@ void TmxCompendium::unregisterData() { if(data) { - disconnect(data, SIGNAL(progressStarts(const QString&)), this - , SIGNAL(progressStarts(const QString&))); - disconnect(data, SIGNAL(progressEnds()), this , SIGNAL(progressEnds())); - disconnect(data, SIGNAL(progress(int)), this , SIGNAL(progress(int))); + disconnect(data, TQT_SIGNAL(progressStarts(const TQString&)), this + , TQT_SIGNAL(progressStarts(const TQString&))); + disconnect(data, TQT_SIGNAL(progressEnds()), this , TQT_SIGNAL(progressEnds())); + disconnect(data, TQT_SIGNAL(progress(int)), this , TQT_SIGNAL(progress(int))); if(data->active()) { - disconnect(data,SIGNAL(progressEnds()),this,SLOT(recheckData())); + disconnect(data,TQT_SIGNAL(progressEnds()),this,TQT_SLOT(recheckData())); } if(data->unregisterObject(this)) @@ -933,7 +933,7 @@ void TmxCompendium::unregisterData() } else { - connect(data,SIGNAL(progressEnds()),this,SLOT(removeData())); + connect(data,TQT_SIGNAL(progressEnds()),this,TQT_SLOT(removeData())); } } @@ -957,21 +957,21 @@ void TmxCompendium::registerData() emit progressStarts(i18n("Loading PO compendium")); } - connect(data, SIGNAL(progressStarts(const QString&)), this - , SIGNAL(progressStarts(const QString&))); - connect(data, SIGNAL(progressEnds()), this , SIGNAL(progressEnds())); - connect(data, SIGNAL(progress(int)), this , SIGNAL(progress(int))); + connect(data, TQT_SIGNAL(progressStarts(const TQString&)), this + , TQT_SIGNAL(progressStarts(const TQString&))); + connect(data, TQT_SIGNAL(progressEnds()), this , TQT_SIGNAL(progressEnds())); + connect(data, TQT_SIGNAL(progress(int)), this , TQT_SIGNAL(progress(int))); } void TmxCompendium::removeData() { - const QObject *s=sender(); + const TQObject *s=sender(); if(s && s->inherits("TmxCompendiumData")) { const TmxCompendiumData *d=static_cast<const TmxCompendiumData*>(s); if(d) { - QDictIterator<TmxCompendiumData> it(*compendiumDict()); + TQDictIterator<TmxCompendiumData> it(*compendiumDict()); while(it.current()) { if(it.current() == d) @@ -991,11 +991,11 @@ void TmxCompendium::removeData() } } -QDict<TmxCompendiumData> *TmxCompendium::compendiumDict() +TQDict<TmxCompendiumData> *TmxCompendium::compendiumDict() { if(!_compDict) { - _compDict=compDataDeleter.setObject( new QDict<TmxCompendiumData> ); + _compDict=compDataDeleter.setObject( new TQDict<TmxCompendiumData> ); _compDict->setAutoDelete(true); } diff --git a/kbabel/kbabeldict/modules/tmx/tmxcompendium.h b/kbabel/kbabeldict/modules/tmx/tmxcompendium.h index 9a2f8fba..21270799 100644 --- a/kbabel/kbabeldict/modules/tmx/tmxcompendium.h +++ b/kbabel/kbabeldict/modules/tmx/tmxcompendium.h @@ -39,9 +39,9 @@ #include "tmxcompendiumdata.h" #include "searchengine.h" -#include <qdict.h> -#include <qfile.h> -#include <qguardedptr.h> +#include <tqdict.h> +#include <tqfile.h> +#include <tqguardedptr.h> class TmxCompendiumPreferencesWidget; class KConfigBase; @@ -52,34 +52,34 @@ class TmxCompendium : public SearchEngine Q_OBJECT public: - TmxCompendium(QObject *parent=0, const char *name=0); + TmxCompendium(TQObject *parent=0, const char *name=0); virtual ~TmxCompendium(); virtual bool isReady() const; - virtual QString translate(const QString& text, uint pluralForm); - virtual QString fuzzyTranslation(const QString& text, int &score, uint pluralForm); + virtual TQString translate(const TQString& text, uint pluralForm); + virtual TQString fuzzyTranslation(const TQString& text, int &score, uint pluralForm); virtual bool isSearching() const; virtual void saveSettings(KConfigBase *config); virtual void readSettings(KConfigBase *config); - virtual PrefWidget *preferencesWidget(QWidget *parent); + virtual PrefWidget *preferencesWidget(TQWidget *parent); virtual const KAboutData *about() const; - virtual QString name() const; + virtual TQString name() const; - virtual QString id() const; + virtual TQString id() const; - virtual QString lastError(); + virtual TQString lastError(); public slots: - virtual bool startSearch(const QString& text, uint pluralForm, const SearchFilter* filter); + virtual bool startSearch(const TQString& text, uint pluralForm, const SearchFilter* filter); virtual void stopSearch(); - virtual void setLanguageCode(const QString& lang); + virtual void setLanguageCode(const TQString& lang); protected slots: /** reads the current settings from the preferences dialog */ @@ -96,19 +96,19 @@ protected slots: protected: void loadCompendium(); void addResult(SearchResult *); - QString maskString(QString string) const; + TQString maskString(TQString string) const; void registerData(); void unregisterData(); private: - QGuardedPtr<TmxCompendiumPreferencesWidget> prefWidget; + TQGuardedPtr<TmxCompendiumPreferencesWidget> prefWidget; TmxCompendiumData *data; - QTimer *loadTimer; + TQTimer *loadTimer; - QString url; - QString realURL; - QString langCode; + TQString url; + TQString realURL; + TQString langCode; bool caseSensitive; bool wholeWords; @@ -123,15 +123,15 @@ private: uint freeMemDelay; bool error; - QString errorMsg; + TQString errorMsg; bool stop; bool active; bool initialized; bool loading; - static QDict<TmxCompendiumData> *_compDict; - static QDict<TmxCompendiumData> *compendiumDict(); + static TQDict<TmxCompendiumData> *_compDict; + static TQDict<TmxCompendiumData> *compendiumDict(); }; #endif diff --git a/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.cpp b/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.cpp index 3fa84aa4..7893e837 100644 --- a/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.cpp +++ b/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.cpp @@ -34,8 +34,8 @@ **************************************************************************** */ #include "tmxcompendiumdata.h" -#include <qdom.h> -#include <qfile.h> +#include <tqdom.h> +#include <tqfile.h> #include <tagextractor.h> #include <resources.h> @@ -47,8 +47,8 @@ using namespace KBabel; -TmxCompendiumData::TmxCompendiumData(QObject *parent) - : QObject(parent) +TmxCompendiumData::TmxCompendiumData(TQObject *parent) + : TQObject(parent) , _active(false) , _error(false) , _initialized(false) @@ -62,7 +62,7 @@ TmxCompendiumData::TmxCompendiumData(QObject *parent) } -bool TmxCompendiumData::load(const KURL& url, const QString& language) +bool TmxCompendiumData::load(const KURL& url, const TQString& language) { kdDebug(KBABEL_SEARCH) << "Load " << url.url() << " in " << language << endl; if(_active) @@ -79,13 +79,13 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) emit progressStarts(i18n("Loading TMX compendium")); - QDomDocument doc( "mydocument" ); + TQDomDocument doc( "mydocument" ); - QString target; + TQString target; if( KIO::NetAccess::download( url, target ) ) { - QFile f( target ); + TQFile f( target ); if ( !f.open( IO_ReadOnly ) ) { _error = true; @@ -102,7 +102,7 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) _errorMsg = i18n( "Cannot open the file." ); } - QDomElement docElem = doc.documentElement(); + TQDomElement docElem = doc.documentElement(); if( docElem.tagName() != "tmx" || !(docElem.hasAttribute("version") && docElem.attribute("version") == "1.4" ) ) @@ -131,7 +131,7 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) emit progressStarts(i18n("Building indices")); - QDomNodeList tuTags = docElem.elementsByTagName("tu"); + TQDomNodeList tuTags = docElem.elementsByTagName("tu"); uint total = tuTags.count(); _originals.clear(); @@ -149,11 +149,11 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) kapp->processEvents(100); } - QDomNodeList tuvTags = tuTags.item(i).toElement().elementsByTagName("tuv"); - QString english, other; + TQDomNodeList tuvTags = tuTags.item(i).toElement().elementsByTagName("tuv"); + TQString english, other; for( uint j = 0 ; j < tuvTags.count() ; j++ ) { - QDomElement el = tuvTags.item(j).toElement(); + TQDomElement el = tuvTags.item(j).toElement(); if( el.attribute("xml:lang").upper() == "EN" ) english = el.text(); if( el.attribute("xml:lang").upper().startsWith(language.upper()) ) other = el.text(); @@ -165,7 +165,7 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) _originals[lastindex] = english; _translations[lastindex] = other; - QString temp = english; + TQString temp = english; int *index = new int(lastindex); _exactDict.insert(temp,index); @@ -175,18 +175,18 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) if(!temp.isEmpty() && temp.length() > 1) { - QValueList<int> *indexList=_allDict[temp]; + TQValueList<int> *indexList=_allDict[temp]; if(!indexList) { - indexList = new QValueList<int>; + indexList = new TQValueList<int>; _allDict.insert(temp,indexList); } indexList->append(lastindex); - QStringList wList = wordList(temp); - for ( QStringList::Iterator it = wList.begin() + TQStringList wList = wordList(temp); + for ( TQStringList::Iterator it = wList.begin() ; it != wList.end(); ++it ) { if( (*it).length() > 1) @@ -195,7 +195,7 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) if(!indexList) { - indexList = new QValueList<int>; + indexList = new TQValueList<int>; _wordDict.insert(*it,indexList); } @@ -210,7 +210,7 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) // remove words, that are too frequent uint max=_allDict.count()/10; - QDictIterator< QValueList<int> > it(_wordDict); + TQDictIterator< TQValueList<int> > it(_wordDict); while ( it.current() ) { if(it.current()->count() > max) @@ -240,39 +240,39 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) return true; } -const int* TmxCompendiumData::exactDict(const QString& text) const +const int* TmxCompendiumData::exactDict(const TQString& text) const { return _exactDict[text]; } -const QValueList<int>* TmxCompendiumData::allDict(const QString& text) const +const TQValueList<int>* TmxCompendiumData::allDict(const TQString& text) const { return _allDict[text]; } -const QValueList<int>* TmxCompendiumData::wordDict(const QString& text) const +const TQValueList<int>* TmxCompendiumData::wordDict(const TQString& text) const { return _wordDict[text]; } -const QString TmxCompendiumData::msgid(const int index) const +const TQString TmxCompendiumData::msgid(const int index) const { return _originals[index]; } -const QString TmxCompendiumData::msgstr(const int index) const +const TQString TmxCompendiumData::msgstr(const int index) const { return _translations[index]; } -void TmxCompendiumData::registerObject(QObject *obj) +void TmxCompendiumData::registerObject(TQObject *obj) { if(!_registered.containsRef(obj)) _registered.append(obj); } -bool TmxCompendiumData::unregisterObject(QObject *obj) +bool TmxCompendiumData::unregisterObject(TQObject *obj) { _registered.removeRef(obj); @@ -284,9 +284,9 @@ bool TmxCompendiumData::hasObjects() const return _registered.count()==0; } -QString TmxCompendiumData::simplify(const QString& string) +TQString TmxCompendiumData::simplify(const TQString& string) { - QString result; + TQString result; TagExtractor te; te.setString(string); @@ -298,11 +298,11 @@ QString TmxCompendiumData::simplify(const QString& string) return result; } -QStringList TmxCompendiumData::wordList(const QString& string) +TQStringList TmxCompendiumData::wordList(const TQString& string) { - QString result=TmxCompendiumData::simplify(string); + TQString result=TmxCompendiumData::simplify(string); - return QStringList::split(' ',result); + return TQStringList::split(' ',result); } #include "tmxcompendiumdata.moc" diff --git a/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.h b/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.h index bc88a92e..ce2692a1 100644 --- a/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.h +++ b/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.h @@ -37,52 +37,52 @@ #include <kurl.h> -#include <qdict.h> -#include <qobject.h> -#include <qstringlist.h> -#include <qvaluelist.h> -#include <qvaluevector.h> -#include <qptrlist.h> +#include <tqdict.h> +#include <tqobject.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> +#include <tqvaluevector.h> +#include <tqptrlist.h> class TmxCompendiumData : public QObject { Q_OBJECT public: - TmxCompendiumData(QObject *parent=0); + TmxCompendiumData(TQObject *parent=0); - bool load(const KURL& url, const QString& language); + bool load(const KURL& url, const TQString& language); - const int *exactDict(const QString& text) const; - const QValueList<int> *allDict(const QString& text) const; - const QValueList<int> *wordDict(const QString& text) const; + const int *exactDict(const TQString& text) const; + const TQValueList<int> *allDict(const TQString& text) const; + const TQValueList<int> *wordDict(const TQString& text) const; - const QString msgid(const int index) const; - const QString msgstr(const int index) const; + const TQString msgid(const int index) const; + const TQString msgstr(const int index) const; const int numberOfEntries() const { return _exactDict.count(); } bool active() const { return _active; } bool initialized() const { return _initialized; } bool hasErrors() const { return _error; } - QString errorMsg() const { return _errorMsg; } + TQString errorMsg() const { return _errorMsg; } /** registers an object, that uses this data */ - void registerObject(QObject *); + void registerObject(TQObject *); /** * unregisters an object, that uses this data * * @return true, if this was the last object */ - bool unregisterObject(QObject *); + bool unregisterObject(TQObject *); bool hasObjects() const; - static QString simplify(const QString& text); - static QStringList wordList(const QString& text); + static TQString simplify(const TQString& text); + static TQStringList wordList(const TQString& text); signals: - void progressStarts(const QString&); + void progressStarts(const TQString&); void progressEnds(); void progress(int); @@ -91,16 +91,16 @@ private: bool _active; bool _error; bool _initialized; - QString _errorMsg; + TQString _errorMsg; - QDict<int> _exactDict; - QDict< QValueList<int> > _allDict; - QDict< QValueList<int> > _wordDict; + TQDict<int> _exactDict; + TQDict< TQValueList<int> > _allDict; + TQDict< TQValueList<int> > _wordDict; - QValueVector<QString> _originals; - QValueVector<QString> _translations; + TQValueVector<TQString> _originals; + TQValueVector<TQString> _translations; - QPtrList<QObject> _registered; + TQPtrList<TQObject> _registered; }; #endif |