summaryrefslogtreecommitdiffstats
path: root/kbabel/kbabeldict/modules/dbsearchengine2/KDBSearchEngine2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kbabel/kbabeldict/modules/dbsearchengine2/KDBSearchEngine2.cpp')
-rw-r--r--kbabel/kbabeldict/modules/dbsearchengine2/KDBSearchEngine2.cpp118
1 files changed, 59 insertions, 59 deletions
diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/KDBSearchEngine2.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/KDBSearchEngine2.cpp
index 5bf088b8..41f4319d 100644
--- a/kbabel/kbabeldict/modules/dbsearchengine2/KDBSearchEngine2.cpp
+++ b/kbabel/kbabeldict/modules/dbsearchengine2/KDBSearchEngine2.cpp
@@ -35,19 +35,19 @@
#include "dbscan.h"
#include <klineedit.h>
#include <kapplication.h>
-#include <qpushbutton.h>
+#include <tqpushbutton.h>
#include <kurlrequester.h>
-#include <qcheckbox.h>
+#include <tqcheckbox.h>
#include <knuminput.h>
#include <kstandarddirs.h>
#include <kmessagebox.h>
-#include <qmap.h>
+#include <tqmap.h>
#include <kdebug.h>
#define i18n (const char *)
-KDBSearchEngine2::KDBSearchEngine2(QObject *parent,const char*name)
+KDBSearchEngine2::KDBSearchEngine2(TQObject *parent,const char*name)
: SearchEngine(parent,name)
{
pw=0;
@@ -55,7 +55,7 @@ KDBSearchEngine2::KDBSearchEngine2(QObject *parent,const char*name)
di=0; //Database Interface is not yet initialized
- connect(this,SIGNAL(hasError(QString)),SLOT(setLastError(QString)));
+ connect(this,TQT_SIGNAL(hasError(TQString)),TQT_SLOT(setLastError(TQString)));
searching=false; // i'm not searching
iAmReady=true; //there are no reason to say I'm not ready.
@@ -69,11 +69,11 @@ KDBSearchEngine2::~KDBSearchEngine2()
delete di; //delete database interface
}
-bool KDBSearchEngine2::startSearch(QString str)
+bool KDBSearchEngine2::startSearch(TQString str)
{
kdDebug(0) << "Start a new search. Looking for: " << str << endl;
- static QString queryString;
+ static TQString queryString;
queryString=str; //set the latest query string (note: it is static)
@@ -92,7 +92,7 @@ bool KDBSearchEngine2::startSearch(QString str)
searching=true; //really start searching
- QString searchingString;
+ TQString searchingString;
do //Search loop, it stops only when finished and latest searched string is the actual query string.
{
@@ -134,8 +134,8 @@ bool KDBSearchEngine2::startSearch(QString str)
strategy.addAlgorithm(&wbyw);
- connect(&strategy,SIGNAL(newResult(QueryResult)),this,SLOT(receiveResult(QueryResult)));
- strategy.exec(searchingString); disconnect(&strategy,SIGNAL(newResult(QueryResult)),this,SLOT(receiveResult(QueryResult)));
+ connect(&strategy,TQT_SIGNAL(newResult(QueryResult)),this,TQT_SLOT(receiveResult(QueryResult)));
+ strategy.exec(searchingString); disconnect(&strategy,TQT_SIGNAL(newResult(QueryResult)),this,TQT_SLOT(receiveResult(QueryResult)));
kdDebug(0) << "End of search for " << searchingString << endl;
@@ -158,7 +158,7 @@ bool KDBSearchEngine2::startSearch(QString str)
-bool KDBSearchEngine2::startSearchInTranslation(QString str)
+bool KDBSearchEngine2::startSearchInTranslation(TQString str)
{
if(autoupdate)
{
@@ -172,20 +172,20 @@ bool KDBSearchEngine2::startSearchInTranslation(QString str)
-bool KDBSearchEngine2::messagesForPackage(const QString& package
- , QValueList<Message>& resultList, QString& error)
+bool KDBSearchEngine2::messagesForPackage(const TQString& package
+ , TQValueList<Message>& resultList, TQString& error)
{
//FIXME implement this (needs filters)
return true;
}
-void KDBSearchEngine2::setLastError(QString er)
+void KDBSearchEngine2::setLastError(TQString er)
{
lasterror=er;
}
-QString KDBSearchEngine2::translate(const QString text)
+TQString KDBSearchEngine2::translate(const TQString text)
{
ExactSearchAlgorithm exact(di,&settings);
@@ -212,14 +212,14 @@ void KDBSearchEngine2::receiveResult(QueryResult r)
/* A SEARCH RESULT CONTAINS (see searchengine.h)
- QString requested;
- QString found;
- QString translation;
- QString plainTranslation;
- QString plainFound;
- QString plainRequested;
+ TQString requested;
+ TQString found;
+ TQString translation;
+ TQString plainTranslation;
+ TQString plainFound;
+ TQString plainRequested;
int score;
- QPtrList<TranslationInfo> descriptions;
+ TQPtrList<TranslationInfo> descriptions;
*/
@@ -230,7 +230,7 @@ bool KDBSearchEngine2::init()
else
{
di = new DataBaseInterface(dbDirectory,&settings);
- connect(di,SIGNAL(newResult(QueryResult)),this,SLOT(receiveResult(QueryResult)));
+ connect(di,TQT_SIGNAL(newResult(QueryResult)),this,TQT_SLOT(receiveResult(QueryResult)));
//FIXME: what wbout ready()
if(!di->mainOk()) return false; //check if the main DB is OK.
@@ -243,8 +243,8 @@ const KAboutData *KDBSearchEngine2::about() const
return DbSe2Factory::instance()->aboutData();
}
-void KDBSearchEngine2::stringChanged( QString orig, QString translated
- , QString description)
+void KDBSearchEngine2::stringChanged( TQString orig, TQString translated
+ , TQString description)
{
if(!init()) return;
@@ -255,22 +255,22 @@ void KDBSearchEngine2::stringChanged( QString orig, QString translated
}
-PrefWidget * KDBSearchEngine2::preferencesWidget(QWidget *parent)
+PrefWidget * KDBSearchEngine2::preferencesWidget(TQWidget *parent)
{
pw = new KDB2PreferencesWidget(parent);
kdDebug(0) << "new KDB2 preferences widget" << endl;
setSettings();
- connect(pw,SIGNAL(restoreNow()),this,SLOT(setSettings()));
- connect(pw,SIGNAL(applyNow()),this,SLOT(updateSettings()));
- connect(pw,SIGNAL(destroyed()),this,SLOT(prefDestr()));
+ 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->scanAll,SIGNAL(clicked()),this,SLOT(scanAllPressed()));
- connect(pw->dbpw->scanSource,SIGNAL(clicked()),this,SLOT(scanNowPressed()));
- connect(pw->dbpw->addSource,SIGNAL(clicked()),this,SLOT(addSource()));
- connect(pw->dbpw->editSource,SIGNAL(clicked()),this,SLOT(editSource()));
- connect(pw->dbpw->removeSource,SIGNAL(clicked()),this,SLOT(removeSource()));
+ connect(pw->dbpw->scanAll,TQT_SIGNAL(clicked()),this,TQT_SLOT(scanAllPressed()));
+ connect(pw->dbpw->scanSource,TQT_SIGNAL(clicked()),this,TQT_SLOT(scanNowPressed()));
+ connect(pw->dbpw->addSource,TQT_SIGNAL(clicked()),this,TQT_SLOT(addSource()));
+ connect(pw->dbpw->editSource,TQT_SIGNAL(clicked()),this,TQT_SLOT(editSource()));
+ connect(pw->dbpw->removeSource,TQT_SIGNAL(clicked()),this,TQT_SLOT(removeSource()));
return pw;
@@ -309,10 +309,10 @@ void KDBSearchEngine2::saveSettings(KConfigBase *config)
uint sourceNumber=0;
config->writeEntry("NumberOfDBImportSources",sources.count());
- for(QMap<QString,MessagesSource>::iterator sourceIt=sources.begin() ; sourceIt!=sources.end(); ++sourceIt)
+ for(TQMap<TQString,MessagesSource>::iterator sourceIt=sources.begin() ; sourceIt!=sources.end(); ++sourceIt)
{
sourceNumber++;
- config->setGroup("DBImportSource-"+QString::number(sourceNumber));
+ config->setGroup("DBImportSource-"+TQString::number(sourceNumber));
config->writeEntry("Name",sourceIt.key());
sourceIt.data().writeConfig(config);
}
@@ -321,7 +321,7 @@ void KDBSearchEngine2::saveSettings(KConfigBase *config)
void KDBSearchEngine2::readSettings(KConfigBase *config)
{
- /*QString defaultDir;
+ /*TQString defaultDir;
KStandardDirs * dirs = KGlobal::dirs();
if(dirs)
{
@@ -361,8 +361,8 @@ void KDBSearchEngine2::readSettings(KConfigBase *config)
kdDebug(0) << "Found "<< numberOfSources << " sources" << endl;
for(uint sourceNumber=1;sourceNumber<=numberOfSources;sourceNumber++)
{
- config->setGroup("DBImportSource-"+QString::number(sourceNumber));
- QString name=config->readEntry("Name");
+ config->setGroup("DBImportSource-"+TQString::number(sourceNumber));
+ TQString name=config->readEntry("Name");
sources[name].readConfig(config);
}
if(pw)
@@ -401,7 +401,7 @@ void KDBSearchEngine2::setSettings()
//pw->dbpw->useFilters->setChecked(false);
//pw->dbpw->dateToday->setChecked(false);
pw->dbpw->sourceList->clear();
- for(QMap<QString,MessagesSource>::iterator sourceIt=sources.begin() ; sourceIt!=sources.end(); ++sourceIt)
+ for(TQMap<TQString,MessagesSource>::iterator sourceIt=sources.begin() ; sourceIt!=sources.end(); ++sourceIt)
{
pw->dbpw->sourceList->insertItem(sourceIt.key());
}
@@ -413,7 +413,7 @@ void KDBSearchEngine2::updateSettings()
{
if(!pw) return;
- QString newdb = pw->dbpw->dbDirectory->url();
+ TQString newdb = pw->dbpw->dbDirectory->url();
if(newdb !=dbDirectory)
{
kdDebug(0) << "Recreate DB-Interface cause dbdir is changed" << endl;
@@ -469,19 +469,19 @@ pw->dbpw->sourceList->
}
-/*void KDBSearchEngine2::scanSource(QString sourceName)
+/*void KDBSearchEngine2::scanSource(TQString sourceName)
{
//FIXME: an error here would be nice
if(!init()) return;
- for(QValueList<MessagesSource>::iterator sourceIt=sources.begin() ; sourceIt!=sources.end(); sourceIt++)
+ for(TQValueList<MessagesSource>::iterator sourceIt=sources.begin() ; sourceIt!=sources.end(); sourceIt++)
{
if((*sourceIt).getName()==sourceName)
{
- QValueList<KURL> urls=(*sourceIt).urls();
+ TQValueList<KURL> urls=(*sourceIt).urls();
PoScanner ps(di);
- for(QValueList<KURL>::iterator urlIt=urls.begin();urlIt!=urls.end();urlIt++)
+ for(TQValueList<KURL>::iterator urlIt=urls.begin();urlIt!=urls.end();urlIt++)
ps.scanFile(*urlIt);
//We suppose name are unique so no need for further scrolling
@@ -496,14 +496,14 @@ void KDBSearchEngine2::scanNowPressed()
kdDebug(0) << "We should not be here, scanNow called without a pw!" << endl;
return;
}
- QString sourceName;
+ TQString sourceName;
sourceName=pw->dbpw->sourceList->currentText();
if(!init()) return;
if(sources.contains(sourceName))
{
- QValueList<KURL> urls=sources[sourceName].urls();
+ TQValueList<KURL> urls=sources[sourceName].urls();
PoScanner ps(di);
- for(QValueList<KURL>::iterator urlIt=urls.begin();urlIt!=urls.end();++urlIt)
+ for(TQValueList<KURL>::iterator urlIt=urls.begin();urlIt!=urls.end();++urlIt)
ps.scanURL(*urlIt);
}
@@ -520,10 +520,10 @@ void KDBSearchEngine2::scanAllPressed()
PoScanner ps(di);
- for(QMap<QString,MessagesSource>::iterator sourceIt=sources.begin() ; sourceIt!=sources.end(); ++sourceIt)
+ for(TQMap<TQString,MessagesSource>::iterator sourceIt=sources.begin() ; sourceIt!=sources.end(); ++sourceIt)
{
- QValueList<KURL> urls=(*sourceIt).urls();
- for(QValueList<KURL>::iterator urlIt=urls.begin();urlIt!=urls.end();++urlIt)
+ TQValueList<KURL> urls=(*sourceIt).urls();
+ for(TQValueList<KURL>::iterator urlIt=urls.begin();urlIt!=urls.end();++urlIt)
ps.scanURL(*urlIt);
}
}
@@ -535,18 +535,18 @@ void KDBSearchEngine2::editSource()
kdDebug(0) << "We should not be here, editSource called without a pw!" << endl;
return;
}
- QString sourceName;
+ TQString sourceName;
sourceName=pw->dbpw->sourceList->currentText();
if(sources.contains(sourceName))
{
bool nameIsNew;
- QString newName;
+ TQString newName;
SourceDialog sd;
do{
sources[sourceName].setDialogValues(&sd);
sd.sourceName->setText(sourceName);
- if(sd.exec()==QDialog::Accepted)
+ if(sd.exec()==TQDialog::Accepted)
{
sources[sourceName].getDialogValues(&sd);
newName= sd.sourceName->text();
@@ -586,7 +586,7 @@ void KDBSearchEngine2::removeSource()
kdDebug(0) << "We should not be here, delteSource called without a pw!" << endl;
return;
}
- QString sourceName;
+ TQString sourceName;
sourceName=pw->dbpw->sourceList->currentText();
sources.remove(sourceName);
pw->dbpw->sourceList->removeItem(pw->dbpw->sourceList->currentItem());
@@ -595,11 +595,11 @@ void KDBSearchEngine2::removeSource()
void KDBSearchEngine2::addSource()
{
- QString newName;
+ TQString newName;
SourceDialog sd;
bool nameIsNew;
do{
- if(sd.exec()==QDialog::Accepted)
+ if(sd.exec()==TQDialog::Accepted)
{
newName= sd.sourceName->text();
nameIsNew=!sources.contains(newName);
@@ -625,7 +625,7 @@ void KDBSearchEngine2::addSource()
}
-QString KDBSearchEngine2::searchTranslation( const QString text, int & score )
+TQString KDBSearchEngine2::searchTranslation( const TQString text, int & score )
{
GenericSearchAlgorithm strategy(di,&settings);
strategy.setMaxResultNumber(1);
@@ -644,7 +644,7 @@ QString KDBSearchEngine2::searchTranslation( const QString text, int & score )
}
-QString KDBSearchEngine2::fuzzyTranslation( const QString text, int & score )
+TQString KDBSearchEngine2::fuzzyTranslation( const TQString text, int & score )
{
GenericSearchAlgorithm strategy(di,&settings);
strategy.setMaxResultNumber(1);