diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
commit | 4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch) | |
tree | b0a7cd1c184f0003c0292eb416ed27f674f9cc43 /kbabel/kbabeldict/modules/dbsearchengine | |
parent | 1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff) | |
download | tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.tar.gz tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbabel/kbabeldict/modules/dbsearchengine')
10 files changed, 345 insertions, 345 deletions
diff --git a/kbabel/kbabeldict/modules/dbsearchengine/KDBSearchEngine.cpp b/kbabel/kbabeldict/modules/dbsearchengine/KDBSearchEngine.cpp index ac55335d..5c5c6a6d 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine/KDBSearchEngine.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine/KDBSearchEngine.cpp @@ -28,10 +28,10 @@ * your version. * */ -#include <qtextedit.h> -#include <qprogressdialog.h> +#include <tqtextedit.h> +#include <tqprogressdialog.h> -#include <qinputdialog.h> +#include <tqinputdialog.h> #include <kdeversion.h> #include <klocale.h> #include <kdebug.h> @@ -52,17 +52,17 @@ #include <sys/time.h> #include "preferenceswidget.h" #include "dbse_factory.h" -#include <qprogressbar.h> -#include <qpushbutton.h> +#include <tqprogressbar.h> +#include <tqpushbutton.h> #include <klineedit.h> #include <kconfig.h> -#include <qdir.h> -#include <qradiobutton.h> -#include <qcheckbox.h> -#include <qspinbox.h> -#include <qslider.h> -#include <qmemarray.h> +#include <tqdir.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> +#include <tqspinbox.h> +#include <tqslider.h> +#include <tqmemarray.h> #include "database.h" @@ -72,7 +72,7 @@ using namespace KBabel; -KDBSearchEngine::KDBSearchEngine (QObject * parent, const char *name): +KDBSearchEngine::KDBSearchEngine (TQObject * parent, const char *name): SearchEngine (parent, name) { edited = "unknown"; @@ -82,8 +82,8 @@ SearchEngine (parent, name) dbOpened = false; dbname = ""; lasterror = i18n ("No error"); - connect (this, SIGNAL (hasError (const QString &)), - SLOT (setLastError (const QString &))); + connect (this, TQT_SIGNAL (hasError (const TQString &)), + TQT_SLOT (setLastError (const TQString &))); IAmReady = true; // I don't know if it is a good idea, no DB loaded!!! @@ -104,7 +104,7 @@ KDBSearchEngine::~KDBSearchEngine () bool -KDBSearchEngine::loadDatabase (QString database, bool noask = false) +KDBSearchEngine::loadDatabase (TQString database, bool noask = false) { bool ret = true; bool asked = false; @@ -116,7 +116,7 @@ KDBSearchEngine::loadDatabase (QString database, bool noask = false) dm = 0; } - QDir dir (database); + TQDir dir (database); if (!dir.exists ()) { if (asked @@ -124,19 +124,19 @@ KDBSearchEngine::loadDatabase (QString database, bool noask = false) i18n ("Database folder does not exist:\n%1\n" "Do you want to create it now?"). - arg (database), QString::null, i18n("Create Folder"), i18n("Do Not Create")) == + arg (database), TQString::null, i18n("Create Folder"), i18n("Do Not Create")) == KMessageBox::Yes) { asked = true; - QStringList dirList; + TQStringList dirList; while (!dir.exists () && !dir.dirName ().isEmpty ()) { dirList.prepend (dir.dirName ()); dir.setPath (dir.path () + "/.."); } - for (QStringList::Iterator it = dirList.begin (); + for (TQStringList::Iterator it = dirList.begin (); it != dirList.end (); ++it) { if (!dir.mkdir (*it)) @@ -161,10 +161,10 @@ KDBSearchEngine::loadDatabase (QString database, bool noask = false) if (ret) { // test, if there are both of ,old and standard databases - QString transFile = database + "/translations." + lang + ".db"; + TQString transFile = database + "/translations." + lang + ".db"; - bool oldstuff = QFile::exists (transFile + ",old"); - bool newstuff = QFile::exists (transFile); + bool oldstuff = TQFile::exists (transFile + ",old"); + bool newstuff = TQFile::exists (transFile); if (oldstuff && newstuff) { @@ -188,11 +188,11 @@ KDBSearchEngine::loadDatabase (QString database, bool noask = false) KMessageBox::Yes) { // remove the new files - QFile::remove (transFile); - QFile::remove (database + "/wordsindex." + lang + + TQFile::remove (transFile); + TQFile::remove (database + "/wordsindex." + lang + ".db"); - QFile::remove (database + "/keysindex." + lang + ".db"); - QFile::remove (database + "/catalogsinfo." + lang + + TQFile::remove (database + "/keysindex." + lang + ".db"); + TQFile::remove (database + "/catalogsinfo." + lang + ".db"); // rename the old files @@ -216,12 +216,12 @@ KDBSearchEngine::loadDatabase (QString database, bool noask = false) KURL (database + "/catalogsinfo." + lang + ".db"), 0); - QFile::remove (transFile + ",old"); - QFile::remove (database + "/wordsindex." + lang + + TQFile::remove (transFile + ",old"); + TQFile::remove (database + "/wordsindex." + lang + ".db,old"); - QFile::remove (database + "/keysindex." + lang + + TQFile::remove (database + "/keysindex." + lang + ".db,old"); - QFile::remove (database + "/catalogsinfo." + lang + + TQFile::remove (database + "/catalogsinfo." + lang + ".db,old"); } } @@ -241,10 +241,10 @@ KDBSearchEngine::loadDatabase (QString database, bool noask = false) (database + "/catalogsinfo." + lang + ".db,old"), KURL (database + "/catalogsinfo." + lang + ".db"), 0); - QFile::remove (transFile + ",old"); - QFile::remove (database + "/wordsindex." + lang + ".db,old"); - QFile::remove (database + "/keysindex." + lang + ".db,old"); - QFile::remove (database + "/catalogsinfo." + lang + + TQFile::remove (transFile + ",old"); + TQFile::remove (database + "/wordsindex." + lang + ".db,old"); + TQFile::remove (database + "/keysindex." + lang + ".db,old"); + TQFile::remove (database + "/catalogsinfo." + lang + ".db,old"); } @@ -255,7 +255,7 @@ KDBSearchEngine::loadDatabase (QString database, bool noask = false) if (asked || KMessageBox::questionYesNo (0, i18n - ("Database files not found.\nDo you want to create them now?"), QString::null, i18n("Create"), i18n("Do Not Create")) + ("Database files not found.\nDo you want to create them now?"), TQString::null, i18n("Create"), i18n("Do Not Create")) == KMessageBox::Yes) { //fprintf(stderr,"SI\n"); @@ -312,7 +312,7 @@ KDBSearchEngine::setCaseSensitive (bool sensitive) */ void -KDBSearchEngine::setRemoveCharString (QString chartoremove) +KDBSearchEngine::setRemoveCharString (TQString chartoremove) { remchar = chartoremove; } @@ -336,12 +336,12 @@ KDBSearchEngine::isSearching () const */ int -KDBSearchEngine::addSearchString (QString searchString, int rule) +KDBSearchEngine::addSearchString (TQString searchString, int rule) { if (searching || scanInProgress) return -1; SearchEntry e; - e.string = QString (searchString); + e.string = TQString (searchString); e.rules = rule; searchStringList.append (e); return searchStringList.count (); @@ -354,7 +354,7 @@ KDBSearchEngine::addSearchString (QString searchString, int rule) */ bool -KDBSearchEngine::startSearch (const QString & str, uint pluralForm, +KDBSearchEngine::startSearch (const TQString & str, uint pluralForm, const SearchFilter * filter) { @@ -376,7 +376,7 @@ KDBSearchEngine::startSearch (const QString & str, uint pluralForm, } bool -KDBSearchEngine::startSearchInTranslation (QString s) +KDBSearchEngine::startSearchInTranslation (TQString s) { if (autoUpdate) @@ -418,8 +418,8 @@ KDBSearchEngine::openDb (bool noask = false) bool KDBSearchEngine::messagesForFilter (const SearchFilter * filter, - QValueList < SearchResult > &resultList, - QString & error) + TQValueList < SearchResult > &resultList, + TQString & error) { int count = 0; @@ -452,7 +452,7 @@ KDBSearchEngine::messagesForFilter (const SearchFilter * filter, return false; } - QString package = filter->location (); + TQString package = filter->location (); int step = (totalRecord / 30) + 1; int ntra, nref; @@ -544,17 +544,17 @@ KDBSearchEngine::repeat () kdDebug (0) << "No kdelibs.po found!" << endl; - QProgressDialog *pd = - new QProgressDialog (i18n ("Looking for repetitions"), i18n ("Stop"), + TQProgressDialog *pd = + new TQProgressDialog (i18n ("Looking for repetitions"), i18n ("Stop"), 100); - connect (this, SIGNAL (progress (int)), pd, SLOT (setProgress (int))); - connect (this, SIGNAL (finished ()), pd, SLOT (close ())); - connect (pd, SIGNAL (cancelled ()), this, SLOT (stopSearch ())); + connect (this, TQT_SIGNAL (progress (int)), pd, TQT_SLOT (setProgress (int))); + connect (this, TQT_SIGNAL (finished ()), pd, TQT_SLOT (close ())); + connect (pd, TQT_SIGNAL (cancelled ()), this, TQT_SLOT (stopSearch ())); - QString txt = "// %1 repetitions, %2 translation(s)\ni18n(\"%3\");\n"; - QString id; + TQString txt = "// %1 repetitions, %2 translation(s)\ni18n(\"%3\");\n"; + TQString id; int min; bool ok = false; @@ -571,7 +571,7 @@ KDBSearchEngine::repeat () progressStarts (i18n ("Searching repeated string")); - static QTextEdit *mle = new QTextEdit (); + static TQTextEdit *mle = new TQTextEdit (); mle->clear (); bool inlibs; @@ -671,10 +671,10 @@ KDBSearchEngine::startSearchNow (int searchmode) intra = searchmode & MD_IN_TRANSLATION; - QString msgIdFound; - QString msgId; - QString msgStr; - //QString msgIdRequested; + TQString msgIdFound; + TQString msgId; + TQString msgStr; + //TQString msgIdRequested; SearchResult *aresult; TranslationInfo *adescription; SearchList searchList; @@ -682,13 +682,13 @@ KDBSearchEngine::startSearchNow (int searchmode) len = remchar.length (); int n, m; //,word; - QString *id; + TQString *id; - QString mainRequest = searchStringList[0].string; + TQString mainRequest = searchStringList[0].string; SearchList::Iterator it, it1; - QString *idMod; + TQString *idMod; bool foundSomething = false; searchList = searchStringList; //Create a copy and modify it @@ -705,7 +705,7 @@ KDBSearchEngine::startSearchNow (int searchmode) } if (comm) - idMod->replace (QRegExp ("\\_\\:.*\\\\n"), ""); //Read it from catalog !!! (NOT ONLY HERE) + idMod->replace (TQRegExp ("\\_\\:.*\\\\n"), ""); //Read it from catalog !!! (NOT ONLY HERE) if (norm) @@ -728,7 +728,7 @@ KDBSearchEngine::startSearchNow (int searchmode) //Now we can browse the whole db or the "good keys" - QValueList < KeyAndScore > goodkeys; + TQValueList < KeyAndScore > goodkeys; int totalprogress; bool gk = (searchmode == MD_GOOD_KEYS) || allkey; @@ -807,7 +807,7 @@ KDBSearchEngine::startSearchNow (int searchmode) //Remove context information from id found if (comm) - msgId.replace (QRegExp ("\\_\\:.*\\\\n"), ""); + msgId.replace (TQRegExp ("\\_\\:.*\\\\n"), ""); if (norm) @@ -845,7 +845,7 @@ KDBSearchEngine::startSearchNow (int searchmode) //Remove context information from id found if (comm) msgId. - replace (QRegExp ("\\_\\:.*\\\\n"), + replace (TQRegExp ("\\_\\:.*\\\\n"), ""); @@ -878,7 +878,7 @@ KDBSearchEngine::startSearchNow (int searchmode) if (!foundExact && (rules & RegExp)) { - QRegExp reg (*idMod); + TQRegExp reg (*idMod); regexp = (reg.search (msgId) != -1); } else @@ -996,7 +996,7 @@ KDBSearchEngine::startSearchNow (int searchmode) */ bool -KDBSearchEngine::startSingleSearch (QString searchString, +KDBSearchEngine::startSingleSearch (TQString searchString, unsigned int pattern1Limit, unsigned int /*pattern2Limit */ , bool inTranslation) @@ -1013,7 +1013,7 @@ KDBSearchEngine::startSingleSearch (QString searchString, - QRegExp reg ("[a-zA-Z0-9_%" /*+remchar */ + regaddchar + "]+"); + TQRegExp reg ("[a-zA-Z0-9_%" /*+remchar */ + regaddchar + "]+"); while ((in = reg.search (searchString, in + len)) != -1) { nw++; @@ -1033,7 +1033,7 @@ KDBSearchEngine::startSingleSearch (QString searchString, { in = reg.search (searchString, in + len); len = reg.matchedLength (); - QString regToAdd = searchString; + TQString regToAdd = searchString; regToAdd.replace (in, len, "[a-zA-Z0-9_%" + regaddchar + "]*"); regToAdd.append ("$"); regToAdd.prepend ("^"); @@ -1055,7 +1055,7 @@ KDBSearchEngine::startSingleSearch (QString searchString, Start a search for a list of string */ -//bool KDBSearchEngine::startListSearch(QPtrList<QString> searchStrList) +//bool KDBSearchEngine::startListSearch(TQPtrList<TQString> searchStrList) //{ // searchStringList=searchStrList; // return startSearchNow(); @@ -1067,7 +1067,7 @@ KDBSearchEngine::startSingleSearch (QString searchString, void -KDBSearchEngine::setLanguageCode (const QString & ll) +KDBSearchEngine::setLanguageCode (const TQString & ll) { if (ll == lang) return; @@ -1079,8 +1079,8 @@ KDBSearchEngine::setLanguageCode (const QString & ll) } void -KDBSearchEngine::setLanguage (const QString & languageCode, - const QString & /*languageName */ ) +KDBSearchEngine::setLanguage (const TQString & languageCode, + const TQString & /*languageName */ ) { setLanguageCode (languageCode); } @@ -1147,17 +1147,17 @@ KDBSearchEngine::saveSettings (KConfigBase * config) void KDBSearchEngine::readSettings (KConfigBase * config) { - QString newName; + TQString newName; KConfigGroupSaver cgs (config, "KDBSearchEngine"); - QString defaultLang; - QString oldLang = lang; + TQString defaultLang; + TQString oldLang = lang; Defaults::Identity def; defaultLang = def.languageCode (); lang = config->readEntry ("Language", defaultLang); - QString defaultDir; + TQString defaultDir; KStandardDirs *dirs = KGlobal::dirs (); if (dirs) { @@ -1203,20 +1203,20 @@ KDBSearchEngine::readSettings (KConfigBase * config) } PrefWidget * -KDBSearchEngine::preferencesWidget (QWidget * parent) +KDBSearchEngine::preferencesWidget (TQWidget * parent) { pw = new PreferencesWidget (parent); setSettings (); - connect (pw, SIGNAL (restoreNow ()), this, SLOT (setSettings ())); - connect (pw, SIGNAL (applyNow ()), this, SLOT (updateSettings ())); - connect (pw, SIGNAL (destroyed ()), this, SLOT (prefDestr ())); - connect (pw->dbpw->scanPB_2, SIGNAL (clicked ()), this, SLOT (scan ())); - connect (pw->dbpw->scanrecPB, SIGNAL (clicked ()), this, - SLOT (scanRecur ())); - connect (pw->dbpw->scanFilePB, SIGNAL (clicked ()), this, - SLOT (scanFile ())); - connect (pw->dbpw->repeatPB, SIGNAL (clicked ()), this, SLOT (repeat ())); + connect (pw, TQT_SIGNAL (restoreNow ()), this, TQT_SLOT (setSettings ())); + connect (pw, TQT_SIGNAL (applyNow ()), this, TQT_SLOT (updateSettings ())); + connect (pw, TQT_SIGNAL (destroyed ()), this, TQT_SLOT (prefDestr ())); + connect (pw->dbpw->scanPB_2, TQT_SIGNAL (clicked ()), this, TQT_SLOT (scan ())); + connect (pw->dbpw->scanrecPB, TQT_SIGNAL (clicked ()), this, + TQT_SLOT (scanRecur ())); + connect (pw->dbpw->scanFilePB, TQT_SIGNAL (clicked ()), this, + TQT_SLOT (scanFile ())); + connect (pw->dbpw->repeatPB, TQT_SIGNAL (clicked ()), this, TQT_SLOT (repeat ())); return pw; @@ -1233,7 +1233,7 @@ KDBSearchEngine::scanRecur () return; scanInProgress = true; PoScanner *sca = new PoScanner (dm, this, "Po Scanner"); - QString cvsdir; + TQString cvsdir; cvsdir = KFileDialog::getExistingDirectory ("", 0, i18n @@ -1246,32 +1246,32 @@ KDBSearchEngine::scanRecur () } if (pw) { - connect (sca, SIGNAL (patternProgress (int)), pw->dbpw->totalPB, - SLOT (setProgress (int))); - connect (sca, SIGNAL (fileLoading (int)), pw->dbpw->loadingPB, - SLOT (setProgress (int))); - connect (sca, SIGNAL (fileProgress (int)), pw->dbpw->processPB, - SLOT (setProgress (int))); + connect (sca, TQT_SIGNAL (patternProgress (int)), pw->dbpw->totalPB, + TQT_SLOT (setProgress (int))); + connect (sca, TQT_SIGNAL (fileLoading (int)), pw->dbpw->loadingPB, + TQT_SLOT (setProgress (int))); + connect (sca, TQT_SIGNAL (fileProgress (int)), pw->dbpw->processPB, + TQT_SLOT (setProgress (int))); } - connect (sca, SIGNAL (patternProgress (int)), SIGNAL (progress (int))); //Kbabel progress bar + connect (sca, TQT_SIGNAL (patternProgress (int)), TQT_SIGNAL (progress (int))); //Kbabel progress bar - connect (sca, SIGNAL (added (int)), pw, SLOT (setEntries (int))); - connect (sca, SIGNAL (filename (QString)), pw, SLOT (setName (QString))); + connect (sca, TQT_SIGNAL (added (int)), pw, TQT_SLOT (setEntries (int))); + connect (sca, TQT_SIGNAL (filename (TQString)), pw, TQT_SLOT (setName (TQString))); progressStarts (i18n ("Scanning folder %1").arg (cvsdir)); - connect (sca, SIGNAL (patternFinished ()), SIGNAL (progressEnds ())); + connect (sca, TQT_SIGNAL (patternFinished ()), TQT_SIGNAL (progressEnds ())); sca->scanPattern (cvsdir, "*.po", true); - disconnect (this, SIGNAL (progress (int))); -//disconnect(SIGNAL(patternStarted()),this,SIGNAL(started()) ); - disconnect (this, SIGNAL (progressEnds ())); + disconnect (this, TQT_SIGNAL (progress (int))); +//disconnect(TQT_SIGNAL(patternStarted()),this,TQT_SIGNAL(started()) ); + disconnect (this, TQT_SIGNAL (progressEnds ())); if (pw) { - disconnect (pw->dbpw->totalPB, SLOT (setProgress (int))); - disconnect (pw->dbpw->loadingPB, SLOT (setProgress (int))); - disconnect (pw->dbpw->processPB, SLOT (setProgress (int))); + disconnect (pw->dbpw->totalPB, TQT_SLOT (setProgress (int))); + disconnect (pw->dbpw->loadingPB, TQT_SLOT (setProgress (int))); + disconnect (pw->dbpw->processPB, TQT_SLOT (setProgress (int))); } totalRecord = dm->count (); @@ -1292,7 +1292,7 @@ KDBSearchEngine::scan () return; scanInProgress = true; PoScanner *sca = new PoScanner (dm, this, "Po Scanner"); - QString cvsdir; + TQString cvsdir; cvsdir = KFileDialog::getExistingDirectory ("", 0, @@ -1304,32 +1304,32 @@ KDBSearchEngine::scan () } if (pw) { - connect (sca, SIGNAL (patternProgress (int)), pw->dbpw->totalPB, - SLOT (setProgress (int))); - connect (sca, SIGNAL (fileLoading (int)), pw->dbpw->loadingPB, - SLOT (setProgress (int))); - connect (sca, SIGNAL (fileProgress (int)), pw->dbpw->processPB, - SLOT (setProgress (int))); + connect (sca, TQT_SIGNAL (patternProgress (int)), pw->dbpw->totalPB, + TQT_SLOT (setProgress (int))); + connect (sca, TQT_SIGNAL (fileLoading (int)), pw->dbpw->loadingPB, + TQT_SLOT (setProgress (int))); + connect (sca, TQT_SIGNAL (fileProgress (int)), pw->dbpw->processPB, + TQT_SLOT (setProgress (int))); } - connect (sca, SIGNAL (patternProgress (int)), SIGNAL (progress (int))); + connect (sca, TQT_SIGNAL (patternProgress (int)), TQT_SIGNAL (progress (int))); progressStarts (i18n ("Scanning folder %1").arg (cvsdir)); - connect (sca, SIGNAL (patternFinished ()), SIGNAL (progressEnds ())); + connect (sca, TQT_SIGNAL (patternFinished ()), TQT_SIGNAL (progressEnds ())); - connect (sca, SIGNAL (added (int)), pw, SLOT (setEntries (int))); - connect (sca, SIGNAL (filename (QString)), pw, SLOT (setName (QString))); + connect (sca, TQT_SIGNAL (added (int)), pw, TQT_SLOT (setEntries (int))); + connect (sca, TQT_SIGNAL (filename (TQString)), pw, TQT_SLOT (setName (TQString))); sca->scanPattern (cvsdir, "*.po", false); - disconnect (this, SIGNAL (progress (int))); -//disconnect(SIGNAL(patternStarted()),this,SIGNAL(started()) ); - disconnect (this, SIGNAL (progressEnds ())); + disconnect (this, TQT_SIGNAL (progress (int))); +//disconnect(TQT_SIGNAL(patternStarted()),this,TQT_SIGNAL(started()) ); + disconnect (this, TQT_SIGNAL (progressEnds ())); if (pw) { - disconnect (pw->dbpw->totalPB, SLOT (setProgress (int))); - disconnect (pw->dbpw->loadingPB, SLOT (setProgress (int))); - disconnect (pw->dbpw->processPB, SLOT (setProgress (int))); + disconnect (pw->dbpw->totalPB, TQT_SLOT (setProgress (int))); + disconnect (pw->dbpw->loadingPB, TQT_SLOT (setProgress (int))); + disconnect (pw->dbpw->processPB, TQT_SLOT (setProgress (int))); } totalRecord = dm->count (); @@ -1350,7 +1350,7 @@ KDBSearchEngine::scanFile () return; scanInProgress = true; PoScanner *sca = new PoScanner (dm, this, "Po Scanner"); - QString cvsdir; + TQString cvsdir; pw->dbpw->totalPB->setProgress (0); cvsdir = @@ -1363,31 +1363,31 @@ KDBSearchEngine::scanFile () } if (pw) { - connect (sca, SIGNAL (fileLoading (int)), pw->dbpw->loadingPB, - SLOT (setProgress (int))); - connect (sca, SIGNAL (fileProgress (int)), pw->dbpw->processPB, - SLOT (setProgress (int))); + connect (sca, TQT_SIGNAL (fileLoading (int)), pw->dbpw->loadingPB, + TQT_SLOT (setProgress (int))); + connect (sca, TQT_SIGNAL (fileProgress (int)), pw->dbpw->processPB, + TQT_SLOT (setProgress (int))); } - connect (sca, SIGNAL (fileProgress (int)), SIGNAL (progress (int))); + connect (sca, TQT_SIGNAL (fileProgress (int)), TQT_SIGNAL (progress (int))); progressStarts (i18n ("Scanning file %1").arg (directory (cvsdir, 0))); - connect (sca, SIGNAL (fileFinished ()), SIGNAL (progressEnds ())); + connect (sca, TQT_SIGNAL (fileFinished ()), TQT_SIGNAL (progressEnds ())); - connect (sca, SIGNAL (added (int)), pw, SLOT (setEntries (int))); - connect (sca, SIGNAL (filename (QString)), pw, SLOT (setName (QString))); + connect (sca, TQT_SIGNAL (added (int)), pw, TQT_SLOT (setEntries (int))); + connect (sca, TQT_SIGNAL (filename (TQString)), pw, TQT_SLOT (setName (TQString))); sca->scanFile (cvsdir); - sca->disconnect (SIGNAL (fileProgress (int)), this, - SIGNAL (progress (int))); -//disconnect(SIGNAL(patternStarted()),this,SIGNAL(started()) ); - sca->disconnect (SIGNAL (fileFinished ()), this, - SIGNAL (progressEnds ())); + sca->disconnect (TQT_SIGNAL (fileProgress (int)), this, + TQT_SIGNAL (progress (int))); +//disconnect(TQT_SIGNAL(patternStarted()),this,TQT_SIGNAL(started()) ); + sca->disconnect (TQT_SIGNAL (fileFinished ()), this, + TQT_SIGNAL (progressEnds ())); if (pw) { - disconnect (pw->dbpw->loadingPB, SLOT (setProgress (int))); - disconnect (pw->dbpw->processPB, SLOT (setProgress (int))); + disconnect (pw->dbpw->loadingPB, TQT_SLOT (setProgress (int))); + disconnect (pw->dbpw->processPB, TQT_SLOT (setProgress (int))); } totalRecord = dm->count (); @@ -1415,7 +1415,7 @@ KDBSearchEngine::name () const QString KDBSearchEngine::id () const { - return QString ("KDBSearchEngine"); + return TQString ("KDBSearchEngine"); } QString @@ -1488,7 +1488,7 @@ KDBSearchEngine::updateSettings () if (pw == 0) return; - QString newName = pw->dbpw->dirInput->url (); + TQString newName = pw->dbpw->dirInput->url (); if (newName != dbname) { @@ -1547,16 +1547,16 @@ KDBSearchEngine::updateSettings () } void -KDBSearchEngine::setLastError (const QString & er) +KDBSearchEngine::setLastError (const TQString & er) { lasterror = er; } QString -KDBSearchEngine::translate (const QString & text, const uint pluralForm) +KDBSearchEngine::translate (const TQString & text, const uint pluralForm) { if (!openDb ()) - return QString::null; + return TQString::null; /* if(!dbOpened) @@ -1566,7 +1566,7 @@ if(!dbOpened) { //emit anerror hasError(i18n("Database not opened")); - return QString::null; + return TQString::null; } } */ @@ -1574,7 +1574,7 @@ if(!dbOpened) DataBaseItem dbit = dm->getItem (text); if (dbit.isNull ()) - return QString::null; + return TQString::null; if (dbit.numTra == 1) return dbit.translations[0].translation; @@ -1592,34 +1592,34 @@ if(!dbOpened) } -QValueList < KeyAndScore > KDBSearchEngine::searchWords (QString phrase, +TQValueList < KeyAndScore > KDBSearchEngine::searchWords (TQString phrase, int threshold, int thresholdorig, uint32 max) { - QValueList < QString > wordlist; + TQValueList < TQString > wordlist; if (!openDb ()) { - QValueList < KeyAndScore > a; + TQValueList < KeyAndScore > a; return a; } progressStarts (i18n ("Searching words")); - QValueList < QString >::Iterator wlit; + TQValueList < TQString >::Iterator wlit; wordlist = dm->wordsIn (phrase); int nw = wordlist.count (); -//QMemArray<WordItem> wi(nw); - QMemArray < uint32 > numofloc (nw), currentloc (nw); - QMemArray < int > +//TQMemArray<WordItem> wi(nw); + TQMemArray < uint32 > numofloc (nw), currentloc (nw); + TQMemArray < int > score (nw); - QMemArray < uint32 * >loc (nw), locorig (nw); - QValueList < uint32 > resloc; - QValueList < int > + TQMemArray < uint32 * >loc (nw), locorig (nw); + TQValueList < uint32 > resloc; + TQValueList < int > resfound; - QValueList < KeyAndScore > keylist; + TQValueList < KeyAndScore > keylist; //wi.resize(wordlist.count()); int totalprogress = 0; @@ -1837,7 +1837,7 @@ QValueList < KeyAndScore > KDBSearchEngine::searchWords (QString phrase, KeyAndScore key (strkey, sc); -// kdDebug(0) << (QString) key << " [" << key.score << "]" << endl; +// kdDebug(0) << (TQString) key << " [" << key.score << "]" << endl; keylist.append (key); } @@ -1852,12 +1852,12 @@ QValueList < KeyAndScore > KDBSearchEngine::searchWords (QString phrase, } void -KDBSearchEngine::stringChanged (const QStringList & o, - const QString & translated, const uint, - const QString &) +KDBSearchEngine::stringChanged (const TQStringList & o, + const TQString & translated, const uint, + const TQString &) { - QString orig = o.first (); // FIXME: plural forms + TQString orig = o.first (); // FIXME: plural forms // skip empty originals or translated texts if (orig.isEmpty () || translated.isEmpty ()) @@ -1879,19 +1879,19 @@ KDBSearchEngine::stringChanged (const QStringList & o, } void -KDBSearchEngine::setEditedFile (const QString & file) +KDBSearchEngine::setEditedFile (const TQString & file) { edited = file; //kdDebug(0) << edited << endl; } -KeyAndScore::KeyAndScore (const QString & a, int sc): -QString (a) +KeyAndScore::KeyAndScore (const TQString & a, int sc): +TQString (a) { score = sc; } -KeyAndScore::KeyAndScore ():QString () +KeyAndScore::KeyAndScore ():TQString () { score = 0; } diff --git a/kbabel/kbabeldict/modules/dbsearchengine/KDBSearchEngine.h b/kbabel/kbabeldict/modules/dbsearchengine/KDBSearchEngine.h index 058444db..d948bbd4 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine/KDBSearchEngine.h +++ b/kbabel/kbabeldict/modules/dbsearchengine/KDBSearchEngine.h @@ -42,11 +42,11 @@ #ifndef _KDBSEARCH_ENGINE_ #define _KDBSEARCH_ENGINE_ -#include <qobject.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qmemarray.h> -#include <qvaluelist.h> +#include <tqobject.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqmemarray.h> +#include <tqvaluelist.h> #include "database.h" @@ -63,7 +63,7 @@ class SearchEntry { public: - QString string; + TQString string; int rules; }; @@ -71,22 +71,22 @@ class KeyAndScore : public QString { public: KeyAndScore(); - KeyAndScore(const QString &a,int sc); + KeyAndScore(const TQString &a,int sc); int score; }; -typedef QValueList<SearchEntry> SearchList; +typedef TQValueList<SearchEntry> SearchList; /* USE searchengine.h structure class CatalogDescription { public: char language[6]; // How many character chinese language needs? - // QString is better ? - QString filename; - QString dateOfScan; //When you add this to database (last time) - QString authorOfScan; - QString fileHeader; //msgid "" + // TQString is better ? + TQString filename; + TQString dateOfScan; //When you add this to database (last time) + TQString authorOfScan; + TQString fileHeader; //msgid "" }; */ @@ -98,7 +98,7 @@ class KDBSearchEngine : public SearchEngine public: - KDBSearchEngine(QObject *parent=0,const char *name=0); + KDBSearchEngine(TQObject *parent=0,const char *name=0); ~KDBSearchEngine(); enum Rules {Equal = 1, Contains = 2, Contained = 4, RegExp = 8}; enum FormatRules { Dots = 1, Ampersand = 2, FirstWordUpper = 4, //Not yet used @@ -108,7 +108,7 @@ public: Set the directory where db file are located */ - void setDBName(QString filename); + void setDBName(TQString filename); /* Set if the research have to consider multiple spaces as a single one. @@ -136,7 +136,7 @@ public: */ - void setRemoveCharString(QString chartoremove); + void setRemoveCharString(TQString chartoremove); /* Enable an output filter that format Uppercase/lowercase @@ -179,13 +179,13 @@ public: virtual bool messagesForFilter(const SearchFilter* filter - , QValueList<SearchResult>& resultList, QString& error); + , TQValueList<SearchResult>& resultList, TQString& error); - virtual void setLanguageCode(const QString& lang); - virtual void setLanguage(const QString& languageCode, const QString& languageName); + virtual void setLanguageCode(const TQString& lang); + virtual void setLanguage(const TQString& languageCode, const TQString& languageName); - virtual void setEditedFile(const QString& file); + virtual void setEditedFile(const TQString& file); virtual bool isReady() const ; virtual bool isSearching() const; @@ -193,20 +193,20 @@ public: 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(); - virtual QString translate(const QString& text, uint pluralForm); + virtual TQString translate(const TQString& text, uint pluralForm); - virtual void stringChanged( const QStringList& orig, const QString& translated - , const uint translationPluralForm, const QString& description); + virtual void stringChanged( const TQStringList& orig, const TQString& translated + , const uint translationPluralForm, const TQString& description); public slots: @@ -221,7 +221,7 @@ public slots: progress) */ - int addSearchString(QString searchString, int rule=Equal); + int addSearchString(TQString searchString, int rule=Equal); /* Start the research in the database of all the string in the list @@ -244,14 +244,14 @@ public slots: */ - bool startSingleSearch(QString searchString,unsigned int pattern1Limit,unsigned int pattern2Limit, + bool startSingleSearch(TQString searchString,unsigned int pattern1Limit,unsigned int pattern2Limit, bool inTranslation=false); /* Start a search for a list of string */ -// bool startListSearch(QPtrList<QString> searchStrList); +// bool startListSearch(TQPtrList<TQString> searchStrList); /* * Return a list of key in database that contains some @@ -263,7 +263,7 @@ public slots: * max is the maximum number of results */ -QValueList<KeyAndScore> searchWords(QString phrase,int threshold, +TQValueList<KeyAndScore> searchWords(TQString phrase,int threshold, int thresholdorig ,uint32 max); @@ -272,8 +272,8 @@ QValueList<KeyAndScore> searchWords(QString phrase,int threshold, */ virtual void stopSearch(); - virtual bool startSearch(const QString& text, uint pluralForm, const SearchFilter* filter); - virtual bool startSearchInTranslation(QString s); + virtual bool startSearch(const TQString& text, uint pluralForm, const SearchFilter* filter); + virtual bool startSearchInTranslation(TQString s); void clearList(); signals: @@ -282,13 +282,13 @@ private slots: void updateSettings(); //Use widget settings void setSettings(); //Fill widget with actual settings void prefDestr(); - void setLastError(const QString&); + void setLastError(const TQString&); void repeat(); private: /* Reload database info (and keep the dbase opened). */ - bool loadDatabase(QString database,bool); + bool loadDatabase(TQString database,bool); bool openDb(bool); @@ -312,22 +312,22 @@ private: bool norm,sens,comm; int numofresult; char * filename; - QString remchar; - QString regaddchar; - QString dbname; + TQString remchar; + TQString regaddchar; + TQString dbname; bool dbOpened; // GDBM_FILE db; DataBaseManager * dm; // datum key, value; -// QMemArray<CatalogDescription *> catinfo; +// TQMemArray<CatalogDescription *> catinfo; SearchList searchStringList; int totalRecord; - QString lasterror; - QString lang; + TQString lasterror; + TQString lang; bool scanInProgress; - QString edited; + TQString edited; bool autoup; - QString autoauthor; + TQString autoauthor; }; #endif diff --git a/kbabel/kbabeldict/modules/dbsearchengine/database.cpp b/kbabel/kbabeldict/modules/dbsearchengine/database.cpp index 003a3a95..0847d594 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine/database.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine/database.cpp @@ -36,12 +36,12 @@ #include "database.h" #include <unistd.h> -#include <qfile.h> +#include <tqfile.h> #include <ktempfile.h> #include <kio/netaccess.h> -WordItem::WordItem (char *data, QString w) +WordItem::WordItem (char *data, TQString w) { word = w; @@ -58,7 +58,7 @@ WordItem::WordItem (char *data, QString w) } -WordItem::WordItem (QString w) +WordItem::WordItem (TQString w) { locations = NULL; count = 0; @@ -100,7 +100,7 @@ InfoItem::InfoItem () language = "No language"; } -InfoItem::InfoItem (const char *rawData, QString lang) +InfoItem::InfoItem (const char *rawData, TQString lang) { const char *rd; rd = rawData; @@ -110,16 +110,16 @@ InfoItem::InfoItem (const char *rawData, QString lang) charset = "Utf8"; - catalogName = QString::fromUtf8 (rd); + catalogName = TQString::fromUtf8 (rd); len = strlen (rd) + 1; rd += len; - lastTranslator = QString::fromUtf8 (rd); + lastTranslator = TQString::fromUtf8 (rd); len = strlen (rd) + 1; rd += len; secs = *(unsigned int *) rd; revisionDate.setTime_t (secs); rd += 4; - lastFullPath = QString::fromUtf8 (rd); + lastFullPath = TQString::fromUtf8 (rd); len = strlen (rd) + 1; rd += len; @@ -139,8 +139,8 @@ InfoItem::rawData (char *rawData) rd += strlen (rd) + 1; - //QDate Time problem!!!!!!!!!!! - QDateTime zeroDate; + //TQDate Time problem!!!!!!!!!!! + TQDateTime zeroDate; zeroDate.setTime_t (0); *(unsigned int *) rd = -revisionDate.secsTo (zeroDate); rd += 4; @@ -168,7 +168,7 @@ InfoItem::size () // this is a quick hack to copy a local file int -copy_hack (QFile & input, QFile & output) +copy_hack (TQFile & input, TQFile & output) { if (!input.isOpen ()) { @@ -204,7 +204,7 @@ DataBaseItem::DataBaseItem (char *_key, char *_data) { char *data = _data; - key = QString::fromUtf8 (_key); + key = TQString::fromUtf8 (_key); unsigned int i, r; numTra = *(uint32 *) data; @@ -228,7 +228,7 @@ DataBaseItem::DataBaseItem (char *_key, char *_data) tr.infoRef.append (ref); } - tr.translation = QString::fromUtf8 ((const char *) data); + tr.translation = TQString::fromUtf8 ((const char *) data); translations.append (tr); data += strlen (data) + 1; @@ -293,11 +293,11 @@ DataBaseItem::toRawData (char *_data) } -DataBaseManager::DataBaseManager (QString directory, QString lang, - QObject * parent, const char *name): -QObject (parent, name) +DataBaseManager::DataBaseManager (TQString directory, TQString lang, + TQObject * parent, const char *name): +TQObject (parent, name) { - QString filename; + TQString filename; language = lang; iAmOk = true; @@ -312,22 +312,22 @@ void DataBaseManager::openDataBase () { kdDebug () << "Opendatabase" << endl; - QString directory; + TQString directory; directory = basedir; - QString ll = "." + language; + TQString ll = "." + language; if (ll == ".") ll = ".NOLANG"; - QString transfilename = "%1/translations%2.db"; + TQString transfilename = "%1/translations%2.db"; transfilename = transfilename.arg (directory).arg (ll); - QString infofilename = "%1/catalogsinfo%2.db"; + TQString infofilename = "%1/catalogsinfo%2.db"; infofilename = infofilename.arg (directory).arg (ll); - QString wordsfilename = "%1/wordsindex%2.db"; + TQString wordsfilename = "%1/wordsindex%2.db"; wordsfilename = wordsfilename.arg (directory).arg (ll); - QString keysfilename = "%1/keysindex%2.db"; + TQString keysfilename = "%1/keysindex%2.db"; keysfilename = keysfilename.arg (directory).arg (ll); cursor = 0; @@ -354,7 +354,7 @@ DataBaseManager::openDataBase () KTempFile transFile, infoFile, keysFile, wordsFile; // do the upgrade on the translation file - QFile transfilenameFile (transfilename); + TQFile transfilenameFile (transfilename); if ((ret = copy_hack (transfilenameFile, *transFile.file ())) == 0) { @@ -373,7 +373,7 @@ DataBaseManager::openDataBase () } // do the upgrade on the info file - QFile infofilenameFile (infofilename); + TQFile infofilenameFile (infofilename); if ((ret = copy_hack (infofilenameFile, *infoFile.file ())) == 0) { ret = @@ -394,7 +394,7 @@ DataBaseManager::openDataBase () } // do the upgrade on the words file - QFile wordfilenameFile (wordsfilename); + TQFile wordfilenameFile (wordsfilename); if ((ret = copy_hack (wordfilenameFile, *wordsFile.file ())) == 0) { ret = @@ -415,7 +415,7 @@ DataBaseManager::openDataBase () } // do the upgrade on the keys file - QFile keysfilenameFile (keysfilename); + TQFile keysfilenameFile (keysfilename); if ((ret = copy_hack (keysfilenameFile, *keysFile.file ())) == 0) { ret = @@ -620,11 +620,11 @@ DataBaseManager::putItem (DataBaseItem * item, bool ow) { uint32 location = loc; - QValueList < QString > wlist; + TQValueList < TQString > wlist; wlist = wordsIn (item->key); - QValueList < QString >::Iterator wlistit; + TQValueList < TQString >::Iterator wlistit; for (wlistit = wlist.begin (); wlistit != wlist.end (); ++wlistit) { @@ -641,7 +641,7 @@ DataBaseManager::putItem (DataBaseItem * item, bool ow) } DataBaseItem -DataBaseManager::getItem (QString key) +DataBaseManager::getItem (TQString key) { if (!iAmOk) return DataBaseItem (); @@ -702,7 +702,7 @@ DataBaseManager::cursorGet (uint32 flags) } else { - kdDebug (KBABEL_SEARCH) << QString ("...cursor getting...%1"). + kdDebug (KBABEL_SEARCH) << TQString ("...cursor getting...%1"). arg (ret) << endl; return DataBaseItem (); @@ -770,11 +770,11 @@ DataBaseManager::current () } int -DataBaseManager::createDataBase (QString directory, - QString language, int mode) +DataBaseManager::createDataBase (TQString directory, + TQString language, int mode) { - QString filename; - QString ll = "." + language; + TQString filename; + TQString ll = "." + language; if (ll == ".") ll = ".NOLANG"; filename = "%1/translations%2.db"; @@ -782,7 +782,7 @@ DataBaseManager::createDataBase (QString directory, rename (filename.local8Bit (), filename.local8Bit () + ",old"); -//kdDebug(0) << QString("Creating %1").arg(filename) << endl; +//kdDebug(0) << TQString("Creating %1").arg(filename) << endl; iAmOk = true; @@ -860,7 +860,7 @@ DataBaseManager::createDataBase (QString directory, if (iAmOk) loadInfo (); else - kdDebug (KBABEL_SEARCH) << QString ("I am NOT ok : %1"). + kdDebug (KBABEL_SEARCH) << TQString ("I am NOT ok : %1"). arg (ret) << endl; //THIS IS WRONG, rewrite the error handling. @@ -889,7 +889,7 @@ DataBaseManager::getCatalogInfo (int n) return InfoItem (); } -// kdDebug(0) << QString("Trad %1").arg(ret) << endl; +// kdDebug(0) << TQString("Trad %1").arg(ret) << endl; InfoItem it ((char *) data.data, language); //free(data.data); // Read docu for this!!!! @@ -936,10 +936,10 @@ DataBaseManager::addCatalogInfo (InfoItem * catInfo, int cat = -1) } int -DataBaseManager::searchCatalogInfo (QString location) +DataBaseManager::searchCatalogInfo (TQString location) { int n = 0; - QValueList < InfoItem >::Iterator it; + TQValueList < InfoItem >::Iterator it; for (it = info.begin (); it != info.end (); ++it) { n++; @@ -998,11 +998,11 @@ DataBaseManager::loadInfo () } -QValueList < QString > DataBaseManager::wordsIn (QString string) +TQValueList < TQString > DataBaseManager::wordsIn (TQString string) { QString a; - QValueList < QString > words; + TQValueList < TQString > words; int i, l; @@ -1036,10 +1036,10 @@ QValueList < QString > DataBaseManager::wordsIn (QString string) WordItem -DataBaseManager::getWordLocations (QString word) +DataBaseManager::getWordLocations (TQString word) { - QString keystring = word.lower (); + TQString keystring = word.lower (); DBT key; DBT data; @@ -1080,10 +1080,10 @@ DataBaseManager::getWordLocations (QString word) bool -DataBaseManager::addLocation (QString word, unsigned int location) +DataBaseManager::addLocation (TQString word, unsigned int location) { - QString keystring = word.lower (); + TQString keystring = word.lower (); DBT key; @@ -1289,7 +1289,7 @@ DataBaseManager::addLocation (QString word, unsigned int location) bool -DataBaseManager::removeLocation (QString /*word */ , int /*location */ ) +DataBaseManager::removeLocation (TQString /*word */ , int /*location */ ) { //#warning TODO: REMOVE LOCATION @@ -1298,7 +1298,7 @@ DataBaseManager::removeLocation (QString /*word */ , int /*location */ ) } uint32 -DataBaseManager::appendKey (QString _key) +DataBaseManager::appendKey (TQString _key) { DBT key; @@ -1324,7 +1324,7 @@ DataBaseManager::appendKey (QString _key) else ret = *(uint32 *) key.data; -//kdDebug(0) << QString("Append result %1,err = %1").arg(ret).arg(err) << endl; +//kdDebug(0) << TQString("Append result %1,err = %1").arg(ret).arg(err) << endl; free (data.data); @@ -1349,16 +1349,16 @@ DataBaseManager::getKey (uint32 n) //Check for errors int ret = indexDb->get (indexDb, 0, &key, &data, 0); //DB_SET_RECNO); if (ret) - return QString::null; + return TQString::null; - return QString::fromUtf8 ((char *) data.data); + return TQString::fromUtf8 ((char *) data.data); -// kdDebug(0) << QString("Trad %1").arg(ret) << endl; +// kdDebug(0) << TQString("Trad %1").arg(ret) << endl; } int -DataBaseManager::catalogRef (QString location, QString author, QString path) +DataBaseManager::catalogRef (TQString location, TQString author, TQString path) { InfoItem cinfo; int cat, catnum; @@ -1397,19 +1397,19 @@ DataBaseManager::catalogRef (QString location, QString author, QString path) } int -DataBaseManager::putNewTranslation (QString key, QString tran, int catalog, +DataBaseManager::putNewTranslation (TQString key, TQString tran, int catalog, bool ow) { int catnum = catalog; int count = 0; - QString msgid = key; + TQString msgid = key; DataBaseItem dbit = getItem (msgid); if (dbit.numTra == 0) //Not found { dbit.numTra += 1; - // use local variable, dbit.translations is QValueList and + // use local variable, dbit.translations is TQValueList and // will create own copy TranslationItem tra; tra.numRef = 1; @@ -1423,16 +1423,16 @@ DataBaseManager::putNewTranslation (QString key, QString tran, int catalog, int aa = putItem (&dbit); if (aa) - kdDebug (0) << QString ("-----------put code ") << aa << endl; + kdDebug (0) << TQString ("-----------put code ") << aa << endl; } else { // key exists - QString msgstr = tran; + TQString msgstr = tran; bool found_catalog_info = false, foundTr = false, isThisOne = false; - QValueList < TranslationItem >::Iterator ittr; + TQValueList < TranslationItem >::Iterator ittr; bool rem = false; // check all translations in the list @@ -1493,7 +1493,7 @@ DataBaseManager::putNewTranslation (QString key, QString tran, int catalog, //Check ret value int aa = putItem (&dbit, true); if (aa) - kdDebug (0) << QString ("-----------put code ") << aa << endl; + kdDebug (0) << TQString ("-----------put code ") << aa << endl; } return count; @@ -1513,11 +1513,11 @@ DataBaseManager::rebuildIndexes () uint32 location = loc; - QValueList < QString > wlist; + TQValueList < TQString > wlist; wlist = wordsIn (item->key); - QValueList < QString >::Iterator wlistit; + TQValueList < TQString >::Iterator wlistit; for (wlistit = wlist.begin (); wlistit != wlist.end (); ++wlistit) { diff --git a/kbabel/kbabeldict/modules/dbsearchengine/database.h b/kbabel/kbabeldict/modules/dbsearchengine/database.h index bf4767df..3e68e01d 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine/database.h +++ b/kbabel/kbabeldict/modules/dbsearchengine/database.h @@ -52,29 +52,29 @@ #define uint32 u_int32_t -#include <qvaluelist.h> -#include <qptrlist.h> -#include <qstring.h> -#include <qobject.h> -#include <qdatetime.h> -#include <qcstring.h> //bytearray +#include <tqvaluelist.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqobject.h> +#include <tqdatetime.h> +#include <tqcstring.h> //bytearray class WordItem // Returned by getWordLocations { public: - WordItem(char *data,QString w); - WordItem(QString w); + WordItem(char *data,TQString w); + WordItem(TQString w); //WordItem(const WordItem &wi); //WordItem& operator=(const WordItem & wi ); //The word (key in database) - QString word; + TQString word; //Sorted locations - //QByteArray locations; //too many problems with this.. + //TQByteArray locations; //too many problems with this.. //NOTE: - //This is allocated only if you call WordItem(char *data,QString w); + //This is allocated only if you call WordItem(char *data,TQString w); //YOU MUST FREE IT when you do not need it anymore //No destructor will do it !!! @@ -97,15 +97,15 @@ class InfoItem InfoItem(); // Create an info item from raw data - InfoItem(const char *rawData,QString lang); + InfoItem(const char *rawData,TQString lang); - QString catalogName; - QString lastFullPath; + TQString catalogName; + TQString lastFullPath; - QString lastTranslator; - QDateTime revisionDate; - QString charset; - QString language; + TQString lastTranslator; + TQDateTime revisionDate; + TQString charset; + TQString language; int size(); @@ -116,8 +116,8 @@ class InfoItem class TranslationItem { public: - QString translation; - QValueList<int> infoRef; + TQString translation; + TQValueList<int> infoRef; uint32 numRef; }; @@ -149,8 +149,8 @@ class DataBaseItem void toRawData(char *_data); void toRawKey(char *_key); - QString key; - QValueList<TranslationItem> translations; + TQString key; + TQValueList<TranslationItem> translations; uint32 numTra; uint32 location; }; @@ -175,13 +175,13 @@ class DataBaseManager : public QObject */ - DataBaseManager(QString directory,QString lang,QObject *parent=0,const char *name=0); + DataBaseManager(TQString directory,TQString lang,TQObject *parent=0,const char *name=0); ~DataBaseManager(); /* Create a new databse structure. */ - int createDataBase(QString directory,QString language,int mode=0664); + int createDataBase(TQString directory,TQString language,int mode=0664); @@ -198,7 +198,7 @@ class DataBaseManager : public QObject int putItem(DataBaseItem *item,bool ow=false); - DataBaseItem getItem(QString key); + DataBaseItem getItem(TQString key); /* @return the first entry in the database. @@ -226,7 +226,7 @@ class DataBaseManager : public QObject * overwritten if you provide a new translation */ - int putNewTranslation(QString key,QString tran,int catalog,bool ow=true); + int putNewTranslation(TQString key,TQString tran,int catalog,bool ow=true); /* @return info about catalog n @@ -246,14 +246,14 @@ class DataBaseManager : public QObject @return its refnum. */ - int searchCatalogInfo(QString location); + int searchCatalogInfo(TQString location); /* Get a catalog info for location, * if it doesn't exist it will create one. * @return the refnum */ - int catalogRef(QString location,QString author,QString path); + int catalogRef(TQString location,TQString author,TQString path); /* Put at refnum the catInfo @@ -265,17 +265,17 @@ class DataBaseManager : public QObject /* Get word info */ - WordItem getWordLocations(QString word); + WordItem getWordLocations(TQString word); /* Add a location for word */ - bool addLocation(QString word, unsigned int location); + bool addLocation(TQString word, unsigned int location); /* Remove location for word */ - bool removeLocation(QString word, int location); + bool removeLocation(TQString word, int location); /* @@ -283,9 +283,9 @@ class DataBaseManager : public QObject */ void rebuildIndexes(); - uint32 appendKey(class QString); + uint32 appendKey(class TQString); - QString getKey(uint32 n); + TQString getKey(uint32 n); /* Load the catalogs info. @@ -302,7 +302,7 @@ class DataBaseManager : public QObject void openDataBase(); void closeDataBase(); - static QValueList<QString> wordsIn(QString string); + static TQValueList<TQString> wordsIn(TQString string); signals: @@ -312,9 +312,9 @@ class DataBaseManager : public QObject protected: DataBaseItem cursorGet(uint32 flags); - QString language; - QString basedir; - QValueList<InfoItem> info; + TQString language; + TQString basedir; + TQValueList<InfoItem> info; DB *db,*infoDb,*wordDb,*indexDb; DBC *cursor; diff --git a/kbabel/kbabeldict/modules/dbsearchengine/dbscan.cpp b/kbabel/kbabeldict/modules/dbsearchengine/dbscan.cpp index 87b39e61..0ee1ba4b 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine/dbscan.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine/dbscan.cpp @@ -30,8 +30,8 @@ */ #include "dbscan.h" -#include <qdir.h> -#include <qfile.h> +#include <tqdir.h> +#include <tqfile.h> #include <kapplication.h> #include <kurl.h> #include <kdebug.h> @@ -39,14 +39,14 @@ using namespace KBabel; PoScanner::PoScanner(DataBaseManager *dbm, - QObject *parent,const char *name):QObject(parent,name) + TQObject *parent,const char *name):TQObject(parent,name) { dm=dbm; removeOldCatalogTranslation=false; //Check if this flag do something. count=0; } -bool PoScanner::scanPattern(QString pathName,QString pattern,bool rec) +bool PoScanner::scanPattern(TQString pathName,TQString pattern,bool rec) { int tot; @@ -57,17 +57,17 @@ if (!called) { pb=true; count=0;} called=true; -kdDebug(0) << QString("cat: %1, %2").arg(pathName).arg(pattern) << endl; +kdDebug(0) << TQString("cat: %1, %2").arg(pathName).arg(pattern) << endl; if(pb) {emit patternStarted(); emit patternProgress(0); } - QDir d(pathName,pattern); + TQDir d(pathName,pattern); d.setMatchAllDirs(true); const QFileInfoList* files = d.entryInfoList(); tot=files->count(); - QPtrListIterator<QFileInfo> it(*files); + TQPtrListIterator<TQFileInfo> it(*files); kdDebug(0) << tot << endl; for ( int i=0; i<tot; i++ ) { @@ -110,7 +110,7 @@ return true; -bool PoScanner::scanFile(QString fileName) +bool PoScanner::scanFile(TQString fileName) { @@ -120,8 +120,8 @@ InfoItem cinfo; Catalog * catalog=new Catalog(this,"ScanPoCatalog"); -QString location=fileName.right(fileName.length()-fileName.findRev("/")-1); -connect(catalog,SIGNAL(signalProgress(int)),this,SIGNAL(fileLoading(int))); +TQString location=fileName.right(fileName.length()-fileName.findRev("/")-1); +connect(catalog,TQT_SIGNAL(signalProgress(int)),this,TQT_SIGNAL(fileLoading(int))); emit filename(location); emit fileProgress(0); emit fileLoading(0); @@ -136,10 +136,10 @@ if(rr != OK && rr !=RECOVERED_PARSE_ERROR ) } emit fileLoading(100); -QString author; +TQString author; if(rr != HEADER_ERROR) author=catalog->lastTranslator(); -else author=QString("unknown"); +else author=TQString("unknown"); int catnum=dm->catalogRef(location,author,fileName); @@ -149,7 +149,7 @@ tot=catalog->numberOfEntries(); bool fuzzy; bool untra; -//kdDebug(0) << QString("Tot: %1").arg(tot) << endl; +//kdDebug(0) << TQString("Tot: %1").arg(tot) << endl; for (i=0;i<tot;i++) //Skip header = ???? { @@ -169,7 +169,7 @@ for (i=0;i<tot;i++) //Skip header = ???? if(!fuzzy && !untra) { int res; - QString msgid,msgstr; + TQString msgid,msgstr; msgid=catalog->msgid(i,true).first(); kdWarning() << "Translation database does not support plural forms" << endl; msgstr=catalog->msgstr(i).first(); @@ -181,7 +181,7 @@ for (i=0;i<tot;i++) //Skip header = ???? } -// kdDebug(0) << QString("File finished") << endl; +// kdDebug(0) << TQString("File finished") << endl; emit fileProgress(0); emit fileLoading(0); diff --git a/kbabel/kbabeldict/modules/dbsearchengine/dbscan.h b/kbabel/kbabeldict/modules/dbsearchengine/dbscan.h index c151509e..2390c3d1 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine/dbscan.h +++ b/kbabel/kbabeldict/modules/dbsearchengine/dbscan.h @@ -47,17 +47,17 @@ class PoScanner : public QObject public: - PoScanner(DataBaseManager *dbm,QObject *parent=0,const char *name=0); + PoScanner(DataBaseManager *dbm,TQObject *parent=0,const char *name=0); /* Scan a single PO file. */ - bool scanFile(QString fileName); + bool scanFile(TQString fileName); /* Scan a list of space separated files with possible MetaCharacters */ - bool scanPattern(QString pathName,QString pattern="*.po",bool rec=false); + bool scanPattern(TQString pathName,TQString pattern="*.po",bool rec=false); @@ -71,7 +71,7 @@ signals: void patternProgress(int); void patternFinished(); void added(int); - void filename(QString); + void filename(TQString); private: // If true when a translation is found in a CATALOG the old translation for this CATALOG diff --git a/kbabel/kbabeldict/modules/dbsearchengine/dbse_factory.cpp b/kbabel/kbabeldict/modules/dbsearchengine/dbse_factory.cpp index 37332167..86975874 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine/dbse_factory.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine/dbse_factory.cpp @@ -21,7 +21,7 @@ KInstance *DbSeFactory::s_instance = 0; KAboutData *DbSeFactory::s_about = 0; -DbSeFactory::DbSeFactory( QObject *parent, const char *name) +DbSeFactory::DbSeFactory( TQObject *parent, const char *name) : KLibFactory(parent,name) { } @@ -42,10 +42,10 @@ DbSeFactory::~DbSeFactory() } -QObject *DbSeFactory::createObject( QObject *parent, const char *name, - const char *classname, const QStringList &) +TQObject *DbSeFactory::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/dbsearchengine/dbse_factory.h b/kbabel/kbabeldict/modules/dbsearchengine/dbse_factory.h index 6a9f9f3d..7ae4f20b 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine/dbse_factory.h +++ b/kbabel/kbabeldict/modules/dbsearchengine/dbse_factory.h @@ -9,12 +9,12 @@ class DbSeFactory : public KLibFactory { Q_OBJECT public: - DbSeFactory( QObject *parent=0, const char *name=0); + DbSeFactory( TQObject *parent=0, const char *name=0); ~DbSeFactory(); - 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/dbsearchengine/preferenceswidget.cpp b/kbabel/kbabeldict/modules/dbsearchengine/preferenceswidget.cpp index 3bb65934..562f0835 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine/preferenceswidget.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine/preferenceswidget.cpp @@ -1,33 +1,33 @@ -#include <qradiobutton.h> -#include <qslider.h> -#include <qspinbox.h> -#include <qcheckbox.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqradiobutton.h> +#include <tqslider.h> +#include <tqspinbox.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> #include <klocale.h> #include <kfiledialog.h> #include <kurlrequester.h> -#include <qtoolbutton.h> +#include <tqtoolbutton.h> #include <klineedit.h> #include <kstandarddirs.h> #include "dbseprefwidget.h" #include "preferenceswidget.h" -PreferencesWidget::PreferencesWidget(QWidget *parent, const char* name) +PreferencesWidget::PreferencesWidget(TQWidget *parent, const char* name) : PrefWidget(parent,name) { - QVBoxLayout *layout = new QVBoxLayout(this); -// QLabel *label = new QLabel(i18n("Settings for KDE database search engine"),this); + TQVBoxLayout *layout = new TQVBoxLayout(this); +// TQLabel *label = new TQLabel(i18n("Settings for KDE database search engine"),this); // layout->addWidget(label); dbpw = new DBSearchEnginePref(this); dbpw->dirInput->setMode(KFile::Directory | KFile::LocalOnly); layout->addWidget(dbpw); - resize(QSize(200,200).expandedTo(minimumSizeHint())); + resize(TQSize(200,200).expandedTo(minimumSizeHint())); -// connect(dbpw->browseTB_3,SIGNAL(clicked()),SLOT(browse1())); +// connect(dbpw->browseTB_3,TQT_SIGNAL(clicked()),TQT_SLOT(browse1())); emit restoreNow(); //Fill with actual params. @@ -84,7 +84,7 @@ dbpw->ignoreLE->setText("&.:"); dbpw->autoAddCB_2->setChecked(true); -QString defaultDir; +TQString defaultDir; KStandardDirs * dirs = KGlobal::dirs(); if(dirs) { @@ -97,7 +97,7 @@ QString defaultDir; dbpw->dirInput->setURL(defaultDir); } -void PreferencesWidget::setName(QString n) +void PreferencesWidget::setName(TQString n) { dbpw->filenameLB->setText(i18n("Scanning file: %1").arg(n)); } diff --git a/kbabel/kbabeldict/modules/dbsearchengine/preferenceswidget.h b/kbabel/kbabeldict/modules/dbsearchengine/preferenceswidget.h index 599408cd..5cd1fed8 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine/preferenceswidget.h +++ b/kbabel/kbabeldict/modules/dbsearchengine/preferenceswidget.h @@ -9,7 +9,7 @@ class PreferencesWidget : public PrefWidget Q_OBJECT public: - PreferencesWidget(QWidget *parent=0, const char* name=0); + PreferencesWidget(TQWidget *parent=0, const char* name=0); virtual ~PreferencesWidget(); virtual void apply(); @@ -17,7 +17,7 @@ public: virtual void standard(); DBSearchEnginePref *dbpw; public slots: - void setName(QString); + void setName(TQString); void setEntries(int); signals: void applyNow(); |