summaryrefslogtreecommitdiffstats
path: root/kbabel/kbabeldict/modules/pocompendium
diff options
context:
space:
mode:
Diffstat (limited to 'kbabel/kbabeldict/modules/pocompendium')
-rw-r--r--kbabel/kbabeldict/modules/pocompendium/compendiumdata.cpp52
-rw-r--r--kbabel/kbabeldict/modules/pocompendium/compendiumdata.h44
-rw-r--r--kbabel/kbabeldict/modules/pocompendium/pc_factory.cpp8
-rw-r--r--kbabel/kbabeldict/modules/pocompendium/pc_factory.h8
-rw-r--r--kbabel/kbabeldict/modules/pocompendium/pocompendium.cpp196
-rw-r--r--kbabel/kbabeldict/modules/pocompendium/pocompendium.h58
-rw-r--r--kbabel/kbabeldict/modules/pocompendium/preferenceswidget.cpp100
-rw-r--r--kbabel/kbabeldict/modules/pocompendium/preferenceswidget.h6
8 files changed, 236 insertions, 236 deletions
diff --git a/kbabel/kbabeldict/modules/pocompendium/compendiumdata.cpp b/kbabel/kbabeldict/modules/pocompendium/compendiumdata.cpp
index d862b236..9eb816bd 100644
--- a/kbabel/kbabeldict/modules/pocompendium/compendiumdata.cpp
+++ b/kbabel/kbabeldict/modules/pocompendium/compendiumdata.cpp
@@ -42,8 +42,8 @@
using namespace KBabel;
-CompendiumData::CompendiumData(QObject *parent)
- : QObject(parent)
+CompendiumData::CompendiumData(TQObject *parent)
+ : TQObject(parent)
, _active(false)
, _error(false)
, _initialized(false)
@@ -53,7 +53,7 @@ CompendiumData::CompendiumData(QObject *parent)
, _wordDict(9887)
, _textonlyDict(9887)
{
- _catalog = new Catalog(this, "CompendiumData::catalog", QString::null);
+ _catalog = new Catalog(this, "CompendiumData::catalog", TQString::null);
_exactDict.setAutoDelete(true);
_allDict.setAutoDelete(true);
_wordDict.setAutoDelete(true);
@@ -77,12 +77,12 @@ bool CompendiumData::load(KURL url)
emit progressStarts(i18n("Loading PO compendium"));
- connect(_catalog, SIGNAL(signalProgress(int)), this, SIGNAL(progress(int)));
+ connect(_catalog, TQT_SIGNAL(signalProgress(int)), this, TQT_SIGNAL(progress(int)));
ConversionStatus stat=_catalog->openURL(url);
- disconnect(_catalog, SIGNAL(signalProgress(int))
- , this, SIGNAL(progress(int)));
+ disconnect(_catalog, TQT_SIGNAL(signalProgress(int))
+ , this, TQT_SIGNAL(progress(int)));
if( stat!= OK && stat != RECOVERED_PARSE_ERROR)
@@ -113,7 +113,7 @@ bool CompendiumData::load(KURL url)
}
// FIXME: shoudl care about plural forms
- QString temp = _catalog->msgid(i,true).first();
+ TQString temp = _catalog->msgid(i,true).first();
int *index = new int(i);
_exactDict.insert(temp,index);
@@ -125,25 +125,25 @@ bool CompendiumData::load(KURL url)
if(!temp.isEmpty() && temp.length() > 1)
{
// add to allDict
- 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(i);
// add to textonlyDict
- QString temp1 = temp;
+ TQString temp1 = temp;
temp1.remove( ' ' );
indexList=_textonlyDict[temp1];
if(!indexList)
{
- indexList = new QValueList<int>;
+ indexList = new TQValueList<int>;
_textonlyDict.insert(temp1,indexList);
kdDebug() << "Adding " << temp1 << endl;
}
@@ -151,8 +151,8 @@ bool CompendiumData::load(KURL url)
indexList->append(i);
// add to wordDict
- 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)
@@ -161,7 +161,7 @@ bool CompendiumData::load(KURL url)
if(!indexList)
{
- indexList = new QValueList<int>;
+ indexList = new TQValueList<int>;
_wordDict.insert(*it,indexList);
}
@@ -173,7 +173,7 @@ bool CompendiumData::load(KURL url)
// 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)
@@ -198,34 +198,34 @@ bool CompendiumData::load(KURL url)
return true;
}
-const int* CompendiumData::exactDict(const QString text) const
+const int* CompendiumData::exactDict(const TQString text) const
{
return _exactDict[text];
}
-const QValueList<int>* CompendiumData::allDict(const QString text) const
+const TQValueList<int>* CompendiumData::allDict(const TQString text) const
{
return _allDict[text];
}
-const QValueList<int>* CompendiumData::wordDict(const QString text) const
+const TQValueList<int>* CompendiumData::wordDict(const TQString text) const
{
return _wordDict[text];
}
-const QValueList<int>* CompendiumData::textonlyDict(const QString text) const
+const TQValueList<int>* CompendiumData::textonlyDict(const TQString text) const
{
return _textonlyDict[text];
}
-void CompendiumData::registerObject(QObject *obj)
+void CompendiumData::registerObject(TQObject *obj)
{
if(!_registered.containsRef(obj))
_registered.append(obj);
}
-bool CompendiumData::unregisterObject(QObject *obj)
+bool CompendiumData::unregisterObject(TQObject *obj)
{
_registered.removeRef(obj);
@@ -237,9 +237,9 @@ bool CompendiumData::hasObjects() const
return _registered.count()==0;
}
-QString CompendiumData::simplify(const QString string)
+TQString CompendiumData::simplify(const TQString string)
{
- QString result;
+ TQString result;
TagExtractor te;
te.setString(string);
@@ -251,11 +251,11 @@ QString CompendiumData::simplify(const QString string)
return result;
}
-QStringList CompendiumData::wordList(const QString string)
+TQStringList CompendiumData::wordList(const TQString string)
{
- QString result=CompendiumData::simplify(string);
+ TQString result=CompendiumData::simplify(string);
- return QStringList::split(' ',result);
+ return TQStringList::split(' ',result);
}
#include "compendiumdata.moc"
diff --git a/kbabel/kbabeldict/modules/pocompendium/compendiumdata.h b/kbabel/kbabeldict/modules/pocompendium/compendiumdata.h
index 2fec45cb..d5668b4a 100644
--- a/kbabel/kbabeldict/modules/pocompendium/compendiumdata.h
+++ b/kbabel/kbabeldict/modules/pocompendium/compendiumdata.h
@@ -35,11 +35,11 @@
#include <kurl.h>
-#include <qdict.h>
-#include <qobject.h>
-#include <qstringlist.h>
-#include <qvaluelist.h>
-#include <qptrlist.h>
+#include <tqdict.h>
+#include <tqobject.h>
+#include <tqstringlist.h>
+#include <tqvaluelist.h>
+#include <tqptrlist.h>
namespace KBabel
{
@@ -51,38 +51,38 @@ class CompendiumData : public QObject
Q_OBJECT
public:
- CompendiumData(QObject *parent=0);
+ CompendiumData(TQObject *parent=0);
bool load(KURL url);
const KBabel::Catalog *catalog() const { return _catalog; }
- const int *exactDict(const QString text) const;
- const QValueList<int> *allDict(const QString text) const;
- const QValueList<int> *wordDict(const QString text) const;
- const QValueList<int> *textonlyDict(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 TQValueList<int> *textonlyDict(const TQString text) const;
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,15 +91,15 @@ private:
bool _active;
bool _error;
bool _initialized;
- QString _errorMsg;
+ TQString _errorMsg;
KBabel::Catalog *_catalog;
- QDict<int> _exactDict;
- QDict< QValueList<int> > _allDict;
- QDict< QValueList<int> > _wordDict;
- QDict< QValueList<int> > _textonlyDict;
+ TQDict<int> _exactDict;
+ TQDict< TQValueList<int> > _allDict;
+ TQDict< TQValueList<int> > _wordDict;
+ TQDict< TQValueList<int> > _textonlyDict;
- QPtrList<QObject> _registered;
+ TQPtrList<TQObject> _registered;
};
#endif
diff --git a/kbabel/kbabeldict/modules/pocompendium/pc_factory.cpp b/kbabel/kbabeldict/modules/pocompendium/pc_factory.cpp
index 882cc064..37ae63a4 100644
--- a/kbabel/kbabeldict/modules/pocompendium/pc_factory.cpp
+++ b/kbabel/kbabeldict/modules/pocompendium/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/pocompendium/pc_factory.h b/kbabel/kbabeldict/modules/pocompendium/pc_factory.h
index d52fadfe..1b0b8820 100644
--- a/kbabel/kbabeldict/modules/pocompendium/pc_factory.h
+++ b/kbabel/kbabeldict/modules/pocompendium/pc_factory.h
@@ -43,12 +43,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/pocompendium/pocompendium.cpp b/kbabel/kbabeldict/modules/pocompendium/pocompendium.cpp
index 0cd79fb3..5220f88a 100644
--- a/kbabel/kbabeldict/modules/pocompendium/pocompendium.cpp
+++ b/kbabel/kbabeldict/modules/pocompendium/pocompendium.cpp
@@ -41,9 +41,9 @@
#include <kinstance.h>
#include <kio/netaccess.h>
-#include <qregexp.h>
-#include <qtextstream.h>
-#include <qtimer.h>
+#include <tqregexp.h>
+#include <tqtextstream.h>
+#include <tqtimer.h>
#include "resources.h"
#include "compendiumdata.h"
@@ -60,10 +60,10 @@
using namespace KBabel;
-static KStaticDeleter< QDict<CompendiumData> > compDataDeleter;
-QDict<CompendiumData> *PoCompendium::_compDict = 0;
+static KStaticDeleter< TQDict<CompendiumData> > compDataDeleter;
+TQDict<CompendiumData> *PoCompendium::_compDict = 0;
-PoCompendium::PoCompendium(QObject *parent, const char *name)
+PoCompendium::PoCompendium(TQObject *parent, const char *name)
: SearchEngine(parent, name)
{
prefWidget=0;
@@ -87,8 +87,8 @@ PoCompendium::PoCompendium(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()));
}
PoCompendium::~PoCompendium()
@@ -145,7 +145,7 @@ void PoCompendium::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;
@@ -160,13 +160,13 @@ void PoCompendium::readSettings(KConfigBase *config)
restoreSettings();
}
-PrefWidget *PoCompendium::preferencesWidget(QWidget *parent)
+PrefWidget *PoCompendium::preferencesWidget(TQWidget *parent)
{
prefWidget = new CompendiumPreferencesWidget(parent,"pocompendium_prefwidget");
kdDebug(KBABEL_SEARCH) << "PreferencesWidget is " << prefWidget << endl;
- 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();
@@ -179,22 +179,22 @@ const KAboutData *PoCompendium::about() const
}
-QString PoCompendium::name() const
+TQString PoCompendium::name() const
{
return i18n("PO Compendium");
}
-QString PoCompendium::id() const
+TQString PoCompendium::id() const
{
return "pocompendium";
}
-QString PoCompendium::lastError()
+TQString PoCompendium::lastError()
{
return errorMsg;
}
-bool PoCompendium::searchExact(const QString& text, uint pluralForm, QPtrList<SearchResult>& results, QValueList<int>& foundIndices, QValueList<int>& )
+bool PoCompendium::searchExact(const TQString& text, uint pluralForm, TQPtrList<SearchResult>& results, TQValueList<int>& foundIndices, TQValueList<int>& )
{
const int *index = data->exactDict(text);
if(index)
@@ -222,14 +222,14 @@ bool PoCompendium::searchExact(const QString& text, uint pluralForm, QPtrList<Se
}
-bool PoCompendium::searchCaseInsensitive(const QString& text, uint pluralForm, QPtrList<SearchResult>& results, QValueList<int>& foundIndices, QValueList<int>& )
+bool PoCompendium::searchCaseInsensitive(const TQString& text, uint pluralForm, TQPtrList<SearchResult>& results, TQValueList<int>& foundIndices, TQValueList<int>& )
{
- QString searchStr = text.lower();
+ TQString searchStr = text.lower();
- const QValueList<int> *indexList = data->allDict(text.lower());
+ const TQValueList<int> *indexList = data->allDict(text.lower());
if(indexList)
{
- QValueList<int>::ConstIterator it;
+ TQValueList<int>::ConstIterator it;
for( it = indexList->begin(); it != indexList->end(); ++it )
{
if(foundIndices.contains(*it))
@@ -243,7 +243,7 @@ bool PoCompendium::searchCaseInsensitive(const QString& text, uint pluralForm, Q
}
- QString origStr = data->catalog()->msgid(*it).first();
+ TQString origStr = data->catalog()->msgid(*it).first();
origStr = CompendiumData::simplify(origStr);
@@ -276,16 +276,16 @@ bool PoCompendium::searchCaseInsensitive(const QString& text, uint pluralForm, Q
return false;
}
-bool PoCompendium::searchTextOnly(const QString& text, uint pluralForm, QPtrList<SearchResult>& results, QValueList<int>& foundIndices, QValueList<int>& )
+bool PoCompendium::searchTextOnly(const TQString& text, uint pluralForm, TQPtrList<SearchResult>& results, TQValueList<int>& foundIndices, TQValueList<int>& )
{
- QString searchStr = text.lower();
- QString t = text;
+ TQString searchStr = text.lower();
+ TQString t = text;
t.remove( " " );
- const QValueList<int> *indexList = data->textonlyDict(t.lower());
+ const TQValueList<int> *indexList = data->textonlyDict(t.lower());
if(indexList)
{
- QValueList<int>::ConstIterator it;
+ TQValueList<int>::ConstIterator it;
for( it = indexList->begin(); it != indexList->end(); ++it )
{
if(foundIndices.contains(*it))
@@ -299,7 +299,7 @@ bool PoCompendium::searchTextOnly(const QString& text, uint pluralForm, QPtrList
}
- QString origStr = data->catalog()->msgid(*it).first();
+ TQString origStr = data->catalog()->msgid(*it).first();
origStr = CompendiumData::simplify(origStr);
@@ -325,22 +325,22 @@ bool PoCompendium::searchTextOnly(const QString& text, uint pluralForm, QPtrList
return false;
}
-bool PoCompendium::searchWords(const QString& searchStr, uint pluralForm, QPtrList<SearchResult>& results, QValueList<int>& foundIndices, QValueList<int>& checkedIndices )
+bool PoCompendium::searchWords(const TQString& searchStr, uint pluralForm, TQPtrList<SearchResult>& results, TQValueList<int>& foundIndices, TQValueList<int>& checkedIndices )
{
uint checkCounter = 0;
bool foundResults = false;
- QStringList wList = CompendiumData::wordList(searchStr);
- for ( QStringList::Iterator wit = wList.begin()
+ TQStringList wList = CompendiumData::wordList(searchStr);
+ for ( TQStringList::Iterator wit = wList.begin()
; wit != wList.end(); ++wit )
{
if(stop)
break;
- const QValueList<int> *indexList = data->wordDict((*wit).lower());
+ const TQValueList<int> *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)
@@ -371,7 +371,7 @@ bool PoCompendium::searchWords(const QString& searchStr, uint pluralForm, QPtrLi
kapp->processEvents(100);
- QString origStr = data->catalog()->msgid(*it).first();
+ TQString origStr = data->catalog()->msgid(*it).first();
origStr = CompendiumData::simplify(origStr);
@@ -389,8 +389,8 @@ bool PoCompendium::searchWords(const QString& searchStr, uint pluralForm, QPtrLi
}
else
{
- QString s=*wit;
- QString o=origStr;
+ TQString s=*wit;
+ TQString o=origStr;
if(wholeWords)
{
@@ -421,8 +421,8 @@ bool PoCompendium::searchWords(const QString& searchStr, uint pluralForm, QPtrLi
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;
@@ -430,8 +430,8 @@ bool PoCompendium::searchWords(const QString& searchStr, uint pluralForm, QPtrLi
if(!found && matchIsContained && !wholeWords)
{
- QString s=maskString(origStr);
- QRegExp reg(s);
+ TQString s=maskString(origStr);
+ TQRegExp reg(s);
if(reg.search(searchStr) >= 0)
{
@@ -440,13 +440,13 @@ bool PoCompendium::searchWords(const QString& searchStr, uint pluralForm, QPtrLi
}
if(!found && matchWords && !wholeWords)
{
- QStringList list = CompendiumData::wordList(searchStr);
+ TQStringList list = CompendiumData::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)
{
@@ -483,15 +483,15 @@ bool PoCompendium::searchWords(const QString& searchStr, uint pluralForm, QPtrLi
return foundResults;
}
-bool PoCompendium::searchNGram(const QString& searchStr, uint pluralForm, QPtrList<SearchResult>& results, QValueList<int>& foundIndices, QValueList<int>& checkedIndices )
+bool PoCompendium::searchNGram(const TQString& searchStr, uint pluralForm, TQPtrList<SearchResult>& results, TQValueList<int>& foundIndices, TQValueList<int>& checkedIndices )
{
uint checkCounter = 0;
bool foundResults = false;
- QRegExp searchReg;
+ TQRegExp searchReg;
if(matchContains)
{
- QString s=maskString(searchStr);
+ TQString s=maskString(searchStr);
searchReg.setPattern(s);
}
@@ -539,7 +539,7 @@ bool PoCompendium::searchNGram(const QString& searchStr, uint pluralForm, QPtrLi
kapp->processEvents(100);
- QString origStr = data->catalog()->msgid(i).first();
+ TQString origStr = data->catalog()->msgid(i).first();
origStr = CompendiumData::simplify(origStr);
if(!caseSensitive)
@@ -564,8 +564,8 @@ bool PoCompendium::searchNGram(const QString& searchStr, uint pluralForm, QPtrLi
if(!found && matchIsContained)
{
- QString s=maskString(origStr);
- QRegExp reg(s);
+ TQString s=maskString(origStr);
+ TQRegExp reg(s);
if(reg.search(searchStr) >= 0)
{
@@ -575,19 +575,19 @@ bool PoCompendium::searchNGram(const QString& searchStr, uint pluralForm, QPtrLi
if(!found && matchWords)
{
- QStringList list = CompendiumData::wordList(searchStr);
+ TQStringList list = CompendiumData::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)
{
@@ -632,7 +632,7 @@ bool PoCompendium::searchNGram(const QString& searchStr, uint pluralForm, QPtrLi
return foundResults;
}
-bool PoCompendium::startSearch(const QString& text, uint pluralForm, const SearchFilter* filter)
+bool PoCompendium::startSearch(const TQString& text, uint pluralForm, const SearchFilter* filter)
{
if(autoUpdate && prefWidget && prefWidget->settingsChanged())
{
@@ -669,13 +669,13 @@ bool PoCompendium::startSearch(const QString& text, uint pluralForm, const Searc
emit started();
- QValueList<int> foundIndices;
- QValueList<int> checkedIndices;
+ TQValueList<int> foundIndices;
+ TQValueList<int> checkedIndices;
// first, exact search
searchExact(text, pluralForm, results, foundIndices, checkedIndices);
- QString searchStr=CompendiumData::simplify(text);
+ TQString searchStr=CompendiumData::simplify(text);
if(!caseSensitive)
@@ -738,7 +738,7 @@ void PoCompendium::applySettings()
bool needLoading=false;
- QString newPath = prefWidget->url();
+ TQString newPath = prefWidget->url();
if(!initialized)
{
url = newPath;
@@ -795,7 +795,7 @@ void PoCompendium::slotLoadCompendium()
}
- QString path=url;
+ TQString path=url;
if(path.contains("@LANG@"))
{
@@ -828,7 +828,7 @@ void PoCompendium::slotLoadCompendium()
}
else
{
- connect(data, SIGNAL(progressEnds()), this, SLOT(recheckData()));
+ connect(data, TQT_SIGNAL(progressEnds()), this, TQT_SLOT(recheckData()));
}
}
else
@@ -847,7 +847,7 @@ void PoCompendium::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();
@@ -864,7 +864,7 @@ void PoCompendium::recheckData()
loading=false;
}
-QString PoCompendium::maskString(QString s)
+TQString PoCompendium::maskString(TQString s)
{
s.replace("\\","\\\\");
s.replace("\?","\\?");
@@ -883,7 +883,7 @@ QString PoCompendium::maskString(QString s)
return s;
}
-void PoCompendium::addResult(SearchResult *result, QPtrList<SearchResult>& res)
+void PoCompendium::addResult(SearchResult *result, TQPtrList<SearchResult>& res)
{
if(res.last() && res.last()->score >= result->score)
{
@@ -915,7 +915,7 @@ void PoCompendium::addResult(SearchResult *result, QPtrList<SearchResult>& res)
}
-void PoCompendium::setLanguageCode(const QString& lang)
+void PoCompendium::setLanguageCode(const TQString& lang)
{
if(initialized && url.contains("@LANG@") && lang!=langCode
&& !loadTimer->isActive() )
@@ -926,7 +926,7 @@ void PoCompendium::setLanguageCode(const QString& lang)
langCode=lang;
}
-QString PoCompendium::translate(const QString& text, uint pluralForm)
+TQString PoCompendium::translate(const TQString& text, uint pluralForm)
{
if(!initialized)
{
@@ -938,7 +938,7 @@ QString PoCompendium::translate(const QString& text, uint pluralForm)
if(error || !data || data->active())
{
- return QString::null;
+ return TQString::null;
}
@@ -950,10 +950,10 @@ QString PoCompendium::translate(const QString& text, uint pluralForm)
return data->catalog()->msgstr(*index).first();
}
- return QString::null;
+ return TQString::null;
}
-QString PoCompendium::fuzzyTranslation(const QString& text, int &score, const uint pluralForm)
+TQString PoCompendium::fuzzyTranslation(const TQString& text, int &score, const uint pluralForm)
{
if(!initialized)
{
@@ -965,7 +965,7 @@ QString PoCompendium::fuzzyTranslation(const QString& text, int &score, const ui
if(error || !data || data->active())
{
- return QString::null;
+ return TQString::null;
}
// try to find fuzzy string
@@ -976,7 +976,7 @@ QString PoCompendium::fuzzyTranslation(const QString& text, int &score, const ui
int best_match = 0;
int total = data->catalog()->numberOfEntries();
- QString searchStr = CompendiumData::simplify(text);
+ TQString searchStr = CompendiumData::simplify(text);
//kdDebug(750) << "find best match for " << searchStr << endl;
@@ -1004,7 +1004,7 @@ QString PoCompendium::fuzzyTranslation(const QString& text, int &score, const ui
}
// get a message from the catalog FIXME: plurals
- QString origStr = data->catalog()->msgid(i).first();
+ TQString origStr = data->catalog()->msgid(i).first();
origStr = CompendiumData::simplify(origStr);
// don't match too long strings for short search string
@@ -1029,11 +1029,11 @@ QString PoCompendium::fuzzyTranslation(const QString& text, int &score, const ui
return data->catalog()->msgstr(best_matching).first();
}
- return QString::null;
+ return TQString::null;
}
-QString PoCompendium::searchTranslation(const QString& text, int &sc, const uint pluralForm)
+TQString PoCompendium::searchTranslation(const TQString& text, int &sc, const uint pluralForm)
{
if(autoUpdate && prefWidget && prefWidget->settingsChanged())
{
@@ -1041,7 +1041,7 @@ QString PoCompendium::searchTranslation(const QString& text, int &sc, const uint
}
if(isSearching())
- return QString::null;
+ return TQString::null;
clearResults();
stop = false;
@@ -1058,21 +1058,21 @@ QString PoCompendium::searchTranslation(const QString& text, int &sc, const uint
if(error || !data)
{
active = false;
- return QString::null;
+ return TQString::null;
}
if(data->active())
{
active = false;
- return QString::null;
+ return TQString::null;
}
emit started();
- QPtrList<SearchResult> res;
+ TQPtrList<SearchResult> res;
- QValueList<int> foundIndices;
- QValueList<int> checkedIndices;
+ TQValueList<int> foundIndices;
+ TQValueList<int> checkedIndices;
// first, exact search
if( searchExact(text, pluralForm, res, foundIndices, checkedIndices) )
@@ -1086,7 +1086,7 @@ QString PoCompendium::searchTranslation(const QString& text, int &sc, const uint
return res.first()->translation;
}
- QString searchStr=CompendiumData::simplify(text);
+ TQString searchStr=CompendiumData::simplify(text);
if(!caseSensitive)
@@ -1107,7 +1107,7 @@ QString PoCompendium::searchTranslation(const QString& text, int &sc, const uint
}
// search without whitespace
- QString s = searchStr;
+ TQString s = searchStr;
s.remove( ' ' );
if( searchTextOnly(s, pluralForm, res, foundIndices, checkedIndices) )
{
@@ -1145,7 +1145,7 @@ QString PoCompendium::searchTranslation(const QString& text, int &sc, const uint
sc = 0;
- return QString::null;
+ return TQString::null;
}
@@ -1153,14 +1153,14 @@ void PoCompendium::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))
@@ -1171,7 +1171,7 @@ void PoCompendium::unregisterData()
}
else
{
- connect(data,SIGNAL(progressEnds()),this,SLOT(removeData()));
+ connect(data,TQT_SIGNAL(progressEnds()),this,TQT_SLOT(removeData()));
}
}
@@ -1195,22 +1195,22 @@ void PoCompendium::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 PoCompendium::removeData()
{
- const QObject *s=sender();
+ const TQObject *s=sender();
if(s && s->inherits("CompendiumData"))
{
const CompendiumData *d=static_cast<const CompendiumData*>(s);
if(d)
{
- QDictIterator<CompendiumData> it(*compendiumDict());
+ TQDictIterator<CompendiumData> it(*compendiumDict());
while(it.current())
{
if(it.current() == d)
@@ -1230,11 +1230,11 @@ void PoCompendium::removeData()
}
}
-QDict<CompendiumData> *PoCompendium::compendiumDict()
+TQDict<CompendiumData> *PoCompendium::compendiumDict()
{
if(!_compDict)
{
- _compDict=compDataDeleter.setObject( new QDict<CompendiumData> );
+ _compDict=compDataDeleter.setObject( new TQDict<CompendiumData> );
_compDict->setAutoDelete(true);
}
diff --git a/kbabel/kbabeldict/modules/pocompendium/pocompendium.h b/kbabel/kbabeldict/modules/pocompendium/pocompendium.h
index 6d92fb58..d96774e9 100644
--- a/kbabel/kbabeldict/modules/pocompendium/pocompendium.h
+++ b/kbabel/kbabeldict/modules/pocompendium/pocompendium.h
@@ -39,10 +39,10 @@
#include "compendiumdata.h"
#include "searchengine.h"
-#include <qdict.h>
-#include <qfile.h>
-#include <qguardedptr.h>
-#include <qptrlist.h>
+#include <tqdict.h>
+#include <tqfile.h>
+#include <tqguardedptr.h>
+#include <tqptrlist.h>
class CompendiumPreferencesWidget;
class KConfigBase;
@@ -53,35 +53,35 @@ class PoCompendium : public SearchEngine
Q_OBJECT
public:
- PoCompendium(QObject *parent=0, const char *name=0);
+ PoCompendium(TQObject *parent=0, const char *name=0);
virtual ~PoCompendium();
virtual bool isReady() const;
- virtual QString translate(const QString&text, uint pluralForm);
- virtual QString searchTranslation(const QString&, int &score, const uint pluralForm);
- virtual QString fuzzyTranslation(const QString&, int &score, const uint pluralForm);
+ virtual TQString translate(const TQString&text, uint pluralForm);
+ virtual TQString searchTranslation(const TQString&, int &score, const uint pluralForm);
+ virtual TQString fuzzyTranslation(const TQString&, int &score, const 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& s, uint pluralForm = 0, const SearchFilter* filter = 0);
+ virtual bool startSearch(const TQString& s, uint pluralForm = 0, const SearchFilter* filter = 0);
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 */
@@ -97,27 +97,27 @@ protected slots:
protected:
void loadCompendium();
- void addResult(SearchResult *, QPtrList<SearchResult>& allResults);
- QString maskString(QString string);
+ void addResult(SearchResult *, TQPtrList<SearchResult>& allResults);
+ TQString maskString(TQString string);
void registerData();
void unregisterData();
- bool searchExact(const QString& searchString, uint pluralForm, QPtrList<SearchResult>& results, QValueList<int>& foundIndices, QValueList<int>& checkedIndices );
- bool searchTextOnly(const QString& searchString, uint pluralForm, QPtrList<SearchResult>& results, QValueList<int>& foundIndices, QValueList<int>& checkedIndices );
- bool searchCaseInsensitive(const QString& searchString, uint pluralForm, QPtrList<SearchResult>& results, QValueList<int>& foundIndices, QValueList<int>& checkedIndices );
- bool searchWords(const QString& searchString, uint pluralForm, QPtrList<SearchResult>& results, QValueList<int>& foundIndices, QValueList<int>& checkedIndices );
- bool searchNGram(const QString& searchString, uint pluralForm, QPtrList<SearchResult>& results, QValueList<int>& foundIndices, QValueList<int>& checkedIndices );
+ bool searchExact(const TQString& searchString, uint pluralForm, TQPtrList<SearchResult>& results, TQValueList<int>& foundIndices, TQValueList<int>& checkedIndices );
+ bool searchTextOnly(const TQString& searchString, uint pluralForm, TQPtrList<SearchResult>& results, TQValueList<int>& foundIndices, TQValueList<int>& checkedIndices );
+ bool searchCaseInsensitive(const TQString& searchString, uint pluralForm, TQPtrList<SearchResult>& results, TQValueList<int>& foundIndices, TQValueList<int>& checkedIndices );
+ bool searchWords(const TQString& searchString, uint pluralForm, TQPtrList<SearchResult>& results, TQValueList<int>& foundIndices, TQValueList<int>& checkedIndices );
+ bool searchNGram(const TQString& searchString, uint pluralForm, TQPtrList<SearchResult>& results, TQValueList<int>& foundIndices, TQValueList<int>& checkedIndices );
private:
- QGuardedPtr<CompendiumPreferencesWidget> prefWidget;
+ TQGuardedPtr<CompendiumPreferencesWidget> prefWidget;
CompendiumData *data;
KBabel::PoInfo catalogInfo;
- QTimer *loadTimer;
+ TQTimer *loadTimer;
- QString url;
- QString realURL;
- QString langCode;
+ TQString url;
+ TQString realURL;
+ TQString langCode;
bool caseSensitive;
bool ignoreFuzzy;
@@ -133,15 +133,15 @@ private:
uint freeMemDelay;
bool error;
- QString errorMsg;
+ TQString errorMsg;
bool stop;
bool active;
bool initialized;
bool loading;
- static QDict<CompendiumData> *_compDict;
- static QDict<CompendiumData> *compendiumDict();
+ static TQDict<CompendiumData> *_compDict;
+ static TQDict<CompendiumData> *compendiumDict();
};
#endif
diff --git a/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.cpp b/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.cpp
index c3ce730d..1f3a8b37 100644
--- a/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.cpp
+++ b/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.cpp
@@ -30,13 +30,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>
@@ -44,72 +44,72 @@
#include "preferenceswidget.h"
#include "pwidget.h"
-CompendiumPreferencesWidget::CompendiumPreferencesWidget(QWidget *parent, const char* name)
+CompendiumPreferencesWidget::CompendiumPreferencesWidget(TQWidget *parent, const char* name)
: PrefWidget(parent,name)
, changed(false)
{
- QVBoxLayout *layout = new QVBoxLayout(this);
+ TQVBoxLayout *layout = new TQVBoxLayout(this);
prefWidget = new CompendiumPWidget(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->fuzzyBtn, 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->fuzzyBtn, 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, or if "
"you want fuzzy messages to be ignored.</p></qt>" );
- QWhatsThis::add(prefWidget->caseBtn,whatsthis);
- QWhatsThis::add(prefWidget->fuzzyBtn,whatsthis);
- QWhatsThis::add(prefWidget->wholeBtn,whatsthis);
+ TQWhatsThis::add(prefWidget->caseBtn,whatsthis);
+ TQWhatsThis::add(prefWidget->fuzzyBtn,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);
}
CompendiumPreferencesWidget::~CompendiumPreferencesWidget()
@@ -143,7 +143,7 @@ void CompendiumPreferencesWidget::standard()
changed=true;
}
-void CompendiumPreferencesWidget::setURL(const QString url)
+void CompendiumPreferencesWidget::setURL(const TQString url)
{
prefWidget->urlInput->setURL(url);
changed=false;
@@ -200,7 +200,7 @@ void CompendiumPreferencesWidget::setMatchWords(bool on)
-QString CompendiumPreferencesWidget::url()
+TQString CompendiumPreferencesWidget::url()
{
changed=false;
return prefWidget->urlInput->url();
diff --git a/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.h b/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.h
index db70df4d..3a22bc31 100644
--- a/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.h
+++ b/kbabel/kbabeldict/modules/pocompendium/preferenceswidget.h
@@ -44,14 +44,14 @@ class CompendiumPreferencesWidget : public PrefWidget
Q_OBJECT
public:
- CompendiumPreferencesWidget(QWidget *parent=0, const char* name=0);
+ CompendiumPreferencesWidget(TQWidget *parent=0, const char* name=0);
virtual ~CompendiumPreferencesWidget();
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);
@@ -61,7 +61,7 @@ public:
void setWholeWords(bool);
void setCaseSensitive(bool);
- QString url();
+ TQString url();
bool matchEqual();
bool matchNGram();
bool matchIsContained();