diff options
Diffstat (limited to 'kbabel/kbabeldict/modules/dbsearchengine/KDBSearchEngine.cpp')
-rw-r--r-- | kbabel/kbabeldict/modules/dbsearchengine/KDBSearchEngine.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/kbabel/kbabeldict/modules/dbsearchengine/KDBSearchEngine.cpp b/kbabel/kbabeldict/modules/dbsearchengine/KDBSearchEngine.cpp index 5c5c6a6d..3e658255 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine/KDBSearchEngine.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine/KDBSearchEngine.cpp @@ -18,11 +18,11 @@ * * * In addition, as a special exception, the copyright holders give * * permission to link the code of this program with any edition of * - * the Qt library by Trolltech AS, Norway (or with modified versions * - * of Qt that use the same license as Qt), and distribute linked * + * the TQt library by Trolltech AS, Norway (or with modified versions * + * of TQt that use the same license as TQt), and distribute linked * * combinations including the two. You must obey the GNU General * * Public License in all respects for all of the code used other than * - * Qt. If you modify this file, you may extend this exception to * + * TQt. If you modify this file, you may extend this exception to * * your version of the file, but you are not obligated to do so. If * * you do not wish to do so, delete this exception statement from * * your version. * @@ -72,8 +72,8 @@ using namespace KBabel; -KDBSearchEngine::KDBSearchEngine (TQObject * parent, const char *name): -SearchEngine (parent, name) +KDBSearchEngine::KDBSearchEngine (TQObject * tqparent, const char *name): +SearchEngine (tqparent, name) { edited = "unknown"; dm = 0; //Database Manager @@ -124,7 +124,7 @@ KDBSearchEngine::loadDatabase (TQString database, bool noask = false) i18n ("Database folder does not exist:\n%1\n" "Do you want to create it now?"). - arg (database), TQString::null, i18n("Create Folder"), i18n("Do Not Create")) == + arg (database), TQString(), i18n("Create Folder"), i18n("Do Not Create")) == KMessageBox::Yes) { asked = true; @@ -255,7 +255,7 @@ KDBSearchEngine::loadDatabase (TQString database, bool noask = false) if (asked || KMessageBox::questionYesNo (0, i18n - ("Database files not found.\nDo you want to create them now?"), TQString::null, i18n("Create"), i18n("Do Not Create")) + ("Database files not found.\nDo you want to create them now?"), TQString(), i18n("Create"), i18n("Do Not Create")) == KMessageBox::Yes) { //fprintf(stderr,"SI\n"); @@ -559,7 +559,7 @@ KDBSearchEngine::repeat () bool ok = false; min = - QInputDialog::getInteger (i18n ("Minimum Repetition"), + TQInputDialog::getInteger (i18n ("Minimum Repetition"), i18n ("Insert the minimum number of repetitions for a string:"), 2, 1, 999999, 1, &ok); @@ -607,7 +607,7 @@ KDBSearchEngine::repeat () if (tot >= min && !inlibs) { id = item.key; - id = id.replace ("\n", "\"\n\""); + id = id.tqreplace ("\n", "\"\n\""); mle->append (txt.arg (tot).arg (ntra).arg (id)); } @@ -667,7 +667,7 @@ KDBSearchEngine::startSearchNow (int searchmode) bool allkey = (searchmode == MD_ALL_GOOD_KEYS); - bool equal, contains, contained, regexp, intra; + bool equal, tqcontains, contained, regexp, intra; intra = searchmode & MD_IN_TRANSLATION; @@ -700,12 +700,12 @@ KDBSearchEngine::startSearchNow (int searchmode) int pos; for (i = 0; i < len; i++) { - while ((pos = idMod->find (remchar.at (i))) != -1) + while ((pos = idMod->tqfind (remchar.at (i))) != -1) idMod->remove (pos, 1); } if (comm) - idMod->replace (TQRegExp ("\\_\\:.*\\\\n"), ""); //Read it from catalog !!! (NOT ONLY HERE) + idMod->tqreplace (TQRegExp ("\\_\\:.*\\\\n"), ""); //Read it from catalog !!! (NOT ONLY HERE) if (norm) @@ -773,7 +773,7 @@ KDBSearchEngine::startSearchNow (int searchmode) // Emit progress, process event and check stop now if (count % step == 0) { - emit progress (100 * count / /*QMAX( */ + emit progress (100 * count / /*TQMAX( */ totalprogress /*,1) */ ); kapp->processEvents (100); @@ -802,12 +802,12 @@ KDBSearchEngine::startSearchNow (int searchmode) //Remove character in list of character to be ignored for (i = 0; i < len; i++) - while ((pos = msgId.find (remchar.at (i))) != -1) + while ((pos = msgId.tqfind (remchar.at (i))) != -1) msgId.remove (pos, 1); //Remove context information from id found if (comm) - msgId.replace (TQRegExp ("\\_\\:.*\\\\n"), ""); + msgId.tqreplace (TQRegExp ("\\_\\:.*\\\\n"), ""); if (norm) @@ -838,14 +838,14 @@ KDBSearchEngine::startSearchNow (int searchmode) //Remove character in list of character to be ignored for (i = 0; i < len; i++) while ((pos = - msgId.find (remchar.at (i))) != + msgId.tqfind (remchar.at (i))) != -1) msgId.remove (pos, 1); //Remove context information from id found if (comm) msgId. - replace (TQRegExp ("\\_\\:.*\\\\n"), + tqreplace (TQRegExp ("\\_\\:.*\\\\n"), ""); @@ -867,12 +867,12 @@ KDBSearchEngine::startSearchNow (int searchmode) equal = false; if (rules & Contains) - contains = idMod->contains (msgId); + tqcontains = idMod->tqcontains (msgId); else - contains = false; + tqcontains = false; if (rules & Contained) - contained = msgId.contains (*idMod); + contained = msgId.tqcontains (*idMod); else contained = false; @@ -887,7 +887,7 @@ KDBSearchEngine::startSearchNow (int searchmode) } while (intra && nn < item.numTra); - if (equal || contains || contained || regexp || allkey) + if (equal || tqcontains || contained || regexp || allkey) { if (equal) @@ -1034,7 +1034,7 @@ KDBSearchEngine::startSingleSearch (TQString searchString, in = reg.search (searchString, in + len); len = reg.matchedLength (); TQString regToAdd = searchString; - regToAdd.replace (in, len, "[a-zA-Z0-9_%" + regaddchar + "]*"); + regToAdd.tqreplace (in, len, "[a-zA-Z0-9_%" + regaddchar + "]*"); regToAdd.append ("$"); regToAdd.prepend ("^"); // fprintf(stderr,"%s",(const char *)regToAdd.local8Bit()); @@ -1203,10 +1203,10 @@ KDBSearchEngine::readSettings (KConfigBase * config) } PrefWidget * -KDBSearchEngine::preferencesWidget (TQWidget * parent) +KDBSearchEngine::preferencesWidget (TQWidget * tqparent) { - pw = new PreferencesWidget (parent); + pw = new PreferencesWidget (tqparent); setSettings (); connect (pw, TQT_SIGNAL (restoreNow ()), this, TQT_SLOT (setSettings ())); connect (pw, TQT_SIGNAL (applyNow ()), this, TQT_SLOT (updateSettings ())); @@ -1406,19 +1406,19 @@ KDBSearchEngine::about () const } -QString +TQString KDBSearchEngine::name () const { return i18n ("Translation Database"); } -QString +TQString KDBSearchEngine::id () const { return TQString ("KDBSearchEngine"); } -QString +TQString KDBSearchEngine::lastError () { return lasterror; @@ -1552,11 +1552,11 @@ KDBSearchEngine::setLastError (const TQString & er) lasterror = er; } -QString +TQString KDBSearchEngine::translate (const TQString & text, const uint pluralForm) { if (!openDb ()) - return TQString::null; + return TQString(); /* if(!dbOpened) @@ -1566,7 +1566,7 @@ if(!dbOpened) { //emit anerror hasError(i18n("Database not opened")); - return TQString::null; + return TQString(); } } */ @@ -1574,7 +1574,7 @@ if(!dbOpened) DataBaseItem dbit = dm->getItem (text); if (dbit.isNull ()) - return TQString::null; + return TQString(); if (dbit.numTra == 1) return dbit.translations[0].translation; @@ -1744,9 +1744,9 @@ TQValueList < KeyAndScore > KDBSearchEngine::searchWords (TQString phrase, int in = 0, len = 0; - QString + TQString keyst = dm->getKey (min); - QRegExp + TQRegExp reg ("[a-zA-Z0-9_%" /*+remchar */ + regaddchar + "]+"); while ((in = reg.search (keyst, in + len)) != -1) { @@ -1798,7 +1798,7 @@ TQValueList < KeyAndScore > KDBSearchEngine::searchWords (TQString phrase, for (int j = 0; j < nres; j++) { - QString + TQString strkey = dm->getKey (resloc[j]); int stdscore = KDBSearchEngine::score (phrase, strkey); @@ -1811,7 +1811,7 @@ TQValueList < KeyAndScore > KDBSearchEngine::searchWords (TQString phrase, in = 0, len = 0, nword = 0; int remove = retnot ? common : 0; - QRegExp + TQRegExp reg ("[a-zA-Z0-9_%" /*+remchar */ + regaddchar + "]+"); while ((in = reg.search (strkey, in + len)) != -1) { |