diff options
Diffstat (limited to 'kbabel/kbabeldict')
65 files changed, 1851 insertions, 1851 deletions
diff --git a/kbabel/kbabeldict/aboutmoduledlg.cpp b/kbabel/kbabeldict/aboutmoduledlg.cpp index eaab8b3b..5de3f0fb 100644 --- a/kbabel/kbabeldict/aboutmoduledlg.cpp +++ b/kbabel/kbabeldict/aboutmoduledlg.cpp @@ -35,7 +35,7 @@ #include <kbugreport.h> #include <klocale.h> -AboutModuleDlg::AboutModuleDlg(const KAboutData *aboutData, QWidget *parent) +AboutModuleDlg::AboutModuleDlg(const KAboutData *aboutData, TQWidget *parent) : KAboutApplication(aboutData, parent) , _aboutData(aboutData) { @@ -43,7 +43,7 @@ AboutModuleDlg::AboutModuleDlg(const KAboutData *aboutData, QWidget *parent) enableLinkedHelp(true); } -void AboutModuleDlg::helpClickedSlot(const QString&) +void AboutModuleDlg::helpClickedSlot(const TQString&) { KBugReport *bugReport = new KBugReport(0,true,_aboutData); diff --git a/kbabel/kbabeldict/aboutmoduledlg.h b/kbabel/kbabeldict/aboutmoduledlg.h index f79d77ec..09f13f8f 100644 --- a/kbabel/kbabeldict/aboutmoduledlg.h +++ b/kbabel/kbabeldict/aboutmoduledlg.h @@ -43,10 +43,10 @@ class AboutModuleDlg : public KAboutApplication Q_OBJECT public: - AboutModuleDlg(const KAboutData *aboutData, QWidget* parent=0); + AboutModuleDlg(const KAboutData *aboutData, TQWidget* parent=0); public slots: - virtual void helpClickedSlot(const QString&); + virtual void helpClickedSlot(const TQString&); private: const KAboutData *_aboutData; diff --git a/kbabel/kbabeldict/dictchooser.cpp b/kbabel/kbabeldict/dictchooser.cpp index f9360b61..f99c3709 100644 --- a/kbabel/kbabeldict/dictchooser.cpp +++ b/kbabel/kbabeldict/dictchooser.cpp @@ -35,42 +35,42 @@ #include "dictchooser.h" #include "resources.h" -#include <qlabel.h> -#include <qlayout.h> -#include <qpushbutton.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> #include <kconfig.h> #include <klistbox.h> #include <klocale.h> #include <kdialog.h> #include <ktempfile.h> -DictChooser::DictChooser(KBabelDictBox*b, QStringList selected - , QWidget *parent, const char *name) - : QWidget(parent,name), box(b) +DictChooser::DictChooser(KBabelDictBox*b, TQStringList selected + , TQWidget *parent, const char *name) + : TQWidget(parent,name), box(b) { tempConfig.clear(); tempConfig.setAutoDelete(true); dictList = box->moduleInfos(); - QGridLayout *layout = new QGridLayout(this); + TQGridLayout *layout = new TQGridLayout(this); layout->setSpacing(KDialog::spacingHint()); - QLabel *label = new QLabel(i18n("dictionary to not use","Do not use:"),this); + TQLabel *label = new TQLabel(i18n("dictionary to not use","Do not use:"),this); layout->addWidget(label,0,0); - label = new QLabel(i18n("dictionary to use","Use:"),this); + label = new TQLabel(i18n("dictionary to use","Use:"),this); layout->addWidget(label,0,2); unselectedBox = new KListBox(this,"unselectedBox"); layout->addWidget(unselectedBox,1,0); - QVBoxLayout *bLayout = new QVBoxLayout(); - selectBtn = new QPushButton(" &>> ", this); + TQVBoxLayout *bLayout = new TQVBoxLayout(); + selectBtn = new TQPushButton(" &>> ", this); selectBtn->setEnabled(false); bLayout->addWidget(selectBtn); - unselectBtn = new QPushButton(" &<< ", this); + unselectBtn = new TQPushButton(" &<< ", this); unselectBtn->setEnabled(false); bLayout->addWidget(unselectBtn); bLayout->addStretch(); @@ -80,14 +80,14 @@ DictChooser::DictChooser(KBabelDictBox*b, QStringList selected layout->addWidget(selectedBox,1,2); - bLayout = new QVBoxLayout(); - upBtn = new QPushButton(i18n("Move &Up"), this); + bLayout = new TQVBoxLayout(); + upBtn = new TQPushButton(i18n("Move &Up"), this); upBtn->setEnabled(false); bLayout->addWidget(upBtn); - downBtn = new QPushButton(i18n("Move &Down"), this); + downBtn = new TQPushButton(i18n("Move &Down"), this); downBtn->setEnabled(false); bLayout->addWidget(downBtn); - configureBtn = new QPushButton(i18n("Con&figure..."), this); + configureBtn = new TQPushButton(i18n("Con&figure..."), this); bLayout->addWidget(configureBtn); bLayout->addStretch(); layout->addLayout(bLayout,1,3); @@ -95,7 +95,7 @@ DictChooser::DictChooser(KBabelDictBox*b, QStringList selected dictList.setAutoDelete(true); ModuleInfo *mi; - for(QStringList::Iterator it=selected.begin(); it!=selected.end(); + for(TQStringList::Iterator it=selected.begin(); it!=selected.end(); ++it) { for(mi = dictList.first(); mi != 0; mi = dictList.next()) @@ -122,17 +122,17 @@ DictChooser::DictChooser(KBabelDictBox*b, QStringList selected } - connect(selectedBox,SIGNAL(highlighted(int)), this - , SLOT(selectedMarked(int))); - connect(unselectedBox,SIGNAL(highlighted(int)), this - , SLOT(unselectedMarked(int))); + connect(selectedBox,TQT_SIGNAL(highlighted(int)), this + , TQT_SLOT(selectedMarked(int))); + connect(unselectedBox,TQT_SIGNAL(highlighted(int)), this + , TQT_SLOT(unselectedMarked(int))); - connect(selectBtn, SIGNAL(clicked()), this, SLOT(select())); - connect(unselectBtn, SIGNAL(clicked()), this, SLOT(unselect())); - connect(upBtn, SIGNAL(clicked()), this, SLOT(up())); - connect(downBtn, SIGNAL(clicked()), this, SLOT(down())); - connect(configureBtn,SIGNAL(clicked()), this - , SLOT(configureSelected())); + connect(selectBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(select())); + connect(unselectBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(unselect())); + connect(upBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(up())); + connect(downBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(down())); + connect(configureBtn,TQT_SIGNAL(clicked()), this + , TQT_SLOT(configureSelected())); selectedBox->installEventFilter(this); @@ -144,13 +144,13 @@ DictChooser::DictChooser(KBabelDictBox*b, QStringList selected } -QStringList DictChooser::selectedDicts() +TQStringList DictChooser::selectedDicts() { - QStringList selected; + TQStringList selected; for(int i = 0; i < (int)selectedBox->count(); i++) { - QString text = selectedBox->text(i); + TQString text = selectedBox->text(i); ModuleInfo *mi; for(mi = dictList.first(); mi!=0; mi = dictList.next()) @@ -192,7 +192,7 @@ void DictChooser::select() int i = unselectedBox->currentItem(); if(i >= 0) { - QString text = unselectedBox->text(i); + TQString text = unselectedBox->text(i); selectedBox->insertItem(text); unselectedBox->removeItem(i); @@ -214,7 +214,7 @@ void DictChooser::unselect() int i = selectedBox->currentItem(); if(i >= 0 && selectedBox->count() > 1) { - QString text = selectedBox->text(i); + TQString text = selectedBox->text(i); unselectedBox->insertItem(text); selectedBox->removeItem(i); @@ -236,7 +236,7 @@ void DictChooser::up() int i = selectedBox->currentItem(); if(i > 0) { - QString text = selectedBox->text(i); + TQString text = selectedBox->text(i); selectedBox->changeItem(selectedBox->text(i-1),i); selectedBox->changeItem(text,i-1); selectedBox->setSelected(i-1,true); @@ -249,7 +249,7 @@ void DictChooser::down() int i = selectedBox->currentItem(); if(i < (int)selectedBox->count()-1) { - QString text = selectedBox->text(i); + TQString text = selectedBox->text(i); selectedBox->changeItem(selectedBox->text(i+1),i); selectedBox->changeItem(text,i+1); selectedBox->setSelected(i+1,true); @@ -257,9 +257,9 @@ void DictChooser::down() } -bool DictChooser::eventFilter(QObject *object, QEvent *event) +bool DictChooser::eventFilter(TQObject *object, TQEvent *event) { - if(event->type() == QEvent::FocusIn) + if(event->type() == TQEvent::FocusIn) { if(object==selectedBox) { @@ -289,7 +289,7 @@ void DictChooser::configureSelected() { int ci = selectedBox->currentItem(); if( ci == -1 ) ci = 0; // there is always at least one item - QString module = selectedBox->text(ci); + TQString module = selectedBox->text(ci); ModuleInfo *mi; for(mi = dictList.first(); mi!=0; mi = dictList.next()) @@ -320,7 +320,7 @@ void DictChooser::restoreConfig() { kdDebug( KBABEL_SEARCH ) << "Cleanup" << endl; // cleanup - QDictIterator<KTempFile> it( tempConfig ); // See QDictIterator + TQDictIterator<KTempFile> it( tempConfig ); // See QDictIterator for( ; it.current(); ++it ) { KConfig config( it.current()->name() ); diff --git a/kbabel/kbabeldict/dictchooser.h b/kbabel/kbabeldict/dictchooser.h index 2b757455..c5740d33 100644 --- a/kbabel/kbabeldict/dictchooser.h +++ b/kbabel/kbabeldict/dictchooser.h @@ -35,9 +35,9 @@ #ifndef DICTCHOOSER_H #define DICTCHOOSER_H -#include <qptrlist.h> -#include <qstringlist.h> -#include <qwidget.h> +#include <tqptrlist.h> +#include <tqstringlist.h> +#include <tqwidget.h> #include <kbabeldictbox.h> class KListBox; @@ -52,17 +52,17 @@ class KDE_EXPORT DictChooser : public QWidget Q_OBJECT public: - DictChooser(KBabelDictBox* box, QStringList selected, - QWidget *parent , const char *name=0); + DictChooser(KBabelDictBox* box, TQStringList selected, + TQWidget *parent , const char *name=0); - QStringList selectedDicts(); + TQStringList selectedDicts(); /** If the user configured some of the modules, this * restores the original configuration of all these modules */ void restoreConfig(); - virtual bool eventFilter(QObject *, QEvent *); + virtual bool eventFilter(TQObject *, TQEvent *); private slots: void select(); @@ -77,18 +77,18 @@ private slots: private: KBabelDictBox* box; - QPtrList<ModuleInfo> dictList; + TQPtrList<ModuleInfo> dictList; KListBox *selectedBox; KListBox *unselectedBox; - QPushButton *selectBtn; - QPushButton *unselectBtn; - QPushButton *upBtn; - QPushButton *downBtn; - QPushButton *configureBtn; + TQPushButton *selectBtn; + TQPushButton *unselectBtn; + TQPushButton *upBtn; + TQPushButton *downBtn; + TQPushButton *configureBtn; - QDict<KTempFile> tempConfig; + TQDict<KTempFile> tempConfig; }; #endif // DICTCHOOSER_H diff --git a/kbabel/kbabeldict/dictionarymenu.cpp b/kbabel/kbabeldict/dictionarymenu.cpp index 2ed57d5f..5d648697 100644 --- a/kbabel/kbabeldict/dictionarymenu.cpp +++ b/kbabel/kbabeldict/dictionarymenu.cpp @@ -36,11 +36,11 @@ #include <kdebug.h> #include <kshortcut.h> -#include <qsignalmapper.h> +#include <tqsignalmapper.h> DictionaryMenu::DictionaryMenu(KPopupMenu *popupMenu, KActionCollection *collection - , QObject *parent) - : QObject(parent, "dictionarymenu") + , TQObject *parent) + : TQObject(parent, "dictionarymenu") , popup(popupMenu) , actionCollection(collection) , maxId(10) @@ -50,12 +50,12 @@ DictionaryMenu::DictionaryMenu(KPopupMenu *popupMenu, KActionCollection *collect if(popup) { - connect(popup,SIGNAL(activated(int)),this,SLOT(activated(int))); + connect(popup,TQT_SIGNAL(activated(int)),this,TQT_SLOT(activated(int))); } - dictionaryMapper = new QSignalMapper( this ); - connect( dictionaryMapper, SIGNAL( mapped( int ) ), - this, SLOT( activated( int ) ) ); + dictionaryMapper = new TQSignalMapper( this ); + connect( dictionaryMapper, TQT_SIGNAL( mapped( int ) ), + this, TQT_SLOT( activated( int ) ) ); } @@ -68,7 +68,7 @@ void DictionaryMenu::clear() { if(popup) { - QIntDictIterator<QString> it( num2id ); // iterator for dict + TQIntDictIterator<TQString> it( num2id ); // iterator for dict while ( it.current() ) { popup->removeItem(it.currentKey()); @@ -80,49 +80,49 @@ void DictionaryMenu::clear() // create new mapper delete dictionaryMapper; - dictionaryMapper = new QSignalMapper( this ); - connect( dictionaryMapper, SIGNAL( mapped( int ) ), - this, SLOT( activated( int ) ) ); + dictionaryMapper = new TQSignalMapper( this ); + connect( dictionaryMapper, TQT_SIGNAL( mapped( int ) ), + this, TQT_SLOT( activated( int ) ) ); } -void DictionaryMenu::add(const QString& name, const QString& moduleId) +void DictionaryMenu::add(const TQString& name, const TQString& moduleId) { if(popup) { - KAction* dictionaryAction = new KAction( name, 0, dictionaryMapper, SLOT(map()), actionCollection, moduleId.utf8() ); + KAction* dictionaryAction = new KAction( name, 0, dictionaryMapper, TQT_SLOT(map()), actionCollection, moduleId.utf8() ); uint id = maxId++; dictionaryAction->plug(popup, id); dictionaryMapper->setMapping( dictionaryAction, id ); - QString *idString = new QString(moduleId); + TQString *idString = new TQString(moduleId); num2id.insert(id,idString); } } -void DictionaryMenu::add(const QString& n, const QString& moduleId - , const QString& key) +void DictionaryMenu::add(const TQString& n, const TQString& moduleId + , const TQString& key) { if(popup) { - QString name=n; + TQString name=n; - QString keyString=key; + TQString keyString=key; if(keyString.contains("%1")) { keyString=key.arg(accel2id.count()+1); } KShortcut k(keyString); - KAction* dictionaryAction = new KAction( name, k, dictionaryMapper, SLOT(map()), actionCollection, key.arg(moduleId).utf8() ); + KAction* dictionaryAction = new KAction( name, k, dictionaryMapper, TQT_SLOT(map()), actionCollection, key.arg(moduleId).utf8() ); uint id = maxId++; dictionaryAction->plug(popup,id); if(!k.isNull()) { - QString *idString = new QString(moduleId); + TQString *idString = new TQString(moduleId); accel2id.insert(id,idString); dictionaryMapper->setMapping( dictionaryAction, id ); @@ -135,7 +135,7 @@ void DictionaryMenu::add(const QString& n, const QString& moduleId kdWarning() << "key not valid" << endl; } - QString *idString = new QString(moduleId); + TQString *idString = new TQString(moduleId); num2id.insert(id,idString); } } @@ -143,7 +143,7 @@ void DictionaryMenu::add(const QString& n, const QString& moduleId void DictionaryMenu::activated(int id) { - QString *idString = num2id[id]; + TQString *idString = num2id[id]; if(idString) { diff --git a/kbabel/kbabeldict/dictionarymenu.h b/kbabel/kbabeldict/dictionarymenu.h index c688508e..c520501a 100644 --- a/kbabel/kbabeldict/dictionarymenu.h +++ b/kbabel/kbabeldict/dictionarymenu.h @@ -33,10 +33,10 @@ #ifndef DICTIONARYMENU_H #define DICTIONARYMENU_H -#include <qintdict.h> -#include <qobject.h> -#include <qstringlist.h> -#include <qguardedptr.h> +#include <tqintdict.h> +#include <tqobject.h> +#include <tqstringlist.h> +#include <tqguardedptr.h> #include <kdemacros.h> class QSignalMapper; @@ -48,31 +48,31 @@ class KDE_EXPORT DictionaryMenu : public QObject Q_OBJECT public: - DictionaryMenu(KPopupMenu *menu, KActionCollection *collection, QObject *parent=0); + DictionaryMenu(KPopupMenu *menu, KActionCollection *collection, TQObject *parent=0); ~DictionaryMenu(); - void add(const QString& name,const QString& id); + void add(const TQString& name,const TQString& id); /** * Adds an item to this menu and to the keyboard accelerator. * If key contains %1 it is replaced with a number 1-9 */ - void add(const QString& name,const QString& id, const QString& key); + void add(const TQString& name,const TQString& id, const TQString& key); void clear(); signals: - void activated(const QString moduleId); + void activated(const TQString moduleId); private slots: void activated(int); private: - QGuardedPtr<KPopupMenu> popup; - QGuardedPtr<KActionCollection> actionCollection; - QIntDict<QString> num2id; - QIntDict<QString> accel2id; - QSignalMapper* dictionaryMapper; + TQGuardedPtr<KPopupMenu> popup; + TQGuardedPtr<KActionCollection> actionCollection; + TQIntDict<TQString> num2id; + TQIntDict<TQString> accel2id; + TQSignalMapper* dictionaryMapper; uint maxId; }; diff --git a/kbabel/kbabeldict/kbabeldict.cpp b/kbabel/kbabeldict/kbabeldict.cpp index ebb68227..cae04d07 100644 --- a/kbabel/kbabeldict/kbabeldict.cpp +++ b/kbabel/kbabeldict/kbabeldict.cpp @@ -47,13 +47,13 @@ KBabelDict::KBabelDict() , i18n("About"), i18n("About Module") , i18n("Hide Sett&ings")) { - connect(this, SIGNAL(closeClicked()),this,SLOT(saveConfig())); - connect(this, SIGNAL(closeClicked()),this,SLOT(quit())); + connect(this, TQT_SIGNAL(closeClicked()),this,TQT_SLOT(saveConfig())); + connect(this, TQT_SIGNAL(closeClicked()),this,TQT_SLOT(quit())); view = new KBabelDictView(this); - connect(this, SIGNAL(user1Clicked()), view, SLOT(about())); - connect(this, SIGNAL(user2Clicked()), view, SLOT(aboutModule())); - connect(this, SIGNAL(user3Clicked()), this, SLOT(togglePref())); + connect(this, TQT_SIGNAL(user1Clicked()), view, TQT_SLOT(about())); + connect(this, TQT_SIGNAL(user2Clicked()), view, TQT_SLOT(aboutModule())); + connect(this, TQT_SIGNAL(user3Clicked()), this, TQT_SLOT(togglePref())); // HACK: hide default button, otherwise it would be Help button showButtonOK(false); diff --git a/kbabel/kbabeldict/kbabeldictbox.cpp b/kbabel/kbabeldict/kbabeldictbox.cpp index 2beed684..f6ca948f 100644 --- a/kbabel/kbabeldict/kbabeldictbox.cpp +++ b/kbabel/kbabeldict/kbabeldictbox.cpp @@ -58,17 +58,17 @@ #include <ktrader.h> #include <kwin.h> -#include <qclipboard.h> -#include <qdir.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpopupmenu.h> -#include <qpushbutton.h> -#include <qtextview.h> -#include <qstylesheet.h> -#include <qtoolbutton.h> -#include <qwhatsthis.h> -#include <qtimer.h> +#include <tqclipboard.h> +#include <tqdir.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpopupmenu.h> +#include <tqpushbutton.h> +#include <tqtextview.h> +#include <tqstylesheet.h> +#include <tqtoolbutton.h> +#include <tqwhatsthis.h> +#include <tqtimer.h> #define KBABELDICT 5321 @@ -77,9 +77,9 @@ using namespace KBabel; class ResultListItem : public QListViewItem { public: - ResultListItem(QListView *parent, const SearchResult& result,bool richText); + ResultListItem(TQListView *parent, const SearchResult& result,bool richText); - virtual QString key(int column, bool ascending) const; + virtual TQString key(int column, bool ascending) const; const SearchResult* result() const; bool richText() const { return _richText; } @@ -88,9 +88,9 @@ private: bool _richText; }; -ResultListItem::ResultListItem(QListView *parent, const SearchResult& result +ResultListItem::ResultListItem(TQListView *parent, const SearchResult& result , bool richText) - : QListViewItem(parent) + : TQListViewItem(parent) , _result(result) , _richText(richText) { @@ -99,9 +99,9 @@ ResultListItem::ResultListItem(QListView *parent, const SearchResult& result score=0; else if(score>100) score=100; - setText(0,QString::number(score)); + setText(0,TQString::number(score)); - QString tmp; + TQString tmp; if(richText) tmp=_result.plainFound; else @@ -160,17 +160,17 @@ ResultListItem::ResultListItem(QListView *parent, const SearchResult& result } -QString ResultListItem::key(int column, bool ascending) const +TQString ResultListItem::key(int column, bool ascending) const { if(column==0) { - QString result=QString::number(_result.score); + TQString result=TQString::number(_result.score); result=result.rightJustify(10,'0'); return result; } - return QListViewItem::key(column,ascending); + return TQListViewItem::key(column,ascending); } const SearchResult *ResultListItem::result() const @@ -182,8 +182,8 @@ const SearchResult *ResultListItem::result() const * Constructs a KBabelDictBox which is a child of 'parent', with the * name 'name' and widget flags set to 'f' */ -KBabelDictBox::KBabelDictBox( QWidget* parent, const char* name, WFlags fl ) - : DCOPObject("KBabelDict"), QWidget( parent, name, fl ) +KBabelDictBox::KBabelDictBox( TQWidget* parent, const char* name, WFlags fl ) + : DCOPObject("KBabelDict"), TQWidget( parent, name, fl ) { active=-1; currentResult=0; @@ -191,39 +191,39 @@ KBabelDictBox::KBabelDictBox( QWidget* parent, const char* name, WFlags fl ) moduleList.setAutoDelete(false); - QVBoxLayout *mainLayout = new QVBoxLayout(this); + TQVBoxLayout *mainLayout = new TQVBoxLayout(this); mainLayout->setMargin(KDialog::marginHint()); mainLayout->setSpacing(KDialog::spacingHint()); - QGridLayout *grid = new QGridLayout(mainLayout); + TQGridLayout *grid = new TQGridLayout(mainLayout); - QHBoxLayout *hbox = new QHBoxLayout; - QLabel *label = new QLabel(i18n("Total:"),this); + TQHBoxLayout *hbox = new QHBoxLayout; + TQLabel *label = new TQLabel(i18n("Total:"),this); hbox->addWidget(label); - totalResultsLabel = new QLabel("0",this); + totalResultsLabel = new TQLabel("0",this); hbox->addWidget(totalResultsLabel); grid->addLayout(hbox,0,0); hbox = new QHBoxLayout; - label = new QLabel(i18n("Current:"), this); + label = new TQLabel(i18n("Current:"), this); hbox->addWidget(label); - currentLabel = new QLabel("0",this); + currentLabel = new TQLabel("0",this); hbox->addWidget(currentLabel); grid->addLayout(hbox,1,0); hbox = new QHBoxLayout; - label = new QLabel(i18n("Found in:"), this); + label = new TQLabel(i18n("Found in:"), this); hbox->addWidget(label); - locationLabel = new QLabel(this); + locationLabel = new TQLabel(this); hbox->addWidget(locationLabel); hbox->setStretchFactor(locationLabel,2); grid->addLayout(hbox,0,1); hbox = new QHBoxLayout; - label = new QLabel(i18n("Translator:"), this); + label = new TQLabel(i18n("Translator:"), this); hbox->addWidget(label); - translatorLabel = new QLabel(this); + translatorLabel = new TQLabel(this); translatorLabel->setMinimumSize(50,0); hbox->addWidget(translatorLabel); hbox->setStretchFactor(translatorLabel,2); @@ -233,14 +233,14 @@ KBabelDictBox::KBabelDictBox( QWidget* parent, const char* name, WFlags fl ) hbox = new QHBoxLayout; - label = new QLabel(i18n("Date:"),this); + label = new TQLabel(i18n("Date:"),this); hbox->addWidget(label); - dateLabel = new QLabel(this); + dateLabel = new TQLabel(this); dateLabel->setMinimumSize(50,0); hbox->addWidget(dateLabel); hbox->setStretchFactor(dateLabel,2); - moreButton = new QPushButton(this,"moreButton"); + moreButton = new TQPushButton(this,"moreButton"); moreButton->setText(i18n("&More")); moreButton->setEnabled(false); moreButton->setAutoRepeat(true); @@ -251,33 +251,33 @@ KBabelDictBox::KBabelDictBox( QWidget* parent, const char* name, WFlags fl ) hbox = new QHBoxLayout; hbox->addStretch(1); - listButton = new QToolButton(Qt::UpArrow,this); + listButton = new TQToolButton(Qt::UpArrow,this); listButton->setFixedSize(20,15); listButton->setAutoRepeat(false); - connect(listButton,SIGNAL(clicked()),this,SLOT(showListOnly())); + connect(listButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(showListOnly())); hbox->addWidget(listButton); - detailButton = new QToolButton(Qt::DownArrow,this); + detailButton = new TQToolButton(Qt::DownArrow,this); detailButton->setFixedSize(20,15); detailButton->setAutoRepeat(false); - connect(detailButton,SIGNAL(clicked()),this,SLOT(showDetailsOnly())); + connect(detailButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(showDetailsOnly())); hbox->addWidget(detailButton); mainLayout->addLayout(hbox); - resultSplitter = new QSplitter(Qt::Vertical,this + resultSplitter = new TQSplitter(Qt::Vertical,this ,"resultsplitter"); mainLayout->addWidget(resultSplitter); - viewContainer = new QSplitter(Qt::Vertical,resultSplitter, "singleEntrySplitter"); - QVBoxLayout *vbox = new QVBoxLayout(viewContainer); - vbox->setResizeMode(QLayout::FreeResize); - origView = new QTextView(viewContainer,"origView"); - origView->setWordWrap( QTextEdit::WidgetWidth ); + viewContainer = new TQSplitter(Qt::Vertical,resultSplitter, "singleEntrySplitter"); + TQVBoxLayout *vbox = new TQVBoxLayout(viewContainer); + vbox->setResizeMode(TQLayout::FreeResize); + origView = new TQTextView(viewContainer,"origView"); + origView->setWordWrap( TQTextEdit::WidgetWidth ); origView->setMinimumSize(1,1); vbox->addWidget(origView); - translationView = new QTextView(viewContainer,"translationView"); - origView->setWordWrap( QTextEdit::WidgetWidth ); + translationView = new TQTextView(viewContainer,"translationView"); + origView->setWordWrap( TQTextEdit::WidgetWidth ); translationView->setMinimumSize(1,1); vbox->addWidget(translationView); viewContainer->setMinimumSize(1,1); @@ -291,17 +291,17 @@ KBabelDictBox::KBabelDictBox( QWidget* parent, const char* name, WFlags fl ) resultListView->installEventFilter(this); connect(resultListView - , SIGNAL(doubleClicked(QListViewItem *,const QPoint&,int)) - , this, SLOT(editFile())); - connect(resultListView, SIGNAL(returnPressed(QListViewItem *)) - , this, SLOT(editFile())); + , TQT_SIGNAL(doubleClicked(TQListViewItem *,const TQPoint&,int)) + , this, TQT_SLOT(editFile())); + connect(resultListView, TQT_SIGNAL(returnPressed(TQListViewItem *)) + , this, TQT_SLOT(editFile())); connect(resultListView - , SIGNAL(contextMenu(KListView *,QListViewItem *,const QPoint&)) + , TQT_SIGNAL(contextMenu(KListView *,TQListViewItem *,const TQPoint&)) , this - , SLOT(showContextMenu(KListView *,QListViewItem *,const QPoint&))); + , TQT_SLOT(showContextMenu(KListView *,TQListViewItem *,const TQPoint&))); - resultSplitter->setResizeMode(viewContainer,QSplitter::KeepSize); - QValueList<int> sizes; + resultSplitter->setResizeMode(viewContainer,TQSplitter::KeepSize); + TQValueList<int> sizes; sizes.append(50); sizes.append(50); resultSplitter->setSizes(sizes); @@ -310,12 +310,12 @@ KBabelDictBox::KBabelDictBox( QWidget* parent, const char* name, WFlags fl ) hbox = new QHBoxLayout; hbox->addStretch(1); - prevButton = new QPushButton(i18n("< &Previous"),this); + prevButton = new TQPushButton(i18n("< &Previous"),this); prevButton->setEnabled(false); prevButton->setAutoRepeat(true); hbox->addWidget(prevButton); - nextButton = new QPushButton(i18n("&Next >"),this); + nextButton = new TQPushButton(i18n("&Next >"),this); nextButton->setEnabled(false); nextButton->setAutoRepeat(true); hbox->addWidget(nextButton); @@ -330,21 +330,21 @@ KBabelDictBox::KBabelDictBox( QWidget* parent, const char* name, WFlags fl ) currentLabel->setFixedSize(currentLabel->sizeHint()); currentLabel->setNum(0); - setRMBMenu(new QPopupMenu(this)); - QStringList fileList; + setRMBMenu(new TQPopupMenu(this)); + TQStringList fileList; #if 0 // try to find installed modules by looking into directories // kbabeldict/modules and getting all files *.rc - QStringList dirList = KGlobal::dirs()->findDirs("data" + TQStringList dirList = KGlobal::dirs()->findDirs("data" ,"kbabeldict/modules"); - for ( QStringList::Iterator it = dirList.begin(); it != dirList.end() + for ( TQStringList::Iterator it = dirList.begin(); it != dirList.end() ; ++it ) { - QDir dir((*it),"*.rc"); - QStringList list = dir.entryList(QDir::Files|QDir::Readable); + TQDir dir((*it),"*.rc"); + TQStringList list = dir.entryList(TQDir::Files|TQDir::Readable); - for ( QStringList::Iterator fit = list.begin(); fit != list.end() + for ( TQStringList::Iterator fit = list.begin(); fit != list.end() ; ++fit ) { if(!fileList.contains((*fit))) @@ -357,28 +357,28 @@ KBabelDictBox::KBabelDictBox( QWidget* parent, const char* name, WFlags fl ) // use locate to locate the actual file, because rcfiles in the users // directory is prefered for systemwide rc files - QStringList rcList; - for( QStringList::Iterator fit = fileList.begin(); fit != fileList.end(); + TQStringList rcList; + for( TQStringList::Iterator fit = fileList.begin(); fit != fileList.end(); ++fit) { rcList.append(locate("data","kbabeldict/modules/"+(*fit))); } - for( QStringList::Iterator rit = rcList.begin(); rit != rcList.end(); + for( TQStringList::Iterator rit = rcList.begin(); rit != rcList.end(); ++rit) { KConfig rcConfig((*rit),true,false); rcConfig.setGroup("SearchEngine"); - QStringList appList = rcConfig.readListEntry("Applications"); + TQStringList appList = rcConfig.readListEntry("Applications"); KInstance *inst = KGlobal::instance(); if(inst && !appList.isEmpty() && !appList.contains(inst->instanceName())) { continue; } - QString libName = rcConfig.readEntry("Lib"); + TQString libName = rcConfig.readEntry("Lib"); if(!libName.isNull()) { @@ -464,9 +464,9 @@ KBabelDictBox::KBabelDictBox( QWidget* parent, const char* name, WFlags fl ) } } - connect(nextButton,SIGNAL(clicked()),this,SLOT(slotNextResult())); - connect(prevButton,SIGNAL(clicked()),this,SLOT(slotPrevResult())); - connect(moreButton,SIGNAL(clicked()),this,SLOT(nextInfo())); + connect(nextButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotNextResult())); + connect(prevButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(slotPrevResult())); + connect(moreButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(nextInfo())); origView->installEventFilter(this); @@ -475,8 +475,8 @@ KBabelDictBox::KBabelDictBox( QWidget* parent, const char* name, WFlags fl ) resultListView->setSorting(0,false); resultListView->setAllColumnsShowFocus(true); - connect(resultListView,SIGNAL(selectionChanged(QListViewItem*)) - , this, SLOT(showResult(QListViewItem*))); + connect(resultListView,TQT_SIGNAL(selectionChanged(TQListViewItem*)) + , this, TQT_SLOT(showResult(TQListViewItem*))); } /* @@ -490,18 +490,18 @@ void KBabelDictBox::registerModule( SearchEngine* e ) { active = 0; moduleList.append(e); - connect(e, SIGNAL(started()),this,SIGNAL(searchStarted())); - connect(e, SIGNAL(finished()),this,SIGNAL(searchStopped())); - connect(e, SIGNAL(finished()),this - ,SLOT(clearModuleResults())); - connect(e, SIGNAL(progress(int)),this,SIGNAL(progressed(int))); - connect(e, SIGNAL(progressStarts(const QString&)),this - , SIGNAL(progressStarts(const QString&))); - connect(e, SIGNAL(progressEnds()),this,SIGNAL(progressEnds())); - connect(e, SIGNAL(resultFound(const SearchResult*)), this - , SLOT(addResult(const SearchResult*))); - connect(e, SIGNAL(hasError(const QString&)), this - , SIGNAL(errorInModule(const QString&))); + connect(e, TQT_SIGNAL(started()),this,TQT_SIGNAL(searchStarted())); + connect(e, TQT_SIGNAL(finished()),this,TQT_SIGNAL(searchStopped())); + connect(e, TQT_SIGNAL(finished()),this + ,TQT_SLOT(clearModuleResults())); + connect(e, TQT_SIGNAL(progress(int)),this,TQT_SIGNAL(progressed(int))); + connect(e, TQT_SIGNAL(progressStarts(const TQString&)),this + , TQT_SIGNAL(progressStarts(const TQString&))); + connect(e, TQT_SIGNAL(progressEnds()),this,TQT_SIGNAL(progressEnds())); + connect(e, TQT_SIGNAL(resultFound(const SearchResult*)), this + , TQT_SLOT(addResult(const SearchResult*))); + connect(e, TQT_SIGNAL(hasError(const TQString&)), this + , TQT_SIGNAL(errorInModule(const TQString&))); } void KBabelDictBox::saveSettings(KConfigBase *config) @@ -527,7 +527,7 @@ void KBabelDictBox::saveSettings(KConfigBase *config) } -void KBabelDictBox::saveSettings(const QString& moduleId, KConfigBase *config) +void KBabelDictBox::saveSettings(const TQString& moduleId, KConfigBase *config) { SearchEngine *e; @@ -545,11 +545,11 @@ void KBabelDictBox::readSettings(KConfigBase *config) { SearchEngine *e; KConfigGroupSaver cs(config,"KBabelDict"); - QValueList<int> sizes=config->readIntListEntry("ResultSplitter"); + TQValueList<int> sizes=config->readIntListEntry("ResultSplitter"); if(!sizes.isEmpty()) resultSplitter->setSizes(sizes); - QString m = config->readEntry("ActiveModule"); + TQString m = config->readEntry("ActiveModule"); if(!m.isEmpty()) { setActiveModule(m); @@ -562,7 +562,7 @@ void KBabelDictBox::readSettings(KConfigBase *config) } } -void KBabelDictBox::readSettings(const QString& moduleId, KConfigBase *config) +void KBabelDictBox::readSettings(const TQString& moduleId, KConfigBase *config) { SearchEngine *e; @@ -626,7 +626,7 @@ void KBabelDictBox::setActiveModule(int a) } } -void KBabelDictBox::setActiveModule(QString id) +void KBabelDictBox::setActiveModule(TQString id) { SearchEngine *e; @@ -647,7 +647,7 @@ void KBabelDictBox::setActiveModule(QString id) /* * public slot */ -void KBabelDictBox::startSearch(const QString text) +void KBabelDictBox::startSearch(const TQString text) { clear(); SearchEngine *engine = moduleList.at(active); @@ -661,8 +661,8 @@ void KBabelDictBox::startSearch(const QString text) if(engine->isSearching()) { engine->stopSearch(); - connect(this, SIGNAL(searchStopped()), this - , SLOT(startDelayedSearch())); + connect(this, TQT_SIGNAL(searchStopped()), this + , TQT_SLOT(startDelayedSearch())); searchText=text; } @@ -673,7 +673,7 @@ void KBabelDictBox::startSearch(const QString text) /* * public slot */ -void KBabelDictBox::startTranslationSearch(const QString text) +void KBabelDictBox::startTranslationSearch(const TQString text) { clear(); SearchEngine *engine = moduleList.at(active); @@ -687,8 +687,8 @@ void KBabelDictBox::startTranslationSearch(const QString text) if(engine->isSearching()) { engine->stopSearch(); - connect(this, SIGNAL(searchStopped()), this - , SLOT(startDelayedTranslationSearch())); + connect(this, TQT_SIGNAL(searchStopped()), this + , TQT_SLOT(startDelayedTranslationSearch())); searchText=text; } @@ -696,7 +696,7 @@ void KBabelDictBox::startTranslationSearch(const QString text) } } -void KBabelDictBox::startDelayedSearch(const QString text) +void KBabelDictBox::startDelayedSearch(const TQString text) { clear(); SearchEngine *engine = moduleList.at(active); @@ -713,18 +713,18 @@ void KBabelDictBox::startDelayedSearch(const QString text) { engine->stopSearch(); - connect(this, SIGNAL(searchStopped()), this - , SLOT(startDelayedSearch())); + connect(this, TQT_SIGNAL(searchStopped()), this + , TQT_SLOT(startDelayedSearch())); } else { - QTimer::singleShot(5,this,SLOT(startDelayedSearch())); + TQTimer::singleShot(5,this,TQT_SLOT(startDelayedSearch())); } } } -void KBabelDictBox::startDelayedTranslationSearch(const QString text) +void KBabelDictBox::startDelayedTranslationSearch(const TQString text) { clear(); SearchEngine *engine = moduleList.at(active); @@ -741,25 +741,25 @@ void KBabelDictBox::startDelayedTranslationSearch(const QString text) { engine->stopSearch(); - connect(this, SIGNAL(searchStopped()), this - , SLOT(startDelayedTranslationSearch())); + connect(this, TQT_SIGNAL(searchStopped()), this + , TQT_SLOT(startDelayedTranslationSearch())); } else { - QTimer::singleShot(5,this,SLOT(startDelayedTranslationSearch())); + TQTimer::singleShot(5,this,TQT_SLOT(startDelayedTranslationSearch())); } } } -QString KBabelDictBox::translate(const QString text) +TQString KBabelDictBox::translate(const TQString text) { SearchEngine *engine = moduleList.at(active); if(!engine) { kdDebug(KBABELDICT) << "no module available" << endl; - return QString::null; + return TQString::null; } else { @@ -772,14 +772,14 @@ QString KBabelDictBox::translate(const QString text) } } -QString KBabelDictBox::fuzzyTranslation(const QString text, int &score) +TQString KBabelDictBox::fuzzyTranslation(const TQString text, int &score) { SearchEngine *engine = moduleList.at(active); if(!engine) { kdDebug(KBABELDICT) << "no module available" << endl; - return QString::null; + return TQString::null; } else { @@ -792,14 +792,14 @@ QString KBabelDictBox::fuzzyTranslation(const QString text, int &score) } } -QString KBabelDictBox::searchTranslation(const QString text, int &score) +TQString KBabelDictBox::searchTranslation(const TQString text, int &score) { SearchEngine *engine = moduleList.at(active); if(!engine) { kdDebug(KBABELDICT) << "no module available" << endl; - return QString::null; + return TQString::null; } else { @@ -824,8 +824,8 @@ void KBabelDictBox::startDelayedSearch() } else { - disconnect(this, SIGNAL(searchStopped()), this - , SLOT(startDelayedSearch())); + disconnect(this, TQT_SIGNAL(searchStopped()), this + , TQT_SLOT(startDelayedSearch())); engine->startSearch(searchText); @@ -844,8 +844,8 @@ void KBabelDictBox::startDelayedTranslationSearch() } else { - disconnect(this, SIGNAL(searchStopped()), this - , SLOT(startDelayedTranslationSearch())); + disconnect(this, TQT_SIGNAL(searchStopped()), this + , TQT_SLOT(startDelayedTranslationSearch())); engine->startSearchInTranslation(searchText); @@ -884,9 +884,9 @@ bool KBabelDictBox::isSearching() } -QStringList KBabelDictBox::moduleNames() +TQStringList KBabelDictBox::moduleNames() { - QStringList list; + TQStringList list; SearchEngine *e; for(e = moduleList.first(); e != 0; e = moduleList.next()) @@ -897,9 +897,9 @@ QStringList KBabelDictBox::moduleNames() return list; } -QStringList KBabelDictBox::modules() +TQStringList KBabelDictBox::modules() { - QStringList list; + TQStringList list; SearchEngine *e; for(e = moduleList.first(); e != 0; e = moduleList.next()) @@ -910,9 +910,9 @@ QStringList KBabelDictBox::modules() return list; } -QPtrList<ModuleInfo> KBabelDictBox::moduleInfos() +TQPtrList<ModuleInfo> KBabelDictBox::moduleInfos() { - QPtrList<ModuleInfo> list; + TQPtrList<ModuleInfo> list; SearchEngine *e; for(e = moduleList.first(); e != 0; e = moduleList.next()) @@ -929,9 +929,9 @@ QPtrList<ModuleInfo> KBabelDictBox::moduleInfos() } -QPtrList<PrefWidget> KBabelDictBox::modPrefWidgets(QWidget *parent) +TQPtrList<PrefWidget> KBabelDictBox::modPrefWidgets(TQWidget *parent) { - QPtrList<PrefWidget> list; + TQPtrList<PrefWidget> list; list.setAutoDelete(false); SearchEngine *e; @@ -945,7 +945,7 @@ QPtrList<PrefWidget> KBabelDictBox::modPrefWidgets(QWidget *parent) } -void KBabelDictBox::showResult(QListViewItem *item) +void KBabelDictBox::showResult(TQListViewItem *item) { ResultListItem *resultItem = static_cast<ResultListItem*>(item); @@ -979,14 +979,14 @@ void KBabelDictBox::showResult(QListViewItem *item) else { // FIXME: what about plural forms? - origView->setText(QStyleSheet::convertFromPlainText(result->found.first())); + origView->setText(TQStyleSheet::convertFromPlainText(result->found.first())); translationView->setText( - QStyleSheet::convertFromPlainText(result->translation)); + TQStyleSheet::convertFromPlainText(result->translation)); } if(result->descriptions.count() > 0) { - QPtrListIterator<TranslationInfo> it(result->descriptions); + TQPtrListIterator<TranslationInfo> it(result->descriptions); TranslationInfo *info=it.current(); if(info) { @@ -1030,7 +1030,7 @@ void KBabelDictBox::showResult(QListViewItem *item) moreButton->setEnabled((result->descriptions.count() > 1)); - currentLabel->setText(QString::number(currentResult+1)); + currentLabel->setText(TQString::number(currentResult+1)); prevButton->setEnabled(currentResult > 0); nextButton->setEnabled(currentResult+1 < total); @@ -1040,7 +1040,7 @@ void KBabelDictBox::showResult(QListViewItem *item) void KBabelDictBox::nextResult() { - QListViewItem *item=resultListView->selectedItem(); + TQListViewItem *item=resultListView->selectedItem(); if(item) { item=item->itemBelow(); @@ -1054,7 +1054,7 @@ void KBabelDictBox::nextResult() void KBabelDictBox::prevResult() { - QListViewItem *item=resultListView->selectedItem(); + TQListViewItem *item=resultListView->selectedItem(); if(item) { item=item->itemAbove(); @@ -1077,7 +1077,7 @@ void KBabelDictBox::addResult(const SearchResult* result) return; } - QListViewItem *item=resultListView->selectedItem(); + TQListViewItem *item=resultListView->selectedItem(); int index=0; if(item) { @@ -1086,7 +1086,7 @@ void KBabelDictBox::addResult(const SearchResult* result) new ResultListItem(resultListView, *result,e->usesRichTextResults()); total++; - totalResultsLabel->setText(QString::number(total)); + totalResultsLabel->setText(TQString::number(total)); if(total==1) { @@ -1108,8 +1108,8 @@ void KBabelDictBox::clear() dateLabel->setText(""); locationLabel->setText(""); translatorLabel->setText(""); - currentLabel->setText(QString::number(0)); - totalResultsLabel->setText(QString::number(0)); + currentLabel->setText(TQString::number(0)); + totalResultsLabel->setText(TQString::number(0)); origView->setText(""); translationView->setText(""); currentResult=0; @@ -1150,13 +1150,13 @@ void KBabelDictBox::nextInfo() TranslationInfo *info; if(currentInfo == (int)result->descriptions.count()) { - QPtrListIterator<TranslationInfo> it(result->descriptions); + TQPtrListIterator<TranslationInfo> it(result->descriptions); info = it.current(); currentInfo = 0; } else { - QPtrListIterator<TranslationInfo> it(result->descriptions); + TQPtrListIterator<TranslationInfo> it(result->descriptions); for(int i=0; i < currentInfo; i++) { ++it; @@ -1199,7 +1199,7 @@ void KBabelDictBox::nextInfo() void KBabelDictBox::showListOnly() { int h=resultSplitter->height(); - QValueList<int> sizes; + TQValueList<int> sizes; sizes.append(1); sizes.append(h-1); resultSplitter->setSizes(sizes); @@ -1208,7 +1208,7 @@ void KBabelDictBox::showListOnly() void KBabelDictBox::showDetailsOnly() { int h=resultSplitter->height(); - QValueList<int> sizes; + TQValueList<int> sizes; sizes.append(h-1); sizes.append(h); resultSplitter->setSizes(sizes); @@ -1234,7 +1234,7 @@ void KBabelDictBox::about() if(aboutData) { - QString text = aboutData->programName() + " " + + TQString text = aboutData->programName() + " " + aboutData->version() + "\n"; text += "\n"+aboutData->shortDescription()+"\n"; @@ -1258,7 +1258,7 @@ void KBabelDictBox::about() .arg(aboutData->bugAddress()) +"\n"; } - QLabel *label = new QLabel(text,0); + TQLabel *label = new TQLabel(text,0); page->addWidget(label); int authorCount = aboutData->authors().count(); @@ -1269,10 +1269,10 @@ void KBabelDictBox::about() else text=i18n("Authors:"); - label = new QLabel(text,0); + label = new TQLabel(text,0); page->addWidget(label); - QValueList<KAboutPerson>::ConstIterator it; + TQValueList<KAboutPerson>::ConstIterator it; for(it = aboutData->authors().begin(); it != aboutData->authors().end(); ++it) { @@ -1284,10 +1284,10 @@ void KBabelDictBox::about() if(creditsCount) { text = i18n("Thanks to:"); - label = new QLabel(text,0); + label = new TQLabel(text,0); page->addWidget(label); - QValueList<KAboutPerson>::ConstIterator it; + TQValueList<KAboutPerson>::ConstIterator it; for(it = aboutData->credits().begin(); it != aboutData->credits().end(); ++it) { @@ -1299,14 +1299,14 @@ void KBabelDictBox::about() } else { - QString text = i18n("No information available."); - QLabel *label = new QLabel(text,0); + TQString text = i18n("No information available."); + TQLabel *label = new TQLabel(text,0); page->addWidget(label); } } - aboutDlg->setInitialSize(QSize(400,1)); + aboutDlg->setInitialSize(TQSize(400,1)); aboutDlg->exec(); delete aboutDlg; @@ -1321,7 +1321,7 @@ void KBabelDictBox::aboutActiveModule() aboutModule(engine->id()); } -void KBabelDictBox::aboutModule(const QString& id) +void KBabelDictBox::aboutModule(const TQString& id) { SearchEngine *e; @@ -1360,12 +1360,12 @@ void KBabelDictBox::slotStopSearch() stopSearch(); } -void KBabelDictBox::slotStartSearch(const QString& text) +void KBabelDictBox::slotStartSearch(const TQString& text) { startSearch(text); } -void KBabelDictBox::setEditedPackage(const QString& name) +void KBabelDictBox::setEditedPackage(const TQString& name) { SearchEngine *e; @@ -1376,7 +1376,7 @@ void KBabelDictBox::setEditedPackage(const QString& name) } -void KBabelDictBox::setEditedFile(const QString& path) +void KBabelDictBox::setEditedFile(const TQString& path) { SearchEngine *e; @@ -1386,8 +1386,8 @@ void KBabelDictBox::setEditedFile(const QString& path) } } -void KBabelDictBox::setLanguage(const QString& languageCode, - const QString& languageName) +void KBabelDictBox::setLanguage(const TQString& languageCode, + const TQString& languageName) { SearchEngine *e; @@ -1415,11 +1415,11 @@ void KBabelDictBox::copy() } } -QString KBabelDictBox::translation() +TQString KBabelDictBox::translation() { - QString trans; + TQString trans; - QListViewItem *item=resultListView->selectedItem(); + TQListViewItem *item=resultListView->selectedItem(); if(item) { ResultListItem *r=static_cast<ResultListItem*>(item); @@ -1439,7 +1439,7 @@ QString KBabelDictBox::translation() return trans; } -void KBabelDictBox::setRMBMenu(QPopupMenu *popup) +void KBabelDictBox::setRMBMenu(TQPopupMenu *popup) { if(popup) { @@ -1447,7 +1447,7 @@ void KBabelDictBox::setRMBMenu(QPopupMenu *popup) popup->insertSeparator(); editFileIndex = popup->insertItem(i18n("Edit File") - , this, SLOT(editFile())); + , this, TQT_SLOT(editFile())); popup->setItemEnabled(editFileIndex,false); KContextMenuManager::insert(origView,popup); @@ -1474,9 +1474,9 @@ bool KBabelDictBox::hasSelectedText() const return have; } -QString KBabelDictBox::selectedText() const +TQString KBabelDictBox::selectedText() const { - QString text; + TQString text; if(origView->hasSelectedText()) text=origView->selectedText(); else if(translationView->hasSelectedText()) @@ -1487,10 +1487,10 @@ QString KBabelDictBox::selectedText() const -void KBabelDictBox::configure(const QString& id, bool modal) +void KBabelDictBox::configure(const TQString& id, bool modal) { - QWidget* w = prefDialogs[id]; + TQWidget* w = prefDialogs[id]; if(w) { KWin::setActiveWindow(w->winId()); @@ -1502,23 +1502,23 @@ void KBabelDictBox::configure(const QString& id, bool modal) { if(e->id() == id) { - QString caption = i18n("Configure Dictionary %1").arg(e->name()); + TQString caption = i18n("Configure Dictionary %1").arg(e->name()); KDialogBase *dialog = new KDialogBase(this,"prefDialog" , modal, caption , KDialogBase::Ok|KDialogBase::Apply|KDialogBase::Cancel| KDialogBase::Default); - QWhatsThis::add(dialog,""); + TQWhatsThis::add(dialog,""); PrefWidget *prefWidget = e->preferencesWidget(dialog); dialog->setMainWidget(prefWidget); - connect(dialog, SIGNAL(okClicked()),prefWidget,SLOT(apply())); - connect(dialog, SIGNAL(applyClicked()),prefWidget,SLOT(apply())); - connect(dialog, SIGNAL(defaultClicked()),prefWidget,SLOT(standard())); - connect(dialog, SIGNAL(cancelClicked()),prefWidget,SLOT(cancel())); + connect(dialog, TQT_SIGNAL(okClicked()),prefWidget,TQT_SLOT(apply())); + connect(dialog, TQT_SIGNAL(applyClicked()),prefWidget,TQT_SLOT(apply())); + connect(dialog, TQT_SIGNAL(defaultClicked()),prefWidget,TQT_SLOT(standard())); + connect(dialog, TQT_SIGNAL(cancelClicked()),prefWidget,TQT_SLOT(cancel())); - connect(dialog, SIGNAL(finished()),this,SLOT(destroyConfigDialog())); + connect(dialog, TQT_SIGNAL(finished()),this,TQT_SLOT(destroyConfigDialog())); prefDialogs.insert(id,dialog); @@ -1534,7 +1534,7 @@ void KBabelDictBox::configure(const QString& id, bool modal) void KBabelDictBox::destroyConfigDialog() { - const QObject *obj = sender(); + const TQObject *obj = sender(); if(obj && obj->inherits("KDialogBase")) { KDialogBase *dialog = (KDialogBase*)obj; @@ -1542,7 +1542,7 @@ void KBabelDictBox::destroyConfigDialog() { dialog->delayedDestruct(); - QDictIterator<QWidget> it(prefDialogs); + TQDictIterator<TQWidget> it(prefDialogs); while(it.current() != dialog) { ++it; @@ -1553,7 +1553,7 @@ void KBabelDictBox::destroyConfigDialog() } } -void KBabelDictBox::edit(const QString& id) +void KBabelDictBox::edit(const TQString& id) { SearchEngine *e; @@ -1579,8 +1579,8 @@ void KBabelDictBox::edit() engine->edit(); } -void KBabelDictBox::setTextChanged(const QStringList& orig, - const QString& translation, uint pluralForm, const QString& description) +void KBabelDictBox::setTextChanged(const TQStringList& orig, + const TQString& translation, uint pluralForm, const TQString& description) { SearchEngine *e; @@ -1591,7 +1591,7 @@ void KBabelDictBox::setTextChanged(const QStringList& orig, } -void KBabelDictBox::wheelEvent(QWheelEvent *we) +void KBabelDictBox::wheelEvent(TQWheelEvent *we) { if(we->delta() > 0) { @@ -1605,18 +1605,18 @@ void KBabelDictBox::wheelEvent(QWheelEvent *we) we->accept(); } -bool KBabelDictBox::eventFilter(QObject *o, QEvent *e) +bool KBabelDictBox::eventFilter(TQObject *o, TQEvent *e) { - if(e->type() == QEvent::Wheel) + if(e->type() == TQEvent::Wheel) { - QWheelEvent *we = static_cast<QWheelEvent*>(e); + TQWheelEvent *we = static_cast<TQWheelEvent*>(e); if(we) { wheelEvent(we); return true; } } - else if(e->type() == QEvent::Resize && o == resultListView) + else if(e->type() == TQEvent::Resize && o == resultListView) { if(resultListView->height() < 2) { @@ -1655,7 +1655,7 @@ void KBabelDictBox::editFile() if(!result->descriptions.isEmpty()) { TranslationInfo *info; - QPtrListIterator<TranslationInfo> it(result->descriptions); + TQPtrListIterator<TranslationInfo> it(result->descriptions); for(int i=0; i < currentInfo; i++) { ++it; @@ -1664,8 +1664,8 @@ void KBabelDictBox::editFile() if(!info->filePath.isEmpty()) { - QString url = info->filePath; - QString msgid; + TQString url = info->filePath; + TQString msgid; if( item->richText() ) { @@ -1685,8 +1685,8 @@ void KBabelDictBox::editFile() { kdDebug(KBABELDICT) << "kbabel is not registered" << endl; - QString error; - QStringList argList; + TQString error; + TQStringList argList; argList.append("--nosplash"); argList.append("--gotomsgid"); argList.append(msgid.local8Bit()); @@ -1702,11 +1702,11 @@ void KBabelDictBox::editFile() } else { - QByteArray data; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); arg << url.utf8() << msgid.utf8(); if (!dcop->send("kbabel", "KBabelIFace" - , "gotoFileEntry(QCString,QCString)",data)) + , "gotoFileEntry(TQCString,TQCString)",data)) { KMessageBox::sorry(this ,i18n("There was an error using DCOP.")); @@ -1717,7 +1717,7 @@ void KBabelDictBox::editFile() } } -void KBabelDictBox::showContextMenu(KListView *,QListViewItem *,const QPoint& p) +void KBabelDictBox::showContextMenu(KListView *,TQListViewItem *,const TQPoint& p) { if(rmbPopup) { @@ -1726,8 +1726,8 @@ void KBabelDictBox::showContextMenu(KListView *,QListViewItem *,const QPoint& p) } -bool KBabelDictBox::messagesForPackage(const QString& package - , QValueList<DiffEntry>& resultList, QString& error) +bool KBabelDictBox::messagesForPackage(const TQString& package + , TQValueList<DiffEntry>& resultList, TQString& error) { setActiveModule("dbsearchengine"); SearchEngine *engine = moduleList.at(active); @@ -1740,7 +1740,7 @@ bool KBabelDictBox::messagesForPackage(const QString& package return false; } - QValueList<SearchResult> rList; + TQValueList<SearchResult> rList; SearchFilter* filter = new SearchFilter(); filter->setLocation(package); @@ -1749,7 +1749,7 @@ bool KBabelDictBox::messagesForPackage(const QString& package if(success) { - QValueList<SearchResult>::Iterator it; + TQValueList<SearchResult>::Iterator it; for(it=rList.begin(); it != rList.end(); ++it) { // FIXME: what about plural forms? diff --git a/kbabel/kbabeldict/kbabeldictbox.h b/kbabel/kbabeldict/kbabeldictbox.h index 8168786e..2c3992f1 100644 --- a/kbabel/kbabeldict/kbabeldictbox.h +++ b/kbabel/kbabeldict/kbabeldictbox.h @@ -37,10 +37,10 @@ #include "searchengine.h" #include "catalog.h" -#include <qdict.h> -#include <qguardedptr.h> -#include <qptrlist.h> -#include <qstringlist.h> +#include <tqdict.h> +#include <tqguardedptr.h> +#include <tqptrlist.h> +#include <tqstringlist.h> class KListView; class QLabel; @@ -53,36 +53,36 @@ class QToolButton; struct ModuleInfo { - QString id; - QString name; + TQString id; + TQString name; bool editable; }; -class KDE_EXPORT KBabelDictBox : public QWidget, virtual public KBabelDictIFace +class KDE_EXPORT KBabelDictBox : public TQWidget, virtual public KBabelDictIFace { Q_OBJECT public: - KBabelDictBox( QWidget* parent = 0, const char* name = 0 + KBabelDictBox( TQWidget* parent = 0, const char* name = 0 , WFlags fl = 0 ); ~KBabelDictBox(); /** @returns ids of available modules */ - virtual QStringList modules(); + virtual TQStringList modules(); /** @returns (translated) names of available modules */ - QStringList moduleNames(); + TQStringList moduleNames(); /** * @returns a list with information about the available modules * Take care about, that you have to delete the items by yourself. */ - QPtrList<ModuleInfo> moduleInfos(); + TQPtrList<ModuleInfo> moduleInfos(); /** @returns preferencesWidgets of modules */ - QPtrList<PrefWidget> modPrefWidgets(QWidget* parent); + TQPtrList<PrefWidget> modPrefWidgets(TQWidget* parent); int activeModule(); bool activeModuleEditable(); @@ -95,15 +95,15 @@ public: void nextResult(); void prevResult(); - void startSearch(const QString); - void startTranslationSearch(const QString); - void startDelayedSearch(const QString); - void startDelayedTranslationSearch(const QString); - QString translate(const QString); - QString searchTranslation(const QString, int& score); - QString fuzzyTranslation(const QString, int& score); + void startSearch(const TQString); + void startTranslationSearch(const TQString); + void startDelayedSearch(const TQString); + void startDelayedTranslationSearch(const TQString); + TQString translate(const TQString); + TQString searchTranslation(const TQString, int& score); + TQString fuzzyTranslation(const TQString, int& score); void stopSearch(); - void setActiveModule(QString name); + void setActiveModule(TQString name); /** * @returns true, if a search is active at the moment @@ -120,7 +120,7 @@ public: * Saves the settings of the given module * in the given config object. */ - void saveSettings(const QString& moduleId, KConfigBase *config); + void saveSettings(const TQString& moduleId, KConfigBase *config); /** * Reads the settings including the settings of the different modules @@ -132,20 +132,20 @@ public: * Reads the settings of the given module * from the given config object. */ - void readSettings(const QString& moduleId, KConfigBase *config); + void readSettings(const TQString& moduleId, KConfigBase *config); /** @returns the translation of the current search result */ - QString translation(); + TQString translation(); bool hasSelectedText() const; - QString selectedText() const; + TQString selectedText() const; - void setRMBMenu(QPopupMenu *popup); + void setRMBMenu(TQPopupMenu *popup); - virtual bool eventFilter(QObject *, QEvent*); + virtual bool eventFilter(TQObject *, TQEvent*); /** @@ -153,37 +153,37 @@ public: * from dbsearchengine. When dbsearchengine allows multiple access to * the database this will get removed. */ - bool messagesForPackage(const QString& package - , QValueList<KBabel::DiffEntry>& resultList, QString& error); + bool messagesForPackage(const TQString& package + , TQValueList<KBabel::DiffEntry>& resultList, TQString& error); public slots: virtual void setActiveModule(int); - void slotStartSearch(const QString&); + void slotStartSearch(const TQString&); void slotStopSearch(); void slotNextResult(); void slotPrevResult(); void about(); - void aboutModule(const QString& moduleID); + void aboutModule(const TQString& moduleID); void aboutActiveModule(); /** * sets the name of the package currently edited */ - void setEditedPackage(const QString& packageName); + void setEditedPackage(const TQString& packageName); /** * sets the filepath of the package currently edited */ - void setEditedFile(const QString& path); + void setEditedFile(const TQString& path); /** sets the language code to use */ - void setLanguage(const QString& languageCode - , const QString& languageName); + void setLanguage(const TQString& languageCode + , const TQString& languageName); - void setTextChanged(const QStringList& orig, const QString& translation, - uint pluralForm, const QString& description); + void setTextChanged(const TQStringList& orig, const TQString& translation, + uint pluralForm, const TQString& description); /** * if text is marked, copy this into the clipboard, otherwise @@ -191,8 +191,8 @@ public slots: */ void copy(); - void configure(const QString& moduleID, bool modal=false); - void edit(const QString& moduleID); + void configure(const TQString& moduleID, bool modal=false); + void edit(const TQString& moduleID); void edit(); void clear(); @@ -202,11 +202,11 @@ signals: void searchStarted(); void searchStopped(); void progressed(int); - void progressStarts(const QString&); + void progressStarts(const TQString&); void progressEnds(); void activeModuleChanged(int); void activeModuleChanged(bool editable); - void errorInModule(const QString& error); + void errorInModule(const TQString& error); /** * emitted when either the order @@ -215,14 +215,14 @@ signals: void modulesChanged(); protected slots: - void showResult(QListViewItem*); + void showResult(TQListViewItem*); void addResult(const SearchResult*); void nextInfo(); void showDetailsOnly(); void showListOnly(); void clearModuleResults(); void editFile(); - void showContextMenu(KListView *, QListViewItem *, const QPoint&); + void showContextMenu(KListView *, TQListViewItem *, const TQPoint&); /** * This slots gets connected to a SearchEngine's searchStopped() signal, @@ -239,7 +239,7 @@ protected slots: void destroyConfigDialog(); protected: - virtual void wheelEvent(QWheelEvent*); + virtual void wheelEvent(TQWheelEvent*); private: /** @@ -247,36 +247,36 @@ private: */ void registerModule( SearchEngine* module); - QPtrList<SearchEngine> moduleList; + TQPtrList<SearchEngine> moduleList; int active; int currentResult; int currentInfo; int total; /** stores a string to be used with delayed search */ - QString searchText; - - QDict<QWidget> prefDialogs; - - QLabel *translatorLabel; - QLabel *locationLabel; - QLabel *totalResultsLabel; - QLabel *currentLabel; - QLabel *dateLabel; - QPushButton *moreButton; - QPushButton *nextButton; - QPushButton *prevButton; - QTextView *origView; - QTextView *translationView; - QSplitter *viewContainer; + TQString searchText; + + TQDict<TQWidget> prefDialogs; + + TQLabel *translatorLabel; + TQLabel *locationLabel; + TQLabel *totalResultsLabel; + TQLabel *currentLabel; + TQLabel *dateLabel; + TQPushButton *moreButton; + TQPushButton *nextButton; + TQPushButton *prevButton; + TQTextView *origView; + TQTextView *translationView; + TQSplitter *viewContainer; KListView *resultListView; - QSplitter *resultSplitter; + TQSplitter *resultSplitter; - QToolButton *listButton; - QToolButton *detailButton; + TQToolButton *listButton; + TQToolButton *detailButton; int editFileIndex; - QGuardedPtr<QPopupMenu> rmbPopup; + TQGuardedPtr<TQPopupMenu> rmbPopup; }; #endif // KBABELDICTBOX_H diff --git a/kbabel/kbabeldict/kbabeldictiface.h b/kbabel/kbabeldict/kbabeldictiface.h index 0b98a565..d576d4c5 100644 --- a/kbabel/kbabeldict/kbabeldictiface.h +++ b/kbabel/kbabeldict/kbabeldictiface.h @@ -35,17 +35,17 @@ #define KBABELDICTINTERFACE_H #include <dcopobject.h> -#include <qstringlist.h> +#include <tqstringlist.h> class KBabelDictIFace : virtual public DCOPObject { K_DCOP k_dcop: - virtual QStringList modules() = 0; - virtual ASYNC setActiveModule(QString modulename) = 0; + virtual TQStringList modules() = 0; + virtual ASYNC setActiveModule(TQString modulename) = 0; - virtual ASYNC startSearch(const QString searchstring) = 0; + virtual ASYNC startSearch(const TQString searchstring) = 0; virtual ASYNC stopSearch() = 0; virtual ASYNC nextResult()=0; diff --git a/kbabel/kbabeldict/kbabeldictview.cpp b/kbabel/kbabeldict/kbabeldictview.cpp index 26afd981..b5be8399 100644 --- a/kbabel/kbabeldict/kbabeldictview.cpp +++ b/kbabel/kbabeldict/kbabeldictview.cpp @@ -37,17 +37,17 @@ #include "searchengine.h" -#include <qcheckbox.h> -#include <qgroupbox.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qptrlist.h> -#include <qpushbutton.h> -#include <qstringlist.h> -#include <qwidgetstack.h> -#include <qsplitter.h> -#include <qvbox.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqptrlist.h> +#include <tqpushbutton.h> +#include <tqstringlist.h> +#include <tqwidgetstack.h> +#include <tqsplitter.h> +#include <tqvbox.h> #include <kcombobox.h> #include <kconfig.h> @@ -64,37 +64,37 @@ * Constructs a KBabelDictView which is a child of 'parent', with the * name 'name' and widget flags set to 'f' */ -KBabelDictView::KBabelDictView( QWidget* parent, const char* name, WFlags fl ) - : QWidget( parent, name, fl ) +KBabelDictView::KBabelDictView( TQWidget* parent, const char* name, WFlags fl ) + : TQWidget( parent, name, fl ) { - QVBoxLayout *mainLayout = new QVBoxLayout(this); + TQVBoxLayout *mainLayout = new TQVBoxLayout(this); mainLayout->setSpacing(KDialog::spacingHint()); mainLayout->setMargin(KDialog::marginHint()); - splitter = new QSplitter(this); + splitter = new TQSplitter(this); mainLayout->addWidget(splitter); - QWidget *w = new QWidget(splitter); - QVBoxLayout *wLayout= new QVBoxLayout(w); + TQWidget *w = new TQWidget(splitter); + TQVBoxLayout *wLayout= new TQVBoxLayout(w); wLayout->setSpacing(KDialog::spacingHint()); wLayout->setMargin(KDialog::marginHint()); - QHBoxLayout *hbox = new QHBoxLayout(wLayout); - QLabel *label = new QLabel(i18n("Search in module:"), w); + TQHBoxLayout *hbox = new TQHBoxLayout(wLayout); + TQLabel *label = new TQLabel(i18n("Search in module:"), w); hbox->addWidget(label); moduleCombo = new KComboBox(w); hbox->addWidget(moduleCombo); - QWidget *temp = new QWidget(w); + TQWidget *temp = new TQWidget(w); hbox->addWidget(temp); hbox->setStretchFactor(temp,2); - editButton = new QPushButton(i18n("&Edit"),w); + editButton = new TQPushButton(i18n("&Edit"),w); editButton->setEnabled(false); hbox->addWidget(editButton); // added a button "clear search" here - hbox = new QHBoxLayout(wLayout); - QPushButton* clearButton = new QPushButton(w); + hbox = new TQHBoxLayout(wLayout); + TQPushButton* clearButton = new TQPushButton(w); clearButton->setFlat(true); clearButton->setPixmap(SmallIcon("locationbar_erase")); hbox->addWidget(clearButton); @@ -102,13 +102,13 @@ KBabelDictView::KBabelDictView( QWidget* parent, const char* name, WFlags fl ) textEdit->setFocus(); hbox->addWidget(textEdit); - hbox = new QHBoxLayout(wLayout); - startButton = new QPushButton(i18n("&Start Search"),w); + hbox = new TQHBoxLayout(wLayout); + startButton = new TQPushButton(i18n("&Start Search"),w); hbox->addWidget(startButton); - inTransButton = new QCheckBox(i18n("Sea&rch in translations"),w); + inTransButton = new TQCheckBox(i18n("Sea&rch in translations"),w); hbox->addWidget(inTransButton); hbox->addStretch(1); - stopButton = new QPushButton(i18n("S&top"),w); + stopButton = new TQPushButton(i18n("S&top"),w); stopButton->setEnabled(false); hbox->addWidget(stopButton); @@ -117,15 +117,15 @@ KBabelDictView::KBabelDictView( QWidget* parent, const char* name, WFlags fl ) dictBox = new KBabelDictBox(w,"kbabeldictbox"); wLayout->addWidget(dictBox); - prefWidget = new QWidget(splitter); - QVBoxLayout *tempLayout= new QVBoxLayout(prefWidget); + prefWidget = new TQWidget(splitter); + TQVBoxLayout *tempLayout= new TQVBoxLayout(prefWidget); tempLayout->setSpacing(KDialog::spacingHint()); tempLayout->setMargin(KDialog::marginHint()); - label = new QLabel(i18n("Settings:"),prefWidget); + label = new TQLabel(i18n("Settings:"),prefWidget); tempLayout->addWidget(label); - prefStack = new QWidgetStack(prefWidget); + prefStack = new TQWidgetStack(prefWidget); tempLayout->addWidget(prefStack); tempLayout->addStretch(1); @@ -133,10 +133,10 @@ KBabelDictView::KBabelDictView( QWidget* parent, const char* name, WFlags fl ) dictBox->readSettings(config); dictBox->setAutoUpdateOptions(true); - QStringList modules = dictBox->moduleNames(); + TQStringList modules = dictBox->moduleNames(); moduleCombo->insertStringList(modules); - QPtrList<PrefWidget> prefs = dictBox->modPrefWidgets(prefStack); + TQPtrList<PrefWidget> prefs = dictBox->modPrefWidgets(prefStack); prefs.setAutoDelete(false); PrefWidget *p; @@ -152,31 +152,31 @@ KBabelDictView::KBabelDictView( QWidget* parent, const char* name, WFlags fl ) moduleCombo->setCurrentItem(active); - QHBox *h = new QHBox(this); + TQHBox *h = new TQHBox(this); h->setSpacing(KDialog::spacingHint()); mainLayout->addWidget(h); - progressLabel = new QLabel(h); + progressLabel = new TQLabel(h); progressBar = new KProgress(h); - connect(textEdit,SIGNAL(returnPressed()),startButton,SLOT(animateClick())); - connect(startButton,SIGNAL(clicked()),this, SLOT(startSearch())); - connect(stopButton, SIGNAL(clicked()), dictBox,SLOT(slotStopSearch())); - connect(editButton, SIGNAL(clicked()), dictBox, SLOT(edit())); - connect(dictBox, SIGNAL(searchStarted()), this, SLOT(searchStarted())); - connect(dictBox, SIGNAL(searchStopped()), this, SLOT(searchStopped())); - connect(dictBox, SIGNAL(progressed(int)), progressBar, SLOT(setProgress(int))); - connect(dictBox, SIGNAL(activeModuleChanged(bool)) - , editButton, SLOT(setEnabled(bool))); + connect(textEdit,TQT_SIGNAL(returnPressed()),startButton,TQT_SLOT(animateClick())); + connect(startButton,TQT_SIGNAL(clicked()),this, TQT_SLOT(startSearch())); + connect(stopButton, TQT_SIGNAL(clicked()), dictBox,TQT_SLOT(slotStopSearch())); + connect(editButton, TQT_SIGNAL(clicked()), dictBox, TQT_SLOT(edit())); + connect(dictBox, TQT_SIGNAL(searchStarted()), this, TQT_SLOT(searchStarted())); + connect(dictBox, TQT_SIGNAL(searchStopped()), this, TQT_SLOT(searchStopped())); + connect(dictBox, TQT_SIGNAL(progressed(int)), progressBar, TQT_SLOT(setProgress(int))); + connect(dictBox, TQT_SIGNAL(activeModuleChanged(bool)) + , editButton, TQT_SLOT(setEnabled(bool))); - connect(dictBox, SIGNAL(progressStarts(const QString&)) - , this, SLOT(progressStarted(const QString&))); - connect(dictBox, SIGNAL(progressEnds()), this, SLOT(progressStopped())); + connect(dictBox, TQT_SIGNAL(progressStarts(const TQString&)) + , this, TQT_SLOT(progressStarted(const TQString&))); + connect(dictBox, TQT_SIGNAL(progressEnds()), this, TQT_SLOT(progressStopped())); - connect(moduleCombo, SIGNAL(activated(int)), - dictBox, SLOT(setActiveModule(int))); - connect(dictBox, SIGNAL(activeModuleChanged(int)) - , this, SLOT(switchModule(int))); - connect(clearButton, SIGNAL(clicked()), this, SLOT(slotClearSearch())); + connect(moduleCombo, TQT_SIGNAL(activated(int)), + dictBox, TQT_SLOT(setActiveModule(int))); + connect(dictBox, TQT_SIGNAL(activeModuleChanged(int)) + , this, TQT_SLOT(switchModule(int))); + connect(clearButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotClearSearch())); } /* @@ -194,7 +194,7 @@ KBabelDictView::~KBabelDictView() */ void KBabelDictView::startSearch() { - QString text = textEdit->text(); + TQString text = textEdit->text(); if(!text.isEmpty()) { @@ -219,7 +219,7 @@ void KBabelDictView::progressStopped() stopButton->setEnabled(false); } -void KBabelDictView::progressStarted(const QString& msg) +void KBabelDictView::progressStarted(const TQString& msg) { progressLabel->setText(msg); startButton->setEnabled(false); diff --git a/kbabel/kbabeldict/kbabeldictview.h b/kbabel/kbabeldict/kbabeldictview.h index 510936c4..838d3ba3 100644 --- a/kbabel/kbabeldict/kbabeldictview.h +++ b/kbabel/kbabeldict/kbabeldictview.h @@ -35,7 +35,7 @@ #ifndef KBABELDICTVIEW_H #define KBABELDICTVIEW_H -#include <qwidget.h> +#include <tqwidget.h> class KComboBox; class KLineEdit; @@ -48,12 +48,12 @@ class QWidgetStack; class KBabelDictBox; -class KBabelDictView : public QWidget +class KBabelDictView : public TQWidget { Q_OBJECT public: - KBabelDictView( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + KBabelDictView( TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~KBabelDictView(); bool prefVisible(); @@ -69,7 +69,7 @@ private slots: void searchStarted(); void switchModule(int); void progressStopped(); - void progressStarted(const QString&); + void progressStarted(const TQString&); void slotClearSearch(); private: @@ -77,16 +77,16 @@ private: KComboBox *moduleCombo; KLineEdit *textEdit; - QCheckBox *inTransButton; - QPushButton *startButton; - QPushButton *stopButton; - QPushButton *editButton; - QWidgetStack *prefStack; + TQCheckBox *inTransButton; + TQPushButton *startButton; + TQPushButton *stopButton; + TQPushButton *editButton; + TQWidgetStack *prefStack; KProgress *progressBar; - QLabel *progressLabel; - QSplitter *splitter; + TQLabel *progressLabel; + TQSplitter *splitter; - QWidget *prefWidget; + TQWidget *prefWidget; }; #endif // KBABELDICTVIEW_H diff --git a/kbabel/kbabeldict/kbabelsplash.cpp b/kbabel/kbabeldict/kbabelsplash.cpp index 16ac2352..7b62f31e 100644 --- a/kbabel/kbabeldict/kbabelsplash.cpp +++ b/kbabel/kbabeldict/kbabelsplash.cpp @@ -28,36 +28,36 @@ #include "kbabelsplash.h" -#include <qapplication.h> -#include <qlabel.h> -#include <qpixmap.h> -#include <qevent.h> -#include <qstring.h> -#include <qfontmetrics.h> -#include <qpainter.h> +#include <tqapplication.h> +#include <tqlabel.h> +#include <tqpixmap.h> +#include <tqevent.h> +#include <tqstring.h> +#include <tqfontmetrics.h> +#include <tqpainter.h> #include <kstandarddirs.h> KBabelSplash* KBabelSplash::instance = 0; -KBabelSplash::KBabelSplash( QWidget* parent, const char* name ) - : QVBox( parent, name, WType_Dialog|WShowModal|WStyle_Customize|WStyle_NoBorder|WDestructiveClose ) +KBabelSplash::KBabelSplash( TQWidget* parent, const char* name ) + : TQVBox( parent, name, WType_Dialog|WShowModal|WStyle_Customize|WStyle_NoBorder|WDestructiveClose ) { setMargin( 0 ); setSpacing( 0 ); - QLabel* picLabel = new QLabel( this ); - QPixmap pixmap; + TQLabel* picLabel = new TQLabel( this ); + TQPixmap pixmap; if( pixmap.load( locate( "data", "kbabel/pics/splash.png" ) ) ) picLabel->setPixmap( pixmap ); - picLabel->setFrameStyle(QFrame::WinPanel | QFrame::Raised); + picLabel->setFrameStyle(TQFrame::WinPanel | TQFrame::Raised); // Set geometry, with support for Xinerama systems - QRect r; + TQRect r; r.setSize(sizeHint()); - int ps = QApplication::desktop()->primaryScreen(); - r.moveCenter( QApplication::desktop()->screenGeometry(ps).center() ); + int ps = TQApplication::desktop()->primaryScreen(); + r.moveCenter( TQApplication::desktop()->screenGeometry(ps).center() ); setGeometry(r); if( instance ) delete instance; @@ -65,7 +65,7 @@ KBabelSplash::KBabelSplash( QWidget* parent, const char* name ) } -void KBabelSplash::mousePressEvent( QMouseEvent* ) +void KBabelSplash::mousePressEvent( TQMouseEvent* ) { close(); } diff --git a/kbabel/kbabeldict/kbabelsplash.h b/kbabel/kbabeldict/kbabelsplash.h index c10b4fec..c381d11b 100644 --- a/kbabel/kbabeldict/kbabelsplash.h +++ b/kbabel/kbabeldict/kbabelsplash.h @@ -30,7 +30,7 @@ #ifndef KBABELSPLASH_H #define KBABELSPLASH_H -#include <qvbox.h> +#include <tqvbox.h> class QLabel; class QMouseEvent; @@ -43,13 +43,13 @@ class KBabelSplash : public QVBox Q_OBJECT public: - KBabelSplash( QWidget* parent = 0, const char* name = 0 ); + KBabelSplash( TQWidget* parent = 0, const char* name = 0 ); ~KBabelSplash() { instance = 0; } static KBabelSplash* instance; protected: - void mousePressEvent( QMouseEvent* ); + void mousePressEvent( TQMouseEvent* ); }; #endif diff --git a/kbabel/kbabeldict/main.cpp b/kbabel/kbabeldict/main.cpp index be6ca67e..c327196b 100644 --- a/kbabel/kbabeldict/main.cpp +++ b/kbabel/kbabeldict/main.cpp @@ -41,7 +41,7 @@ #include <kapplication.h> #include <kwin.h> -#include <qtimer.h> +#include <tqtimer.h> #include "kbabeldict.h" #include "kbabelsplash.h" @@ -63,8 +63,8 @@ KBabelDictApplication::KBabelDictApplication() { KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); - QTimer timer; - QWidget *splash=0; + TQTimer timer; + TQWidget *splash=0; bool showSplash=args->isSet("splash"); if(showSplash) { @@ -91,8 +91,8 @@ KBabelDictApplication::KBabelDictApplication() KApplication::restoreOverrideCursor(); } - QObject::connect( topLevel, SIGNAL( destroyed() ), - this, SLOT( quit() ) ); + TQObject::connect( topLevel, TQT_SIGNAL( destroyed() ), + this, TQT_SLOT( quit() ) ); } KBabelDictApplication::~KBabelDictApplication() 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(); 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); diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/KDBSearchEngine2.h b/kbabel/kbabeldict/modules/dbsearchengine2/KDBSearchEngine2.h index 0db19c6c..fb9cff70 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/KDBSearchEngine2.h +++ b/kbabel/kbabeldict/modules/dbsearchengine2/KDBSearchEngine2.h @@ -9,7 +9,7 @@ Andrea Rizzi #define DBSEARCH_ENGINE2_H #include <searchengine.h> -#include <qdialog.h> +#include <tqdialog.h> #include "database.h" #include "dbse2_factory.h" @@ -25,7 +25,7 @@ class KDBSearchEngine2 : public SearchEngine public: - KDBSearchEngine2(QObject *parent=0, const char *name=0); + KDBSearchEngine2(TQObject *parent=0, const char *name=0); virtual ~KDBSearchEngine2(); //init if needed. @@ -46,10 +46,10 @@ class KDBSearchEngine2 : public SearchEngine void readSettings(KConfigBase *config); - QString translate(const QString text); + TQString translate(const TQString text); - QString fuzzyTranslation(const QString text, int &score); - QString searchTranslation(const QString, int &score ); + TQString fuzzyTranslation(const TQString text, int &score); + TQString searchTranslation(const TQString, int &score ); /** * Finds all messages belonging to package package. If nothing is found, @@ -60,8 +60,8 @@ class KDBSearchEngine2 : public SearchEngine * * @return true, if successfull */ - bool messagesForPackage(const QString& package - , QValueList<Message>& resultList, QString& error); + bool messagesForPackage(const TQString& package + , TQValueList<Message>& resultList, TQString& error); /** * @returns true, if the searchresults are given as rich text @@ -79,19 +79,19 @@ class KDBSearchEngine2 : public SearchEngine * a tabbed widget. * @param parent the parent of the returned widget */ - virtual PrefWidget* preferencesWidget(QWidget *parent); + virtual PrefWidget* preferencesWidget(TQWidget *parent); /** @returns information about this SearchEngine */ virtual const KAboutData *about() const; /** @returns the i18n name of this search engine */ - QString name() const {return i18n("DB SearchEngine II");} + TQString name() const {return i18n("DB SearchEngine II");} /** @returns a untranslated name of this engine */ - QString id() const {return "dbse2";} + TQString id() const {return "dbse2";} /** @returns the last error message */ - QString lastError() {return lasterror;} + TQString lastError() {return lasterror;} /** @@ -114,14 +114,14 @@ class KDBSearchEngine2 : public SearchEngine * @returns false, if an error occured. Use @ref lastError * to get the last error message */ - bool startSearch(QString s); + bool startSearch(TQString s); /** * starts a search for string s in the translated text * @returns false, if an error occured. Use @ref lastError * to get the last error message */ - bool startSearchInTranslation(QString s); + bool startSearchInTranslation(TQString s); /** stops a search */ @@ -133,22 +133,22 @@ class KDBSearchEngine2 : public SearchEngine * on the edited file. The default implementation does nothing. * @param file The edited file with path */ - // virtual void setEditedFile(QString file); + // virtual void setEditedFile(TQString file); /** * This method allows a search engine to use different settings depending * on the edited package. The default implementation does nothing. * @param package The name of the package, that is currently translated. */ - // virtual void setEditedPackage(QString package); + // virtual void setEditedPackage(TQString package); /** * This method allows a search engine to use different settings depending * on the language code. The default implementation does nothing. * @param lang The current language code (e.g. de). */ - // virtual void setLanguageCode(QString lang); - // virtual void setLanguage(QString languageCode, QString languageName); + // virtual void setLanguageCode(TQString lang); + // virtual void setLanguage(TQString languageCode, TQString languageName); @@ -160,15 +160,15 @@ class KDBSearchEngine2 : public SearchEngine * @param translation the translated string */ - void stringChanged( QString orig, QString translated - , QString description); + void stringChanged( TQString orig, TQString translated + , TQString description); //void scan(); - void setLastError(QString er); + void setLastError(TQString er); //Slots for preference dialog - // void scanSource(QString sourceName); + // void scanSource(TQString sourceName); void scanNowPressed(); void scanAllPressed(); void editSource(); @@ -181,7 +181,7 @@ class KDBSearchEngine2 : public SearchEngine bool searching; bool iAmReady; bool autoupdate; - QString lasterror; + TQString lasterror; KDB2PreferencesWidget *pw; //PrefWidg -> DBSE @@ -190,11 +190,11 @@ class KDBSearchEngine2 : public SearchEngine void setSettings(); DBSESettings settings; - QString dbDirectory; + TQString dbDirectory; bool autoAdd,useSentence,useGlossary,useExact; bool useDivide,useAlpha,useWordByWord,useDynamic; uint numberOfResult; - QMap<QString,MessagesSource> sources; + TQMap<TQString,MessagesSource> sources; }; diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/algorithms.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/algorithms.cpp index 0ca040e8..466b68e5 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/algorithms.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine2/algorithms.cpp @@ -10,20 +10,20 @@ // // #include "algorithms.h" -#include <qstringlist.h> +#include <tqstringlist.h> #include <kdebug.h> //FIXME: remove #define i18n (const char*) -DataBaseInterface::ResultList ExactSearchAlgorithm::exec(const QString& query ) +DataBaseInterface::ResultList ExactSearchAlgorithm::exec(const TQString& query ) { DataBaseInterface::ResultList res; DataBaseInterface::MainEntry e=di->get(query,0); - QStringList trs=e.second.getTranslations(); + TQStringList trs=e.second.getTranslations(); - for(QStringList::iterator it=trs.begin();it!=trs.end();++it) + for(TQStringList::iterator it=trs.begin();it!=trs.end();++it) { emit newResult(QueryResult(*it,e.first.getString(),settings->scoreExact)); @@ -35,19 +35,19 @@ DataBaseInterface::ResultList ExactSearchAlgorithm::exec(const QString& query ) } -DataBaseInterface::ResultList GenericSearchAlgorithm::exec(const QString& query ) +DataBaseInterface::ResultList GenericSearchAlgorithm::exec(const TQString& query ) { DataBaseInterface::ResultList res; // ExactSearchAlgorithm exact(query,settings); uint countResults=0; - for(QValueList<AbstractSearchAlgorithm *>::iterator algoit = algoChain.begin(); algoit!=algoChain.end() && countResults < maxResults; algoit++) + for(TQValueList<AbstractSearchAlgorithm *>::iterator algoit = algoChain.begin(); algoit!=algoChain.end() && countResults < maxResults; algoit++) { - connect(*algoit,SIGNAL(newResult(QueryResult)),this,SIGNAL(newResult(QueryResult))); + connect(*algoit,TQT_SIGNAL(newResult(QueryResult)),this,TQT_SIGNAL(newResult(QueryResult))); kdDebug(0) << "Algo pointer" << (*algoit) << endl; res+=(*algoit)->exec(query); countResults=res.count(); kdDebug(0) << "Count = " << countResults << endl; - disconnect(*algoit,SIGNAL(newResult(QueryResult)),this,SIGNAL(newResult(QueryResult))); + disconnect(*algoit,TQT_SIGNAL(newResult(QueryResult)),this,TQT_SIGNAL(newResult(QueryResult))); } return res; } @@ -57,7 +57,7 @@ void GenericSearchAlgorithm::addAlgorithm( AbstractSearchAlgorithm * algo ) algoChain.append(algo); } -DataBaseInterface::ResultList AlphaSearchAlgorithm::exec( const QString & query ) +DataBaseInterface::ResultList AlphaSearchAlgorithm::exec( const TQString & query ) { DataBaseInterface::ResultList res; DBItemMultiIndex::IndexList il=di->getAlpha(query); @@ -65,8 +65,8 @@ DataBaseInterface::ResultList AlphaSearchAlgorithm::exec( const QString & query for(DBItemMultiIndex::IndexList::iterator it=il.begin();it!=il.end()&&!di->stopNow();++it) { DataBaseInterface::MainEntry e=di->getFromIndex(*it); - QStringList trs=e.second.getTranslations(); - for(QStringList::iterator it=trs.begin();it!=trs.end() && !di->stopNow();++it) + TQStringList trs=e.second.getTranslations(); + for(TQStringList::iterator it=trs.begin();it!=trs.end() && !di->stopNow();++it) { QueryResult r(di->format(di->simple(*it,true),query),e.first.getString(),settings->scoreAlpha); emit newResult(r); @@ -78,17 +78,17 @@ DataBaseInterface::ResultList AlphaSearchAlgorithm::exec( const QString & query return res; } -DataBaseInterface::ResultList SentenceArchiveSearchAlgorithm::exec( const QString & query ) +DataBaseInterface::ResultList SentenceArchiveSearchAlgorithm::exec( const TQString & query ) { DataBaseInterface::ResultList res; DataBaseInterface::MainEntry e = di->getSentence(query); - QStringList trs=e.second.getTranslations(); + TQStringList trs=e.second.getTranslations(); kdDebug(0) << "Count in sentence archive " << trs.count()<< endl; - for(QStringList::iterator it=trs.begin();it!=trs.end();++it) + for(TQStringList::iterator it=trs.begin();it!=trs.end();++it) { QueryResult r(di->format(di->simple(*it,true),query),e.first.getString(),settings->scoreSentence); emit newResult(r); @@ -100,31 +100,31 @@ DataBaseInterface::ResultList SentenceArchiveSearchAlgorithm::exec( const QStrin return res; } -DataBaseInterface::ResultList ChunkByChunkSearchAlgorithm::exec( const QString & query ) +DataBaseInterface::ResultList ChunkByChunkSearchAlgorithm::exec( const TQString & query ) { ResultList res; factory->setQuery(query); - QPtrList<AbstractChunk> chunks=factory->chunks(); + TQPtrList<AbstractChunk> chunks=factory->chunks(); kdDebug(0) << "Number of chunks " << chunks.count() << endl; chunks.setAutoDelete(true); //I should delete the chunks myself - QStringList querySeparators=factory->separators(); + TQStringList querySeparators=factory->separators(); //This prevents recursive loop. if (chunks.count()<=1) return res; - QStringList translations,tmpTranslations; + TQStringList translations,tmpTranslations; translations.push_back(""); //FIXME this is needed to start , but is not good int finalscore=0; int i=0; - QMap<QString,bool> translationUsed; + TQMap<TQString,bool> translationUsed; //Loop on all chunk for(AbstractChunk *it=chunks.first();it && !di->stopNow(); it=chunks.next()) { kdDebug(0) << "Process next chunk" << endl; int chunkscore=0; - QValueList<QueryResult> r=it->translations(); + TQValueList<QueryResult> r=it->translations(); kdDebug(0) << "Number of results for this chunk " << r.count() << endl; if(r.count()<1) { @@ -144,14 +144,14 @@ DataBaseInterface::ResultList ChunkByChunkSearchAlgorithm::exec( const QString & translationUsed.clear(); for(ResultList::iterator it1=r.begin();it1!=r.end() &&!di->stopNow(); ++it1) { - QString chunkTranslation= (*it1).result(); + TQString chunkTranslation= (*it1).result(); if(!translationUsed.contains(chunkTranslation)) { translationUsed[chunkTranslation]=true; kdDebug(0) << "a translation is: " << chunkTranslation << endl; - for(QStringList::iterator it2=translations.begin();it2!=translations.end() && !di->stopNow() ; it2++) + for(TQStringList::iterator it2=translations.begin();it2!=translations.end() && !di->stopNow() ; it2++) { - QString prevTranslation=*it2; + TQString prevTranslation=*it2; tmpTranslations.push_back(prevTranslation+chunkTranslation+querySeparators[i]); kdDebug(0) << "..appending it to " << prevTranslation << endl; } @@ -176,9 +176,9 @@ DataBaseInterface::ResultList ChunkByChunkSearchAlgorithm::exec( const QString & if (finalscore<50) return res; - for(QStringList::iterator it2=translations.begin();it2!=translations.end() && !di->stopNow() ; it2++) + for(TQStringList::iterator it2=translations.begin();it2!=translations.end() && !di->stopNow() ; it2++) { - QString theTranslation=*it2; + TQString theTranslation=*it2; QueryResult qr(di->format(theTranslation,query),i18n("CHUNK BY CHUNK"),finalscore); qr.setRichOriginal(i18n("<h3>Chunk by chunk</h3>CHANGE THIS TEXT!!!!This translation is" "obtained translating the sentences and using a" @@ -211,22 +211,22 @@ FuzzyChunkSearchAlgorithm::FuzzyChunkSearchAlgorithm( DataBaseInterface * dbi, D } -DataBaseInterface::ResultList FuzzyChunkSearchAlgorithm::exec( const QString & query ) +DataBaseInterface::ResultList FuzzyChunkSearchAlgorithm::exec( const TQString & query ) { //FIXME: this code is shit too ResultList res; factory->setQuery(query); - QPtrList<AbstractChunk> querychunks = factory->chunks(); + TQPtrList<AbstractChunk> querychunks = factory->chunks(); querychunks.setAutoDelete(true); - typedef QMap<QString,QValueList<unsigned int> > ResultMap; + typedef TQMap<TQString,TQValueList<unsigned int> > ResultMap; ResultMap rmap; //result of words index query unsigned int notfound=0,frequent=0,nchunks = querychunks.count(); //Get index list for each word for(AbstractChunk *it=querychunks.first(); it &&!di->stopNow() ; it=querychunks.next() ) { - QValueList<uint> locations = (*it).locationReferences(); + TQValueList<uint> locations = (*it).locationReferences(); if(locations.count()>0) { @@ -246,10 +246,10 @@ DataBaseInterface::ResultList FuzzyChunkSearchAlgorithm::exec( const QString & q //Now we have a map (rmap) "word in query->list of occurency" - QValueList<unsigned int>::iterator countpos[nchunks+1]; + TQValueList<unsigned int>::iterator countpos[nchunks+1]; - QValueList<unsigned int> il; + TQValueList<unsigned int> il; for(int i = 0;i<=nchunks&&!di->stopNow();i++) countpos[i]=il.end(); @@ -310,12 +310,12 @@ DataBaseInterface::ResultList FuzzyChunkSearchAlgorithm::exec( const QString & q int bestscore=0; for(unsigned int wf=nchunks;wf>0;wf-- ){ - for(QValueList<unsigned int>::iterator it=countpos[wf];it!=countpos[wf-1] ;++it) + for(TQValueList<unsigned int>::iterator it=countpos[wf];it!=countpos[wf-1] ;++it) { //loop on entries with same number of word found DataBaseInterface::MainEntry e; e=di->getFromIndex(*it); - QStringList trs=e.second.getTranslations(); - for(QStringList::iterator it=trs.begin();it!=trs.end()&&!di->stopNow();++it) + TQStringList trs=e.second.getTranslations(); + for(TQStringList::iterator it=trs.begin();it!=trs.end()&&!di->stopNow();++it) { unsigned int cinr=factory->chunks(*it).count(); //chunk in result //compute a score, lets kbabel sort now, it should be fast... @@ -326,11 +326,11 @@ DataBaseInterface::ResultList FuzzyChunkSearchAlgorithm::exec( const QString & q // kdDebug(0) << "s: "<<score << " wf: "<<wf<<" nwords: "<<nwords<<" winr: "<<winr // <<" 90*wf/nwords: "<<90*wf/nwords << " -:" << 90*(((nwords-winr)>0)?(nwords-winr):(winr-nwords))/(nwords*10)<< endl; // FIXME: format better the richtext - QString ori=e.first.getString(); - QString re=di->format(di->simple(*it,true),query); + TQString ori=e.first.getString(); + TQString re=di->format(di->simple(*it,true),query); QueryResult r(re,ori,score); - for(QPtrListIterator<AbstractChunk> it(querychunks); it.current() && di->stopNow() ; ++it){ - ori=ori.replace(QRegExp((*it)->chunkString(),false),"<font color=#000080><u><b>"+(*it)->chunkString()+"</b></u></font>"); + for(TQPtrListIterator<AbstractChunk> it(querychunks); it.current() && di->stopNow() ; ++it){ + ori=ori.replace(TQRegExp((*it)->chunkString(),false),"<font color=#000080><u><b>"+(*it)->chunkString()+"</b></u></font>"); } r.setRichOriginal(ori); if(!di->stopNow()) @@ -344,16 +344,16 @@ DataBaseInterface::ResultList FuzzyChunkSearchAlgorithm::exec( const QString & q } -DataBaseInterface::ResultList CorrelationSearchAlgorithm::exec( const QString & query ) +DataBaseInterface::ResultList CorrelationSearchAlgorithm::exec( const TQString & query ) { //FIXME, this code is shit. DataBaseInterface::ResultList res; if(di->words(query).count()>1) return res; - QMap<QString,float> corRes = di->correlation(query,0,false); + TQMap<TQString,float> corRes = di->correlation(query,0,false); float max=0,max1=0,max2=0; - QString best,best1,best2; + TQString best,best1,best2; - for(QMap<QString,float>::iterator it = corRes.begin(); it !=corRes.end(); ++it) + for(TQMap<TQString,float>::iterator it = corRes.begin(); it !=corRes.end(); ++it) { if(it.data()>max) { @@ -414,7 +414,7 @@ SingleWordSearchAlgorithm::SingleWordSearchAlgorithm( DataBaseInterface * dbi, D addAlgorithm(&corr); } -DataBaseInterface::ResultList SingleWordSearchAlgorithm::exec( const QString & query ) +DataBaseInterface::ResultList SingleWordSearchAlgorithm::exec( const TQString & query ) { if(di->words(query).count()>1) return ResultList(); diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/algorithms.h b/kbabel/kbabeldict/modules/dbsearchengine2/algorithms.h index 5f9ee682..aa049f85 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/algorithms.h +++ b/kbabel/kbabeldict/modules/dbsearchengine2/algorithms.h @@ -14,14 +14,14 @@ #include "database.h" #include "chunk.h" -#include <qobject.h> +#include <tqobject.h> class AbstractSearchAlgorithm : public QObject { Q_OBJECT public: - typedef QValueList<QueryResult> ResultList; + typedef TQValueList<QueryResult> ResultList; AbstractSearchAlgorithm(DataBaseInterface *dbi,DBSESettings *sets) { @@ -31,7 +31,7 @@ class AbstractSearchAlgorithm : public QObject /** * this contains the algo and return some results. */ - virtual DataBaseInterface::ResultList exec(const QString& query)=0; + virtual DataBaseInterface::ResultList exec(const TQString& query)=0; signals: void newResult(QueryResult); @@ -50,7 +50,7 @@ class ExactSearchAlgorithm : public AbstractSearchAlgorithm public: ExactSearchAlgorithm(DataBaseInterface *dbi,DBSESettings *sets) : AbstractSearchAlgorithm(dbi,sets) {} - virtual DataBaseInterface::ResultList exec(const QString& query); + virtual DataBaseInterface::ResultList exec(const TQString& query); }; class AlphaSearchAlgorithm : public AbstractSearchAlgorithm @@ -59,7 +59,7 @@ class AlphaSearchAlgorithm : public AbstractSearchAlgorithm public: AlphaSearchAlgorithm(DataBaseInterface *dbi,DBSESettings *sets) : AbstractSearchAlgorithm(dbi,sets) {} - virtual DataBaseInterface::ResultList exec(const QString& query); + virtual DataBaseInterface::ResultList exec(const TQString& query); }; class SentenceArchiveSearchAlgorithm : public AbstractSearchAlgorithm @@ -68,7 +68,7 @@ class SentenceArchiveSearchAlgorithm : public AbstractSearchAlgorithm public: SentenceArchiveSearchAlgorithm(DataBaseInterface *dbi,DBSESettings *sets) ; - virtual DataBaseInterface::ResultList exec(const QString& query); + virtual DataBaseInterface::ResultList exec(const TQString& query); }; class ChunkByChunkSearchAlgorithm : public AbstractSearchAlgorithm @@ -77,7 +77,7 @@ class ChunkByChunkSearchAlgorithm : public AbstractSearchAlgorithm public: ChunkByChunkSearchAlgorithm(DataBaseInterface *dbi,DBSESettings *sets); - virtual DataBaseInterface::ResultList exec(const QString& query); + virtual DataBaseInterface::ResultList exec(const TQString& query); void setChunkFactory(AbstractChunkFactory *_factory) { @@ -93,7 +93,7 @@ class FuzzyChunkSearchAlgorithm : public AbstractSearchAlgorithm public: FuzzyChunkSearchAlgorithm(DataBaseInterface *dbi,DBSESettings *sets); - virtual DataBaseInterface::ResultList exec(const QString& query); + virtual DataBaseInterface::ResultList exec(const TQString& query); void setChunkFactory(AbstractChunkFactory *_factory) { factory=_factory; @@ -108,14 +108,14 @@ class GenericSearchAlgorithm : public AbstractSearchAlgorithm public: GenericSearchAlgorithm(DataBaseInterface *dbi,DBSESettings *sets) ; - virtual ResultList exec(const QString& query); + virtual ResultList exec(const TQString& query); void addAlgorithm(AbstractSearchAlgorithm *algo); void setMaxResultNumber(uint num){maxResults=num;} protected: - QValueList<AbstractSearchAlgorithm *> algoChain; + TQValueList<AbstractSearchAlgorithm *> algoChain; uint maxResults; }; @@ -125,7 +125,7 @@ class CorrelationSearchAlgorithm : public AbstractSearchAlgorithm Q_OBJECT public: CorrelationSearchAlgorithm(DataBaseInterface *dbi,DBSESettings *sets) : AbstractSearchAlgorithm(dbi,sets) {} - virtual ResultList exec(const QString& query); + virtual ResultList exec(const TQString& query); }; @@ -135,7 +135,7 @@ class SingleWordSearchAlgorithm : public GenericSearchAlgorithm Q_OBJECT public: SingleWordSearchAlgorithm(DataBaseInterface *dbi,DBSESettings *sets); - virtual DataBaseInterface::ResultList exec(const QString& query); + virtual DataBaseInterface::ResultList exec(const TQString& query); private: ExactSearchAlgorithm exact; diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/chunk.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/chunk.cpp index 7c62748a..ef426d53 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/chunk.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine2/chunk.cpp @@ -19,12 +19,12 @@ AbstractChunk::~AbstractChunk( ) { } -WordChunk::WordChunk( DataBaseInterface * di, QString _word ) : AbstractChunk(di) +WordChunk::WordChunk( DataBaseInterface * di, TQString _word ) : AbstractChunk(di) { word=_word; } -QValueList<QueryResult> WordChunk::translations( ) +TQValueList<QueryResult> WordChunk::translations( ) { DataBaseInterface::ResultList r; SingleWordSearchAlgorithm sa(di,di->getSettings()); @@ -32,13 +32,13 @@ QValueList<QueryResult> WordChunk::translations( ) return r; } -//QValueList<QueryResult> WordChunk::translationsFromReference( uint reference ) +//TQValueList<QueryResult> WordChunk::translationsFromReference( uint reference ) //{ //} -QValueList< uint > WordChunk::locationReferences( ) +TQValueList< uint > WordChunk::locationReferences( ) { - QValueList<uint> res=di->getWordIndex(word); + TQValueList<uint> res=di->getWordIndex(word); kdDebug(0) << "Number of locations " << res.count() <<endl ; return res; /* DBItemMainKey *k = new DBItemMainKey(word); @@ -46,20 +46,20 @@ QValueList< uint > WordChunk::locationReferences( ) if(wordsindex->get(k,d)!=DB_NOTFOUND) return d->getList(); else - return QValueList<uint> tmpList; + return TQValueList<uint> tmpList; */ } -void WordChunk::setLocationReferences( QValueList< uint > ) +void WordChunk::setLocationReferences( TQValueList< uint > ) { } -SentenceChunk::SentenceChunk( DataBaseInterface * di, QString _sentence ): AbstractChunk(di) +SentenceChunk::SentenceChunk( DataBaseInterface * di, TQString _sentence ): AbstractChunk(di) { sentence=_sentence; } -QValueList<QueryResult> SentenceChunk::translations( ) +TQValueList<QueryResult> SentenceChunk::translations( ) { GenericSearchAlgorithm g(di,di->getSettings()); @@ -75,29 +75,29 @@ QValueList<QueryResult> SentenceChunk::translations( ) } -//QValueList<QueryResult> SentenceChunk::translationsFromReference( uint reference ) +//TQValueList<QueryResult> SentenceChunk::translationsFromReference( uint reference ) //{ // //} -QValueList< uint > SentenceChunk::locationReferences( ) +TQValueList< uint > SentenceChunk::locationReferences( ) { } -void SentenceChunk::setLocationReferences( QValueList< uint > ) +void SentenceChunk::setLocationReferences( TQValueList< uint > ) { } -QPtrList< AbstractChunk> WordChunkFactory::chunks() +TQPtrList< AbstractChunk> WordChunkFactory::chunks() { - QString str=di->simple(string); - QPtrList<AbstractChunk> list; + TQString str=di->simple(string); + TQPtrList<AbstractChunk> list; if(str.isEmpty()) return list; _separators.clear(); kdDebug(0) << "Word chunks of:" <<str << endl; int pos; - QString sep; - QRegExp r("(\\s)"); + TQString sep; + TQRegExp r("(\\s)"); do { pos=r.search(str); @@ -120,10 +120,10 @@ QPtrList< AbstractChunk> WordChunkFactory::chunks() -QPtrList<AbstractChunk> SentenceChunkFactory::chunks() +TQPtrList<AbstractChunk> SentenceChunkFactory::chunks() { - QString str=string; - QPtrList<AbstractChunk> list; + TQString str=string; + TQPtrList<AbstractChunk> list; if(str.isEmpty()) return list; // kdDebug(0) << s << endl; @@ -132,9 +132,9 @@ QPtrList<AbstractChunk> SentenceChunkFactory::chunks() do { - QRegExp re("((\\.|;|\\?|\\!|:)( |$|\\\\n\\n))"); + TQRegExp re("((\\.|;|\\?|\\!|:)( |$|\\\\n\\n))"); pos=re.search(str); - QString sep=re.cap(1); + TQString sep=re.cap(1); if(!str.left(pos).isEmpty()) { @@ -154,14 +154,14 @@ QPtrList<AbstractChunk> SentenceChunkFactory::chunks() return list; } -QPtrList< AbstractChunk > CaseBasedWordChunkFactory::chunks( ) +TQPtrList< AbstractChunk > CaseBasedWordChunkFactory::chunks( ) { - QString str=string; - QPtrList<AbstractChunk> list; + TQString str=string; + TQPtrList<AbstractChunk> list; if(str.isEmpty()) return list; uint slen=str.length(); kdDebug(0) << "CaseWordChunk string:" << str << endl; - QString tmpWord; + TQString tmpWord; bool upcase; for(uint i=0;i<=slen;i++) { diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/chunk.h b/kbabel/kbabeldict/modules/dbsearchengine2/chunk.h index 5c5fcb93..2578e59e 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/chunk.h +++ b/kbabel/kbabeldict/modules/dbsearchengine2/chunk.h @@ -11,8 +11,8 @@ // #ifndef DBSE2_CHUNK_H #define DBSE2_CHUNK_H -#include <qstring.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqvaluelist.h> #include "database.h" /** @@ -29,13 +29,13 @@ class AbstractChunk /** * This function should return a list of translation for the current chunk. */ - virtual QValueList<QueryResult> translations()=0; + virtual TQValueList<QueryResult> translations()=0; //FIXME: is this in the right place, better in factory? check that stuff - //virtual QValueList<QueryResult> translationsFromReference(uint reference)=0; - virtual QValueList<uint> locationReferences()=0; - virtual void setLocationReferences(QValueList<uint>)=0; - virtual QString chunkString()=0; + //virtual TQValueList<QueryResult> translationsFromReference(uint reference)=0; + virtual TQValueList<uint> locationReferences()=0; + virtual void setLocationReferences(TQValueList<uint>)=0; + virtual TQString chunkString()=0; protected: DataBaseInterface *di; @@ -47,16 +47,16 @@ class AbstractChunk class WordChunk : public AbstractChunk { public: - WordChunk(DataBaseInterface *di,QString _word); - virtual QValueList<QueryResult> translations(); - //virtual QValueList<QueryResult> translationsFromReference(uint reference); - virtual QValueList<uint> locationReferences(); - virtual void setLocationReferences(QValueList<uint>); - virtual QString chunkString(){return word;} + WordChunk(DataBaseInterface *di,TQString _word); + virtual TQValueList<QueryResult> translations(); + //virtual TQValueList<QueryResult> translationsFromReference(uint reference); + virtual TQValueList<uint> locationReferences(); + virtual void setLocationReferences(TQValueList<uint>); + virtual TQString chunkString(){return word;} - //static QValueList<WordChunk> divide(QString); + //static TQValueList<WordChunk> divide(TQString); private: - QString word; + TQString word; }; /** @@ -65,17 +65,17 @@ class WordChunk : public AbstractChunk class SentenceChunk : public AbstractChunk { public: - SentenceChunk(DataBaseInterface *di,QString _sentence); - virtual QValueList<QueryResult> translations(); - //virtual QValueList<QueryResult> translationsFromReference(uint reference); - virtual QValueList<uint> locationReferences(); - virtual void setLocationReferences(QValueList<uint>); - virtual QString chunkString(){return sentence;} + SentenceChunk(DataBaseInterface *di,TQString _sentence); + virtual TQValueList<QueryResult> translations(); + //virtual TQValueList<QueryResult> translationsFromReference(uint reference); + virtual TQValueList<uint> locationReferences(); + virtual void setLocationReferences(TQValueList<uint>); + virtual TQString chunkString(){return sentence;} - // static QValueList<SentenceChunk> divide(QString); + // static TQValueList<SentenceChunk> divide(TQString); private: - QString sentence; + TQString sentence; }; @@ -92,11 +92,11 @@ class AbstractChunkFactory di=_di; } virtual ~AbstractChunkFactory(){} - virtual QPtrList<AbstractChunk> chunks()=0; + virtual TQPtrList<AbstractChunk> chunks()=0; /** Change th string and return the chunks */ - virtual QPtrList<AbstractChunk> chunks(const QString& s) + virtual TQPtrList<AbstractChunk> chunks(const TQString& s) { string=s; return chunks(); @@ -105,14 +105,14 @@ class AbstractChunkFactory * Returns the list of separators of last @ref chunks() call */ - virtual QStringList separators(){ return _separators;} - void setQuery(const QString& s) + virtual TQStringList separators(){ return _separators;} + void setQuery(const TQString& s) { string=s; } protected: - QString string; - QStringList _separators; + TQString string; + TQStringList _separators; DataBaseInterface *di; }; @@ -123,7 +123,7 @@ class WordChunkFactory : public AbstractChunkFactory /** YOU SHOULD DELETE THE CHUNKS!! */ - virtual QPtrList<AbstractChunk> chunks(); + virtual TQPtrList<AbstractChunk> chunks(); }; class CaseBasedWordChunkFactory : public AbstractChunkFactory @@ -133,7 +133,7 @@ class CaseBasedWordChunkFactory : public AbstractChunkFactory /** YOU SHOULD DELETE THE CHUNKS!! */ - virtual QPtrList<AbstractChunk> chunks(); + virtual TQPtrList<AbstractChunk> chunks(); }; class SentenceChunkFactory : public AbstractChunkFactory @@ -144,7 +144,7 @@ class SentenceChunkFactory : public AbstractChunkFactory /** YOU SHOULD DELETE THE CHUNKS!! */ - virtual QPtrList<AbstractChunk> chunks(); + virtual TQPtrList<AbstractChunk> chunks(); }; diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp index ea0e8379..0631f7ad 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp @@ -8,8 +8,8 @@ License: GPLv2 #include <math.h> #include "database.h" -#include <qregexp.h> -#include <qdict.h> +#include <tqregexp.h> +#include <tqdict.h> #include <kapplication.h> #include <kdebug.h> #include <kmessagebox.h> @@ -21,7 +21,7 @@ License: GPLv2 -DataBase::DataBase(QString dbpath,QString dbname, QString dblang) : Db(0,DB_CXX_NO_EXCEPTIONS) +DataBase::DataBase(TQString dbpath,TQString dbname, TQString dblang) : Db(0,DB_CXX_NO_EXCEPTIONS) { filename=dbpath+"."+dblang+".db"; @@ -59,11 +59,11 @@ unsigned int DataBase::getLast() -QueryResult::QueryResult(QString r) +QueryResult::QueryResult(TQString r) { res=r; } -QueryResult::QueryResult(QString r,QString o,int s) +QueryResult::QueryResult(TQString r,TQString o,int s) { res=r; richr=r; @@ -80,7 +80,7 @@ QueryResult::QueryResult() -DataBaseInterface::DataBaseInterface(QString dir, DBSESettings *sets) +DataBaseInterface::DataBaseInterface(TQString dir, DBSESettings *sets) { //FIXME Better db names!! @@ -125,7 +125,7 @@ DataBaseInterface::~DataBaseInterface() } -DataBase *DataBaseInterface::openMyDataBase(const QString& prefix,const QString& name,const QString& l,DBTYPE tt) +DataBase *DataBaseInterface::openMyDataBase(const TQString& prefix,const TQString& name,const TQString& l,DBTYPE tt) { DataBase *aDb = new DataBase(prefix,name,l); @@ -163,7 +163,7 @@ DataBase *DataBaseInterface::openMyDataBase(const QString& prefix,const QString& */ -DataBaseInterface::MainEntry DataBaseInterface::get(const QString& query,SearchFilter *filter) +DataBaseInterface::MainEntry DataBaseInterface::get(const TQString& query,SearchFilter *filter) { static int counter=1; counter++; @@ -184,11 +184,11 @@ DataBaseInterface::MainEntry DataBaseInterface::get(const QString& query,SearchF */ -bool DataBaseInterface::addEntry(QString original,QString translated,InputInfo *info) +bool DataBaseInterface::addEntry(TQString original,TQString translated,InputInfo *info) { DBItemMainKey mk(original); DBItemMainData md; - QMap<QString, int> correlationDiff; + TQMap<TQString, int> correlationDiff; bool newentry=false; //try to get kdDebug(0) << "Inserting the pair:" << endl; @@ -220,8 +220,8 @@ bool DataBaseInterface::addEntry(QString original,QString translated,InputInfo * alpha->put(&ka,&in); kdDebug(0) << "Updating the word index " << endl; //Update words index - QStringList ws=words(original); - for(QStringList::iterator it = ws.begin(); it!=ws.end(); ++it) + TQStringList ws=words(original); + for(TQStringList::iterator it = ws.begin(); it!=ws.end(); ++it) { DBItemMainKey word(*it); DBItemMultiIndex win; @@ -240,8 +240,8 @@ bool DataBaseInterface::addEntry(QString original,QString translated,InputInfo * //Update sentence index - QStringList so=sentences(original); - QStringList st=sentences(translated); + TQStringList so=sentences(original); + TQStringList st=sentences(translated); if(so.count()==st.count() && st.count() >1 ) //we already hav a database for single string. { kdDebug(0) << "inside sentence loop" << endl; @@ -276,11 +276,11 @@ bool DataBaseInterface::addEntry(QString original,QString translated,InputInfo * if(!translated.isEmpty()) { //loop on all translations to update correlation - QStringList tmpTranslations=md.getTranslations(); - for(QStringList::iterator otIt=tmpTranslations.begin(); otIt!=tmpTranslations.end();++otIt) + TQStringList tmpTranslations=md.getTranslations(); + for(TQStringList::iterator otIt=tmpTranslations.begin(); otIt!=tmpTranslations.end();++otIt) { - QStringList wt=words(*otIt); - for(QStringList::iterator it = wt.begin(); it!=wt.end(); ++it) + TQStringList wt=words(*otIt); + for(TQStringList::iterator it = wt.begin(); it!=wt.end(); ++it) { if(correlationDiff.contains(*it)) correlationDiff[*it]--; @@ -294,10 +294,10 @@ bool DataBaseInterface::addEntry(QString original,QString translated,InputInfo * md.addTranslation(translated,info->ref()); tmpTranslations=md.getTranslations(); - for(QStringList::iterator otIt=tmpTranslations.begin(); otIt!=tmpTranslations.end();++otIt) + for(TQStringList::iterator otIt=tmpTranslations.begin(); otIt!=tmpTranslations.end();++otIt) { - QStringList wt=words(*otIt); - for(QStringList::iterator it = wt.begin(); it!=wt.end(); ++it) + TQStringList wt=words(*otIt); + for(TQStringList::iterator it = wt.begin(); it!=wt.end(); ++it) { if(correlationDiff.contains(*it)) correlationDiff[*it]++; @@ -316,7 +316,7 @@ bool DataBaseInterface::addEntry(QString original,QString translated,InputInfo * } -bool DataBaseInterface::removeEntry(QString original) +bool DataBaseInterface::removeEntry(TQString original) { DBItemMainKey mk(original); DBItemMainData md; @@ -346,8 +346,8 @@ bool DataBaseInterface::removeEntry(QString original) alpha->put(&ka,&in); //Update words index - QStringList ws=words(original); - for(QStringList::iterator it = ws.begin(); it!=ws.end(); it++) + TQStringList ws=words(original); + for(TQStringList::iterator it = ws.begin(); it!=ws.end(); it++) { DBItemMainKey word(*it); DBItemMultiIndex win; @@ -357,8 +357,8 @@ bool DataBaseInterface::removeEntry(QString original) } //Update sentence index - QStringList so=sentences(original); - QStringList st=sentences(translated); + TQStringList so=sentences(original); + TQStringList st=sentences(translated); if(so.count()==st.count() && st.count() >1 ) //we already hav a database for single string. { for(int i=0; i< so.count() ; i++) @@ -380,16 +380,16 @@ bool DataBaseInterface::removeEntry(QString original) -QMap<QString,float> DataBaseInterface::correlation(QString word,SearchFilter *filter,bool notify, float minSign) +TQMap<TQString,float> DataBaseInterface::correlation(TQString word,SearchFilter *filter,bool notify, float minSign) { - QDict<unsigned int> res; + TQDict<unsigned int> res; // res.setAutoDelete(true); - QMap<QString, float>final; + TQMap<TQString, float>final; DBItemMultiIndex::IndexList il; unsigned int tot=0; unsigned int background=0; unsigned int nocck; - QString sword=simple(word); + TQString sword=simple(word); DBItemMainKey *k = new DBItemMainKey(sword); DBItemMultiIndex *d = new DBItemMultiIndex(); if(wordsindex->get(k,d)!=DB_NOTFOUND) @@ -398,29 +398,29 @@ QMap<QString,float> DataBaseInterface::correlation(QString word,SearchFilter *fi il=d->getList(); kdDebug(0) << il.count()<<endl; tot=0; - for(QValueList<unsigned int>::iterator it=il.begin();it!=il.end();++it) + for(TQValueList<unsigned int>::iterator it=il.begin();it!=il.end();++it) { numindex->get(*it,k); - // QValueList<QueryResult> trad=exactMatch(k->getString(),filter); + // TQValueList<QueryResult> trad=exactMatch(k->getString(),filter); MainEntry e=get(k->getString(),filter); - QStringList trad=e.second.getTranslations(); + TQStringList trad=e.second.getTranslations(); nocck=words(k->getString()).contains(sword); - for( QStringList::iterator it2=trad.begin();it2!=trad.end();++it2) + for( TQStringList::iterator it2=trad.begin();it2!=trad.end();++it2) { - QStringList w=words(*it2); + TQStringList w=words(*it2); unsigned int numWords = w.count()*10+1; unsigned int wei=100000/sqrt(numWords); //weight (is the best one?) background+=(numWords-nocck)*wei; - QDict<uint> count; + TQDict<uint> count; //count.setAutoDelete(true); //FIXME:SET AUTODELETE FOR ALL DICTS - for(QStringList::iterator it1=w.begin();it1!=w.end();it1++) + for(TQStringList::iterator it1=w.begin();it1!=w.end();it1++) { uint *ip; if(!(ip=count[*it1])) count.insert(*it1,new uint(1)); @@ -428,7 +428,7 @@ QMap<QString,float> DataBaseInterface::correlation(QString word,SearchFilter *fi (*ip)++; } - for(QStringList::iterator it1=w.begin();it1!=w.end();it1++) + for(TQStringList::iterator it1=w.begin();it1!=w.end();it1++) { uint *ip; if(*(count[*it1])==nocck) //add only if same number of entry (it cuts articles) @@ -442,7 +442,7 @@ QMap<QString,float> DataBaseInterface::correlation(QString word,SearchFilter *fi unsigned int sqrBG=sqrt((1.0*background+1)/10000); - for(QDictIterator<uint> it(res) ; it.current(); ++it) + for(TQDictIterator<uint> it(res) ; it.current(); ++it) { float sign=1.0*(*(it.current()))/(10000.0*sqrBG); if(sign >minSign){ @@ -457,15 +457,15 @@ QMap<QString,float> DataBaseInterface::correlation(QString word,SearchFilter *fi return final; } -QStringList DataBaseInterface::words(QString s) +TQStringList DataBaseInterface::words(TQString s) { - QString str=simple(s); - QStringList list; + TQString str=simple(s); + TQStringList list; int pos; do { - pos=str.find(QRegExp("\\s")); + pos=str.find(TQRegExp("\\s")); // if(!simple(str.left(pos)).isEmpty()) // list.append(simple(str.left(pos))); if(!str.left(pos).isEmpty()) @@ -476,24 +476,24 @@ QStringList DataBaseInterface::words(QString s) return list; } -QString DataBaseInterface::simple(QString str,bool ck) +TQString DataBaseInterface::simple(TQString str,bool ck) { - QString res; + TQString res; if(ck) res=str; //case keep else res=str.lower(); //lowercase //FIXME: uncoment the foll. line (check speed) - res=res.replace(QRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3"); //remove enclosing tags + res=res.replace(TQRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3"); //remove enclosing tags //Try to get rid of regexps. - // res=res.replace(QRegExp("(('|-|_|\\s|[^\\w%])+)")," "); //strip non-word char - // res=res.replace(QRegExp("(('|-|_)+)")," "); //strip non-word char - // res=res.replace(QRegExp("[^\\w\\s%]"),""); //strip non-word char + // res=res.replace(TQRegExp("(('|-|_|\\s|[^\\w%])+)")," "); //strip non-word char + // res=res.replace(TQRegExp("(('|-|_)+)")," "); //strip non-word char + // res=res.replace(TQRegExp("[^\\w\\s%]"),""); //strip non-word char - QString r; - QChar c; + TQString r; + TQChar c; bool wasSpace=true; uint len=res.length(); for(uint i=0; i<len;i++) @@ -540,10 +540,10 @@ QString DataBaseInterface::simple(QString str,bool ck) return res; } -QStringList DataBaseInterface::sentences(QString s) +TQStringList DataBaseInterface::sentences(TQString s) { - QString str=s; - QStringList list; + TQString str=s; + TQStringList list; // kdDebug(0) << s << endl; @@ -551,7 +551,7 @@ QStringList DataBaseInterface::sentences(QString s) do { - QRegExp re("((\\.|;|\\?|\\!|:)( |$|\\\\n\\n))"); + TQRegExp re("((\\.|;|\\?|\\!|:)( |$|\\\\n\\n))"); pos=re.search(str); if(!str.left(pos).isEmpty()) list.append(str.left(pos).stripWhiteSpace()); @@ -565,20 +565,20 @@ QStringList DataBaseInterface::sentences(QString s) return list; } -QStringList DataBaseInterface::sentencesSeparator(QString s) +TQStringList DataBaseInterface::sentencesSeparator(TQString s) { - QString str=s; - QStringList list; + TQString str=s; + TQStringList list; // kdDebug(0) << s << endl; int pos; do { - QRegExp re; + TQRegExp re; re.setPattern("([.:?!;]( |$|\\\\n\\n))"); pos = re.search(str); - QString separator=re.cap(1); + TQString separator=re.cap(1); if(pos!=-1){ list.append(separator); } @@ -589,26 +589,26 @@ QStringList DataBaseInterface::sentencesSeparator(QString s) return list; } -bool DataBaseInterface::isUpper(QChar s) +bool DataBaseInterface::isUpper(TQChar s) { return s==s.upper(); } -bool DataBaseInterface::isLower(QChar s) +bool DataBaseInterface::isLower(TQChar s) { return s==s.lower(); } -QString DataBaseInterface::format(QString _s,QString t) +TQString DataBaseInterface::format(TQString _s,TQString t) { //FIXME use settings //FIXME use regexp - QString s=_s; - QString noTagT=t.replace(QRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3"); - QChar first=noTagT[noTagT.find(QRegExp("\\w"))]; + TQString s=_s; + TQString noTagT=t.replace(TQRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3"); + TQChar first=noTagT[noTagT.find(TQRegExp("\\w"))]; bool firstCapital=isUpper(first); /* @@ -643,9 +643,9 @@ if(columnAtEnd) if(allupper) s=s.upper(); - int pos=t.find(QRegExp("&")); + int pos=t.find(TQRegExp("&")); if(pos>=0) { - QChar accel=t[t.find(QRegExp("&"))+1]; + TQChar accel=t[t.find(TQRegExp("&"))+1]; if(accel!='&') { @@ -667,32 +667,32 @@ if(columnAtEnd) } -QString DataBaseInterface::formatRegExp(QString _s, QString t, QString tre,QString stringSearch,QString stringReplace) +TQString DataBaseInterface::formatRegExp(TQString _s, TQString t, TQString tre,TQString stringSearch,TQString stringReplace) { - QString s=_s; - QRegExp templateRegExp(tre); - //QString stringSearch = "(.*)!@CAP1@$"; // use @CAP1.. fot caps in templates - //QString stringReplace = "\\1@CAP1@"; // use \1, \2 for caps in str and @CAP1 fot caps in template + TQString s=_s; + TQRegExp templateRegExp(tre); + //TQString stringSearch = "(.*)!@CAP1@$"; // use @CAP1.. fot caps in templates + //TQString stringReplace = "\\1@CAP1@"; // use \1, \2 for caps in str and @CAP1 fot caps in template if(templateRegExp.exactMatch(t)) { - QStringList caps=templateRegExp.capturedTexts(); + TQStringList caps=templateRegExp.capturedTexts(); int i=0; - for(QStringList::iterator capit=caps.begin();capit!=caps.end();++capit) + for(TQStringList::iterator capit=caps.begin();capit!=caps.end();++capit) { - QString phRegExp="(?!\\\\)@CAP"+QString::number(i)+"@"; + TQString phRegExp="(?!\\\\)@CAP"+TQString::number(i)+"@"; //kdDebug(0) << "phRegExp: " << phRegExp << endl; //kdDebug(0) << "cap[" << i << "]: "<< *capit<< endl; - stringReplace = stringReplace.replace(QRegExp(phRegExp),*capit); - stringSearch = stringSearch.replace(QRegExp(phRegExp),*capit); + stringReplace = stringReplace.replace(TQRegExp(phRegExp),*capit); + stringSearch = stringSearch.replace(TQRegExp(phRegExp),*capit); i++; } // kdDebug(0) << "stringSearch " << stringSearch << endl; // kdDebug(0) << "stringReplace " << stringReplace << endl; - QRegExp stringSearchRegExp = QRegExp(stringSearch); + TQRegExp stringSearchRegExp = TQRegExp(stringSearch); // kdDebug(0) << "before: "<<s<<endl; s = s.replace(stringSearchRegExp,stringReplace); // kdDebug(0) << "after: "<<s<<endl; @@ -702,7 +702,7 @@ QString DataBaseInterface::formatRegExp(QString _s, QString t, QString tre,QStri return s; } -DBItemMultiIndex::IndexList DataBaseInterface::getAlpha( const QString & query ) +DBItemMultiIndex::IndexList DataBaseInterface::getAlpha( const TQString & query ) { DBItemMainKey *k = new DBItemMainKey(simple(query)); DBItemMultiIndex *d = new DBItemMultiIndex(); @@ -718,7 +718,7 @@ DataBaseInterface::MainEntry DataBaseInterface::getFromIndex( uint i ) return get(k.getString(),0); //FIXME: this is a BUG right now but the filter should be removed } -DataBaseInterface::MainEntry DataBaseInterface::getSentence( const QString & query ) +DataBaseInterface::MainEntry DataBaseInterface::getSentence( const TQString & query ) { static int counter=1; @@ -731,7 +731,7 @@ DataBaseInterface::MainEntry DataBaseInterface::getSentence( const QString & que } -DBItemMultiIndex::IndexList DataBaseInterface::getWordIndex( const QString & query ) +DBItemMultiIndex::IndexList DataBaseInterface::getWordIndex( const TQString & query ) { DBItemMainKey k = DBItemMainKey(query); DBItemMultiIndex d = DBItemMultiIndex(); @@ -740,7 +740,7 @@ DBItemMultiIndex::IndexList DataBaseInterface::getWordIndex( const QString & que } else { - QValueList<unsigned int> tmpList; + TQValueList<unsigned int> tmpList; return tmpList; } diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/database.h b/kbabel/kbabeldict/modules/dbsearchengine2/database.h index c447fa59..d6ed3482 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/database.h +++ b/kbabel/kbabeldict/modules/dbsearchengine2/database.h @@ -8,11 +8,11 @@ #ifndef DATABASE_2_H #define DATABASE_2_H -#include <qstring.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqvaluelist.h> #include <db4/db_cxx.h> -#include <qobject.h> -#include <qregexp.h> +#include <tqobject.h> +#include <tqregexp.h> #include "dbentries.h" @@ -43,7 +43,7 @@ public: class DataBase : Db { public: - DataBase(QString dbpath, QString dbname, QString dblang); + DataBase(TQString dbpath, TQString dbname, TQString dblang); int open(DBTYPE type,unsigned int flags=0); @@ -105,12 +105,12 @@ int get(DBItem * key,DBItem *data){ int close(unsigned int i) {return Db::close( i); } //For scrolling - // int getFirst(DBItem *key,DBItem *data,QString table); - // int getNext(DBItem *key,DBItem *data,QString table); - // bool isEnd(QString table); + // int getFirst(DBItem *key,DBItem *data,TQString table); + // int getNext(DBItem *key,DBItem *data,TQString table); + // bool isEnd(TQString table); private: - QString filename; - QString database; + TQString filename; + TQString database; DBTYPE mytype; }; @@ -122,26 +122,26 @@ class QueryResult //from DBInterface to KDBSearchEngine { public: QueryResult(); - QueryResult(QString r); - QueryResult(QString r,QString o,int s); - void setRichResult(QString r) { richr=r; } - void setRichOriginal(QString r) { richo=r; } + QueryResult(TQString r); + QueryResult(TQString r,TQString o,int s); + void setRichResult(TQString r) { richr=r; } + void setRichOriginal(TQString r) { richo=r; } - QString richResult() {return richr;} - QString richOriginal() {return richo;} + TQString richResult() {return richr;} + TQString richOriginal() {return richo;} - QString result(){ return res; } - QString original() {return orig; } + TQString result(){ return res; } + TQString original() {return orig; } int score() {return sco;} //info contains originalkey,catalog,date,author etc... ResultInfo info(){ResultInfo i; i.info="no info"; return i;} private: - QString res; - QString orig; - QString richr; - QString richo; + TQString res; + TQString orig; + TQString richr; + TQString richo; int sco; }; @@ -158,34 +158,34 @@ class DataBaseInterface : public QObject public: //move result list typedef to AbstractAlgorthm or somewhere else - typedef QValueList<QueryResult> ResultList; + typedef TQValueList<QueryResult> ResultList; typedef QPair<DBItemMainKey,DBItemMainData> MainEntry; - DataBaseInterface( QString dir, DBSESettings *sets); + DataBaseInterface( TQString dir, DBSESettings *sets); ~DataBaseInterface(); //Ask the Database to stop now. void stop(bool b=true) {_stopNow=b;} //Search words - ResultList wordsMatch(QString query,SearchFilter *filter=0,bool notify=true); + ResultList wordsMatch(TQString query,SearchFilter *filter=0,bool notify=true); //Edit database functions. //addEntry and sync all the tables - bool addEntry(QString original,QString translated,InputInfo *info); + bool addEntry(TQString original,TQString translated,InputInfo *info); //FIXME:implement me! - bool removeEntry(QString original); + bool removeEntry(TQString original); //FIXME: go persistent! - QMap<QString,float> correlation(QString word,SearchFilter *filter=0,bool notify=true,float minSign=0.2); + TQMap<TQString,float> correlation(TQString word,SearchFilter *filter=0,bool notify=true,float minSign=0.2); // Read the database - MainEntry get(const QString& query,SearchFilter *filter=0); + MainEntry get(const TQString& query,SearchFilter *filter=0); MainEntry getFromIndex(uint i); - DBItemMultiIndex::IndexList getAlpha(const QString& query); - DBItemMultiIndex::IndexList getWordIndex(const QString& query); - MainEntry getSentence(const QString& query); + DBItemMultiIndex::IndexList getAlpha(const TQString& query); + DBItemMultiIndex::IndexList getWordIndex(const TQString& query); + MainEntry getSentence(const TQString& query); //Database status check functions bool mainOk() {return main!=0;} @@ -206,7 +206,7 @@ class DataBaseInterface : public QObject DBSESettings *getSettings() {return settings;} private: - DataBase * openMyDataBase(const QString& prefix,const QString& name,const QString& l,DBTYPE tt); + DataBase * openMyDataBase(const TQString& prefix,const TQString& name,const TQString& l,DBTYPE tt); DataBase *main; DataBase *numindex; DataBase *wordsindex; @@ -222,14 +222,14 @@ class DataBaseInterface : public QObject //FIXME:Move to KBabel common library. public: - QString format( QString _s,QString t); - QString formatRegExp(QString _s, QString t, QString tre,QString stringSearch,QString stringReplace); - static QStringList words(QString s); - static QStringList sentences(QString s); - static QStringList sentencesSeparator(QString s); - static QString simple(QString str,bool ck=false); - static bool isUpper(QChar s); - static bool isLower(QChar s); + TQString format( TQString _s,TQString t); + TQString formatRegExp(TQString _s, TQString t, TQString tre,TQString stringSearch,TQString stringReplace); + static TQStringList words(TQString s); + static TQStringList sentences(TQString s); + static TQStringList sentencesSeparator(TQString s); + static TQString simple(TQString str,bool ck=false); + static bool isUpper(TQChar s); + static bool isLower(TQChar s); }; diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/dbentries.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/dbentries.cpp index 4f048f9c..efa7e44d 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/dbentries.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine2/dbentries.cpp @@ -1,12 +1,12 @@ #include "dbentries.h" -#include <qdatastream.h> +#include <tqdatastream.h> void DBItem::set() { - QBuffer b(mydata); + TQBuffer b(mydata); b.open( IO_WriteOnly ); - QDataStream s(&b); + TQDataStream s(&b); write(&s); b.close(); set_data(mydata.data()); @@ -18,7 +18,7 @@ void DBItem::set() mydata.resize(get_size()); mydata.duplicate((const char *)get_data(),(unsigned int)get_size()); - QDataStream *s = new QDataStream(mydata,IO_ReadOnly); + TQDataStream *s = new TQDataStream(mydata,IO_ReadOnly); read(s); delete s; } @@ -31,18 +31,18 @@ DBItemMainKey::DBItemMainKey() //set(); } -DBItemMainKey::DBItemMainKey(QString searchstring) +DBItemMainKey::DBItemMainKey(TQString searchstring) { sstr=searchstring; //set(); } -void DBItemMainKey::read(QDataStream *s) +void DBItemMainKey::read(TQDataStream *s) { *s >> sstr; } -void DBItemMainKey::write(QDataStream *s) +void DBItemMainKey::write(TQDataStream *s) { *s << sstr; } @@ -64,17 +64,17 @@ void DBItemMainData::clear() //set(); } -void DBItemMainData::read(QDataStream *s) +void DBItemMainData::read(TQDataStream *s) { *s >> indexnumber >> translations; } -void DBItemMainData::write(QDataStream *s) +void DBItemMainData::write(TQDataStream *s) { *s << (Q_UINT32)indexnumber << translations; } -void DBItemMainData::addTranslation(QString str, unsigned int ref) +void DBItemMainData::addTranslation(TQString str, unsigned int ref) { //get(); if(translations[str].find(ref)==translations[str].end()) // If it do not exists @@ -87,7 +87,7 @@ void DBItemMainData::addTranslation(QString str, unsigned int ref) } -void DBItemMainData::removeTranslation(QString str, unsigned int ref) +void DBItemMainData::removeTranslation(TQString str, unsigned int ref) { //get(); translations[str].remove(ref); @@ -100,8 +100,8 @@ void DBItemMainData::removeTranslation(QString str, unsigned int ref) void DBItemMainData::removeRef( unsigned int ref) { //get(); -QMapIterator<QString,QValueList<unsigned int> > it2; - for(QMapIterator<QString,QValueList<unsigned int> > it = translations.begin(); +TQMapIterator<TQString,TQValueList<unsigned int> > it2; + for(TQMapIterator<TQString,TQValueList<unsigned int> > it = translations.begin(); it!= translations.end(); /* it++*/) { //Dirty hack it2=it; @@ -113,11 +113,11 @@ QMapIterator<QString,QValueList<unsigned int> > it2; //set(); } -QStringList DBItemMainData::getTranslations() +TQStringList DBItemMainData::getTranslations() { //get(); -QStringList result; - for(QMapIterator<QString,QValueList<unsigned int> > it = translations.begin(); +TQStringList result; + for(TQMapIterator<TQString,TQValueList<unsigned int> > it = translations.begin(); it!= translations.end(); it++) result.append(it.key()); @@ -125,7 +125,7 @@ return result; } -QValueList<unsigned int> DBItemMainData::getReferences(QString str) +TQValueList<unsigned int> DBItemMainData::getReferences(TQString str) { //get(); return translations[str]; //this also add a "str" entry but we do not call set()! @@ -160,12 +160,12 @@ void DBItemMultiIndex::removeEntry(unsigned int index) } -void DBItemMultiIndex::read(QDataStream *s) +void DBItemMultiIndex::read(TQDataStream *s) { *s >> list; } -void DBItemMultiIndex::write(QDataStream *s) +void DBItemMultiIndex::write(TQDataStream *s) { *s << list; } diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/dbentries.h b/kbabel/kbabeldict/modules/dbsearchengine2/dbentries.h index 0a40878c..c4410ade 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/dbentries.h +++ b/kbabel/kbabeldict/modules/dbsearchengine2/dbentries.h @@ -2,19 +2,19 @@ #define DBENTRIES_H #include <db4/db_cxx.h> -#include <qstring.h> -#include <qbuffer.h> -#include <qmap.h> -#include <qstringlist.h> -#include <qdatetime.h> +#include <tqstring.h> +#include <tqbuffer.h> +#include <tqmap.h> +#include <tqstringlist.h> +#include <tqdatetime.h> class CatalogInfo { - QString author; - QDateTime datetime; - QString filename; - QString filepath; + TQString author; + TQDateTime datetime; + TQString filename; + TQString filepath; }; @@ -23,13 +23,13 @@ class ResultInfo { public: //Common info - QString original; //placeholder + TQString original; //placeholder // //Multi reference info - QValueList<CatalogInfo> catalogs; + TQValueList<CatalogInfo> catalogs; - QString info; + TQString info; }; @@ -54,9 +54,9 @@ public: protected: - virtual void read(QDataStream *s) = 0; - virtual void write(QDataStream *s) = 0; - QByteArray mydata; + virtual void read(TQDataStream *s) = 0; + virtual void write(TQDataStream *s) = 0; + TQByteArray mydata; bool empty; }; @@ -65,17 +65,17 @@ class DBItemMainKey : public DBItem { public: DBItemMainKey(); - DBItemMainKey(QString searchstring); + DBItemMainKey(TQString searchstring); - QString getString(){ return sstr;} + TQString getString(){ return sstr;} private: - virtual void read(QDataStream *s); - virtual void write(QDataStream *s); + virtual void read(TQDataStream *s); + virtual void write(TQDataStream *s); - QString sstr; + TQString sstr; }; @@ -84,21 +84,21 @@ class DBItemMainData : public DBItem { public: - typedef QMapIterator<QString,QValueList<unsigned int> > TranslationIterator; - typedef QMap<QString,QValueList<unsigned int> > TranslationMap; + typedef TQMapIterator<TQString,TQValueList<unsigned int> > TranslationIterator; + typedef TQMap<TQString,TQValueList<unsigned int> > TranslationMap; DBItemMainData(); - QStringList getTranslations(); - QValueList<unsigned int> getReferences(QString str); + TQStringList getTranslations(); + TQValueList<unsigned int> getReferences(TQString str); void clear(); //Add a translation with reference ref, if translation exists append // ref to the list of references - void addTranslation(QString str,unsigned int ref); - void removeTranslation(QString str,unsigned int ref); + void addTranslation(TQString str,unsigned int ref); + void removeTranslation(TQString str,unsigned int ref); //remove any reference to ref, if ref is the only reference of a translation // the translation is removed @@ -109,8 +109,8 @@ class DBItemMainData : public DBItem private: - virtual void read(QDataStream *s); - virtual void write(QDataStream *s); + virtual void read(TQDataStream *s); + virtual void write(TQDataStream *s); unsigned int indexnumber; TranslationMap translations; @@ -121,7 +121,7 @@ private: class DBItemMultiIndex : public DBItem { public: - typedef QValueList<unsigned int> IndexList; + typedef TQValueList<unsigned int> IndexList; DBItemMultiIndex(); // DBItemMultiIndex(IndexList l); @@ -134,8 +134,8 @@ class DBItemMultiIndex : public DBItem private: - virtual void read(QDataStream *s); - virtual void write(QDataStream *s); + virtual void read(TQDataStream *s); + virtual void write(TQDataStream *s); IndexList list; diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/dbscan.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/dbscan.cpp index b19b2db2..7c2d8564 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/dbscan.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine2/dbscan.cpp @@ -18,8 +18,8 @@ */ #include "dbscan.h" #include <kconfig.h> -#include <qdir.h> -#include <qfile.h> +#include <tqdir.h> +#include <tqfile.h> #include <kapplication.h> #include <kurl.h> #include <kdebug.h> @@ -69,9 +69,9 @@ void MessagesSource::getDialogValues(SourceDialog *sd) type=sd->type->currentItem(); } -QValueList<KURL> MessagesSource::urls() +TQValueList<KURL> MessagesSource::urls() { - QValueList<KURL> urlList; + TQValueList<KURL> urlList; if(type==0) urlList.append(location); if(type==1|| type==2) @@ -81,18 +81,18 @@ QValueList<KURL> MessagesSource::urls() } -QValueList<KURL> MessagesSource::filesInDir(KURL url,bool recursive) +TQValueList<KURL> MessagesSource::filesInDir(KURL url,bool recursive) { - QValueList<KURL> result; - QDir d(url.path()); + TQValueList<KURL> result; + TQDir d(url.path()); d.setMatchAllDirs(true); kdDebug(0) << d.count() << " files in dir "<< url.path()<<endl; const QFileInfoList* files = d.entryInfoList(); kdDebug(0) << files << endl; - // QPtrListIterator<QFileInfo> it(*files); + // TQPtrListIterator<TQFileInfo> it(*files); if(files){ - for (QPtrListIterator<QFileInfo> fileit(*files); !fileit.atLast(); ++fileit ) + for (TQPtrListIterator<TQFileInfo> fileit(*files); !fileit.atLast(); ++fileit ) { if ((*fileit)->isDir()) { @@ -120,14 +120,14 @@ QValueList<KURL> MessagesSource::filesInDir(KURL url,bool recursive) //FIXME: clean this class PoScanner::PoScanner(DataBaseInterface *dbi, - QObject *parent,const char *name):QObject(parent,name) + TQObject *parent,const char *name):TQObject(parent,name) { di=dbi; removeOldCatalogTranslation=true; count=0; } -bool PoScanner::scanPattern(QString pathName,QString pattern,bool rec) +bool PoScanner::scanPattern(TQString pathName,TQString pattern,bool rec) { int tot; //Only one progress bar!! @@ -138,18 +138,18 @@ if (!called) { pb=true; count=0;} called=true; -kdDebug(0) << QString("Scanning: %1, %2").arg(pathName).arg(pattern) << endl; +kdDebug(0) << TQString("Scanning: %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++ ) { @@ -188,7 +188,7 @@ if(pb){called=false;count=0;} return true; } -bool PoScanner::scanFile(QString fileName) +bool PoScanner::scanFile(TQString fileName) { KURL u(fileName); return scanURL(u); @@ -202,10 +202,10 @@ emit fileStarted(); Catalog * catalog=new Catalog(this,"ScanPoCatalog"); -QString pretty=u.prettyURL(); -QString location=pretty.right(pretty.length()-pretty.findRev("/")-1); +TQString pretty=u.prettyURL(); +TQString location=pretty.right(pretty.length()-pretty.findRev("/")-1); -connect(catalog,SIGNAL(signalProgress(int)),this,SIGNAL(fileLoading(int))); +connect(catalog,TQT_SIGNAL(signalProgress(int)),this,TQT_SIGNAL(fileLoading(int))); emit filename(location); emit fileProgress(0); emit fileLoading(0); @@ -220,10 +220,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(""); +else author=TQString(""); //int catnum=dm->catalogRef(location,author,fileName); InputInfo ii; @@ -253,7 +253,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(); msgstr=catalog->msgstr(i).first(); res=di->addEntry(msgid,msgstr,&ii); @@ -264,7 +264,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/dbsearchengine2/dbscan.h b/kbabel/kbabeldict/modules/dbsearchengine2/dbscan.h index 990d556c..e4cdf7da 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/dbscan.h +++ b/kbabel/kbabeldict/modules/dbsearchengine2/dbscan.h @@ -48,10 +48,10 @@ class MessagesSource * It returns a list of urls to scan, the list contains single file if type is "SingleFile" * or a list of files if type is "SingleDir" or "RecDir" */ - QValueList<KURL> urls(); + TQValueList<KURL> urls(); private: - QValueList<KURL> filesInDir(KURL url,bool recursive); + TQValueList<KURL> filesInDir(KURL url,bool recursive); KURL location; // The source type "SingleFile" =0, "SingleDirectory"=1, "RecursiveDirectory"=2 @@ -63,9 +63,9 @@ class MessagesSource SearchFilter filter; - QString projectName; - QString projectKeywords; - QString status; + TQString projectName; + TQString projectKeywords; + TQString status; }; @@ -75,12 +75,12 @@ class PoScanner : public QObject public: - PoScanner(DataBaseInterface *dbi,QObject *parent=0,const char *name=0); + PoScanner(DataBaseInterface *dbi,TQObject *parent=0,const char *name=0); /* Scan a single PO file. */ - bool scanFile(QString fileName); + bool scanFile(TQString fileName); /* Scan a single URL file. @@ -91,7 +91,7 @@ class PoScanner : public QObject /* 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); @@ -105,7 +105,7 @@ class PoScanner : public QObject 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/dbsearchengine2/dbse2_factory.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/dbse2_factory.cpp index 9c286052..55f6a16f 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/dbse2_factory.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine2/dbse2_factory.cpp @@ -22,7 +22,7 @@ KInstance *DbSe2Factory::s_instance = 0; KAboutData *DbSe2Factory::s_about = 0; -DbSe2Factory::DbSe2Factory( QObject *parent, const char *name) +DbSe2Factory::DbSe2Factory( TQObject *parent, const char *name) : KLibFactory(parent,name) { } @@ -43,10 +43,10 @@ DbSe2Factory::~DbSe2Factory() } -QObject *DbSe2Factory::createObject( QObject *parent, const char *name, - const char *classname, const QStringList &) +TQObject *DbSe2Factory::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/dbsearchengine2/dbse2_factory.h b/kbabel/kbabeldict/modules/dbsearchengine2/dbse2_factory.h index 4285d53c..2b70184a 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/dbse2_factory.h +++ b/kbabel/kbabeldict/modules/dbsearchengine2/dbse2_factory.h @@ -9,12 +9,12 @@ class DbSe2Factory : public KLibFactory { Q_OBJECT public: - DbSe2Factory( QObject *parent=0, const char *name=0); + DbSe2Factory( TQObject *parent=0, const char *name=0); ~DbSe2Factory(); - 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/dbsearchengine2/preferenceswidget.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/preferenceswidget.cpp index 7634a799..76aef878 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/preferenceswidget.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine2/preferenceswidget.cpp @@ -1,13 +1,13 @@ -#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 <knuminput.h> @@ -15,11 +15,11 @@ #include "dbse2.h" #include "preferenceswidget.h" -KDB2PreferencesWidget::KDB2PreferencesWidget(QWidget *parent, const char* name) +KDB2PreferencesWidget::KDB2PreferencesWidget(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 DBSearchEnginePrefWidget(this); @@ -30,7 +30,7 @@ KDB2PreferencesWidget::KDB2PreferencesWidget(QWidget *parent, const char* name) standard(); -// connect(dbpw->browseTB_3,SIGNAL(clicked()),SLOT(browse1())); +// connect(dbpw->browseTB_3,TQT_SIGNAL(clicked()),TQT_SLOT(browse1())); emit restoreNow(); //Fill with actual params. @@ -52,7 +52,7 @@ emit restoreNow(); void KDB2PreferencesWidget::standard() { -QString defaultDir; +TQString defaultDir; KStandardDirs * dirs = KGlobal::dirs(); if(dirs) { diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/preferenceswidget.h b/kbabel/kbabeldict/modules/dbsearchengine2/preferenceswidget.h index 4714fd13..1f706902 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/preferenceswidget.h +++ b/kbabel/kbabeldict/modules/dbsearchengine2/preferenceswidget.h @@ -9,7 +9,7 @@ class KDB2PreferencesWidget : public PrefWidget Q_OBJECT public: - KDB2PreferencesWidget(QWidget *parent=0, const char* name=0); + KDB2PreferencesWidget(TQWidget *parent=0, const char* name=0); virtual ~KDB2PreferencesWidget(); virtual void apply(); diff --git a/kbabel/kbabeldict/modules/poauxiliary/pa_factory.cpp b/kbabel/kbabeldict/modules/poauxiliary/pa_factory.cpp index 1448e2b0..c8d8c1db 100644 --- a/kbabel/kbabeldict/modules/poauxiliary/pa_factory.cpp +++ b/kbabel/kbabeldict/modules/poauxiliary/pa_factory.cpp @@ -54,7 +54,7 @@ KInstance *PaFactory::s_instance = 0; KAboutData *PaFactory::s_about = 0; -PaFactory::PaFactory( QObject *parent, const char *name) +PaFactory::PaFactory( TQObject *parent, const char *name) : KLibFactory(parent,name) { } @@ -75,10 +75,10 @@ PaFactory::~PaFactory() } -QObject *PaFactory::createObject( QObject *parent, const char *name - , const char *classname, const QStringList &) +TQObject *PaFactory::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/poauxiliary/pa_factory.h b/kbabel/kbabeldict/modules/poauxiliary/pa_factory.h index 8871a538..901351c7 100644 --- a/kbabel/kbabeldict/modules/poauxiliary/pa_factory.h +++ b/kbabel/kbabeldict/modules/poauxiliary/pa_factory.h @@ -43,12 +43,12 @@ class PaFactory : public KLibFactory { Q_OBJECT public: - PaFactory( QObject *parent=0, const char *name=0); + PaFactory( TQObject *parent=0, const char *name=0); ~PaFactory(); - 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/poauxiliary/poauxiliary.cpp b/kbabel/kbabeldict/modules/poauxiliary/poauxiliary.cpp index 373f123d..eae86d65 100644 --- a/kbabel/kbabeldict/modules/poauxiliary/poauxiliary.cpp +++ b/kbabel/kbabeldict/modules/poauxiliary/poauxiliary.cpp @@ -37,9 +37,9 @@ #include <kglobal.h> #include <kinstance.h> -#include <qregexp.h> -#include <qtimer.h> -#include <qstylesheet.h> +#include <tqregexp.h> +#include <tqtimer.h> +#include <tqstylesheet.h> #include "poauxiliary.h" #include "preferenceswidget.h" @@ -50,7 +50,7 @@ using namespace KBabel; -PoAuxiliary::PoAuxiliary(QObject *parent, const char *name) +PoAuxiliary::PoAuxiliary(TQObject *parent, const char *name) : SearchEngine(parent, name) { catalog = new Catalog(this, "PoAuxiliary::catalog"); @@ -63,8 +63,8 @@ PoAuxiliary::PoAuxiliary(QObject *parent, const char *name) ignoreFuzzy=true; - loadTimer = new QTimer(this); - connect(loadTimer,SIGNAL(timeout()),this,SLOT(loadAuxiliary())); + loadTimer = new TQTimer(this); + connect(loadTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(loadAuxiliary())); msgidDict.setAutoDelete(true); } @@ -101,7 +101,7 @@ void PoAuxiliary::readSettings(KConfigBase *config) { bool needLoading=false; - QString newPath = config->readEntry("Auxiliary" + TQString newPath = config->readEntry("Auxiliary" ,"../../../de/messages/@DIR1@/@PACKAGE@.po"); if(!initialized) { @@ -124,12 +124,12 @@ void PoAuxiliary::readSettings(KConfigBase *config) restoreSettings(); } -PrefWidget *PoAuxiliary::preferencesWidget(QWidget *parent) +PrefWidget *PoAuxiliary::preferencesWidget(TQWidget *parent) { prefWidget = new AuxiliaryPreferencesWidget(parent,"pocompendium_prefwidget"); - connect(prefWidget, SIGNAL(applySettings()), this, SLOT(applySettings())); - connect(prefWidget, SIGNAL(restoreSettings()) - , this, SLOT(restoreSettings())); + connect(prefWidget, TQT_SIGNAL(applySettings()), this, TQT_SLOT(applySettings())); + connect(prefWidget, TQT_SIGNAL(restoreSettings()) + , this, TQT_SLOT(restoreSettings())); restoreSettings(); @@ -142,24 +142,24 @@ const KAboutData *PoAuxiliary::about() const } -QString PoAuxiliary::name() const +TQString PoAuxiliary::name() const { return i18n("PO Auxiliary"); } -QString PoAuxiliary::id() const +TQString PoAuxiliary::id() const { return "poauxiliary"; } -QString PoAuxiliary::lastError() +TQString PoAuxiliary::lastError() { return errorMsg; } -bool PoAuxiliary::startSearch(const QString& t, uint pluralForm, const SearchFilter*filter) +bool PoAuxiliary::startSearch(const TQString& t, uint pluralForm, const SearchFilter*filter) { - QString text(t); + TQString text(t); if(autoUpdate && prefWidget && prefWidget->settingsChanged()) { applySettings(); @@ -192,10 +192,10 @@ bool PoAuxiliary::startSearch(const QString& t, uint pluralForm, const SearchFil if( !(entry->fuzzy && ignoreFuzzy) ) { SearchResult *result = new SearchResult; - result->requested =QStyleSheet::convertFromPlainText(text); - result->found = QStyleSheet::convertFromPlainText(text); + result->requested =TQStyleSheet::convertFromPlainText(text); + result->found = TQStyleSheet::convertFromPlainText(text); result->translation = - QStyleSheet::convertFromPlainText(entry->translation); + TQStyleSheet::convertFromPlainText(entry->translation); result->plainRequested = text; result->plainFound=text; @@ -231,7 +231,7 @@ bool PoAuxiliary::startSearch(const QString& t, uint pluralForm, const SearchFil } -bool PoAuxiliary::startSearchInTranslation(const QString& text) +bool PoAuxiliary::startSearchInTranslation(const TQString& text) { if(autoUpdate && prefWidget && prefWidget->settingsChanged()) { @@ -263,10 +263,10 @@ bool PoAuxiliary::startSearchInTranslation(const QString& text) if( !(entry->fuzzy && ignoreFuzzy) ) { SearchResult *result = new SearchResult; - result->requested =QStyleSheet::convertFromPlainText(entry->orig); - result->found = QStyleSheet::convertFromPlainText(entry->orig); + result->requested =TQStyleSheet::convertFromPlainText(entry->orig); + result->found = TQStyleSheet::convertFromPlainText(entry->orig); result->translation = - QStyleSheet::convertFromPlainText(text); + TQStyleSheet::convertFromPlainText(text); result->plainRequested = entry->orig; result->plainFound=entry->orig; @@ -317,7 +317,7 @@ void PoAuxiliary::applySettings() if(isSearching()) stopSearch(); - QString newPath = prefWidget->url(); + TQString newPath = prefWidget->url(); if(!initialized) { url = newPath; @@ -356,7 +356,7 @@ void PoAuxiliary::loadAuxiliary() loading=true; error=false; - QString path=url; + TQString path=url; if(path.contains("@LANG@")) { @@ -370,14 +370,14 @@ void PoAuxiliary::loadAuxiliary() } if(path.contains("@PACKAGEDIR@")) { - QString packagedir; + TQString packagedir; int pos=package.findRev("/"); if( pos > 0 ) packagedir=package.left(pos); else packagedir=""; path.replace("@PACKAGEDIR@",packagedir); kdDebug(KBABEL_SEARCH) << "Packagedir found " << packagedir << endl; } - QRegExp reg("@DIR[0-9]+@"); + TQRegExp reg("@DIR[0-9]+@"); if(path.contains(reg)) { int pos=reg.search(path); @@ -385,14 +385,14 @@ void PoAuxiliary::loadAuxiliary() while(pos>=0) { - QString num=path.mid(pos+4,len-5); + TQString num=path.mid(pos+4,len-5); bool ok; int number=num.toInt(&ok); if(ok) { - QString dir=directory(editedFile,number); - QString s("@DIR%1@"); + TQString dir=directory(editedFile,number); + TQString s("@DIR%1@"); path.replace(s.arg(number),dir); pos+=dir.length(); @@ -404,7 +404,7 @@ void PoAuxiliary::loadAuxiliary() } KURL u; - QRegExp rel("^[a-zA-Z]+:"); + TQRegExp rel("^[a-zA-Z]+:"); if(rel.search(path) >= 0) { u=path; @@ -412,7 +412,7 @@ void PoAuxiliary::loadAuxiliary() else if(path[0] != '/') // relative path { KURL temp(editedFile); - QString dir = temp.directory(); + TQString dir = temp.directory(); kdDebug(KBABEL_SEARCH) << dir << endl; u.setPath(dir+"/"+path); u.cleanPath(); @@ -424,8 +424,8 @@ void PoAuxiliary::loadAuxiliary() } emit progressStarts(i18n("Loading PO auxiliary")); - connect(catalog, SIGNAL(signalProgress(int)) - , this, SIGNAL(progress(int))); + connect(catalog, TQT_SIGNAL(signalProgress(int)) + , this, TQT_SIGNAL(progress(int))); ConversionStatus stat = catalog->openURL(u); if( stat != OK && stat != RECOVERED_PARSE_ERROR) @@ -476,8 +476,8 @@ void PoAuxiliary::loadAuxiliary() auxTranslator = catalog->lastTranslator(); } - disconnect(catalog, SIGNAL(signalProgress(int)) - , this, SIGNAL(progress(int))); + disconnect(catalog, TQT_SIGNAL(signalProgress(int)) + , this, TQT_SIGNAL(progress(int))); emit progressEnds(); @@ -489,7 +489,7 @@ void PoAuxiliary::loadAuxiliary() } -void PoAuxiliary::setEditedFile(const QString& file) +void PoAuxiliary::setEditedFile(const TQString& file) { if(initialized && (url.contains("@DIR") || KURL::isRelativeURL(url)) && file!=editedFile && !loadTimer->isActive() ) @@ -501,7 +501,7 @@ void PoAuxiliary::setEditedFile(const QString& file) } -void PoAuxiliary::setEditedPackage(const QString& pack) +void PoAuxiliary::setEditedPackage(const TQString& pack) { if(initialized && url.contains("@PACKAGE@") && pack!=package && !loadTimer->isActive() ) @@ -513,7 +513,7 @@ void PoAuxiliary::setEditedPackage(const QString& pack) } -void PoAuxiliary::setLanguageCode(const QString& lang) +void PoAuxiliary::setLanguageCode(const TQString& lang) { if(initialized && url.contains("@LANG@") && lang!=langCode && !loadTimer->isActive() ) @@ -529,7 +529,7 @@ bool PoAuxiliary::usesRichTextResults() return true; } -QString PoAuxiliary::translate(const QString& text, uint pluralForm) +TQString PoAuxiliary::translate(const TQString& text, uint pluralForm) { if(!initialized) { @@ -538,7 +538,7 @@ QString PoAuxiliary::translate(const QString& text, uint pluralForm) if(error) { - return QString::null; + return TQString::null; } Entry *entry = msgidDict[text]; @@ -547,7 +547,7 @@ QString PoAuxiliary::translate(const QString& text, uint pluralForm) return entry->translation; } - return QString::null; + return TQString::null; } diff --git a/kbabel/kbabeldict/modules/poauxiliary/poauxiliary.h b/kbabel/kbabeldict/modules/poauxiliary/poauxiliary.h index 27fecba6..e0f4fe5d 100644 --- a/kbabel/kbabeldict/modules/poauxiliary/poauxiliary.h +++ b/kbabel/kbabeldict/modules/poauxiliary/poauxiliary.h @@ -36,8 +36,8 @@ #include "searchengine.h" -#include <qguardedptr.h> -#include <qdict.h> +#include <tqguardedptr.h> +#include <tqdict.h> class QTimer; namespace KBabel @@ -52,40 +52,40 @@ class PoAuxiliary : public SearchEngine Q_OBJECT public: - PoAuxiliary(QObject *parent=0, const char *name=0); + PoAuxiliary(TQObject *parent=0, const char *name=0); virtual ~PoAuxiliary(); virtual bool isReady() const; - virtual QString translate(const QString& text, uint pluralForm); + virtual TQString translate(const TQString& text, 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(); virtual bool usesRichTextResults(); public slots: - virtual bool startSearch(const QString& text, unsigned int pluralForm + virtual bool startSearch(const TQString& text, unsigned int pluralForm , const SearchFilter*filter); - virtual bool startSearchInTranslation(const QString& text); + virtual bool startSearchInTranslation(const TQString& text); virtual void stopSearch(); - virtual void setEditedFile(const QString&); - virtual void setEditedPackage(const QString&); - virtual void setLanguageCode(const QString&); + virtual void setEditedFile(const TQString&); + virtual void setEditedPackage(const TQString&); + virtual void setLanguageCode(const TQString&); protected slots: @@ -98,39 +98,39 @@ protected slots: void loadAuxiliary(); private: - QGuardedPtr<AuxiliaryPreferencesWidget> prefWidget; + TQGuardedPtr<AuxiliaryPreferencesWidget> prefWidget; KBabel::Catalog *catalog; - QString auxPackage; - QString auxTranslator; - QString auxURL; + TQString auxPackage; + TQString auxTranslator; + TQString auxURL; - QString url; + TQString url; bool ignoreFuzzy; - QString editedFile; - QString package; - QString langCode; + TQString editedFile; + TQString package; + TQString langCode; bool error; - QString errorMsg; + TQString errorMsg; bool stop; bool active; bool loading; bool initialized; - QTimer *loadTimer; + TQTimer *loadTimer; struct Entry { - QString orig; - QString translation; - QString comment; + TQString orig; + TQString translation; + TQString comment; bool fuzzy; }; - QDict<Entry> msgidDict; - QDict<Entry> msgstrDict; + TQDict<Entry> msgidDict; + TQDict<Entry> msgstrDict; }; #endif diff --git a/kbabel/kbabeldict/modules/poauxiliary/preferenceswidget.cpp b/kbabel/kbabeldict/modules/poauxiliary/preferenceswidget.cpp index e8d48032..5a534ecf 100644 --- a/kbabel/kbabeldict/modules/poauxiliary/preferenceswidget.cpp +++ b/kbabel/kbabeldict/modules/poauxiliary/preferenceswidget.cpp @@ -30,12 +30,12 @@ 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 <tqpushbutton.h> #include <klineedit.h> #include <klocale.h> #include <kurlrequester.h> @@ -43,18 +43,18 @@ #include "preferenceswidget.h" #include "pwidget.h" -AuxiliaryPreferencesWidget::AuxiliaryPreferencesWidget(QWidget *parent, const char* name) +AuxiliaryPreferencesWidget::AuxiliaryPreferencesWidget(TQWidget *parent, const char* name) : PrefWidget(parent,name) , changed(false) { - QVBoxLayout *layout = new QVBoxLayout(this); + TQVBoxLayout *layout = new TQVBoxLayout(this); prefWidget = new PWidget(this); layout->addWidget(prefWidget); - connect(prefWidget->urlInput->lineEdit(),SIGNAL(textChanged(const QString&)) - , this, SLOT(setChanged())); + connect(prefWidget->urlInput->lineEdit(),TQT_SIGNAL(textChanged(const TQString&)) + , this, TQT_SLOT(setChanged())); } AuxiliaryPreferencesWidget::~AuxiliaryPreferencesWidget() @@ -78,13 +78,13 @@ void AuxiliaryPreferencesWidget::standard() changed=true; } -void AuxiliaryPreferencesWidget::setURL(const QString url) +void AuxiliaryPreferencesWidget::setURL(const TQString url) { prefWidget->urlInput->setURL(url); changed=false; } -QString AuxiliaryPreferencesWidget::url() +TQString AuxiliaryPreferencesWidget::url() { changed = false; return prefWidget->urlInput->url(); diff --git a/kbabel/kbabeldict/modules/poauxiliary/preferenceswidget.h b/kbabel/kbabeldict/modules/poauxiliary/preferenceswidget.h index 45488158..3f0862b2 100644 --- a/kbabel/kbabeldict/modules/poauxiliary/preferenceswidget.h +++ b/kbabel/kbabeldict/modules/poauxiliary/preferenceswidget.h @@ -44,15 +44,15 @@ class AuxiliaryPreferencesWidget : public PrefWidget Q_OBJECT public: - AuxiliaryPreferencesWidget(QWidget *parent=0, const char* name=0); + AuxiliaryPreferencesWidget(TQWidget *parent=0, const char* name=0); virtual ~AuxiliaryPreferencesWidget(); virtual void apply(); virtual void cancel(); virtual void standard(); - void setURL(const QString url); - QString url(); + void setURL(const TQString url); + TQString url(); void setIgnoreFuzzy(bool); bool ignoreFuzzy(); 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(); diff --git a/kbabel/kbabeldict/modules/tmx/pc_factory.cpp b/kbabel/kbabeldict/modules/tmx/pc_factory.cpp index a3dcfdf9..eaea5194 100644 --- a/kbabel/kbabeldict/modules/tmx/pc_factory.cpp +++ b/kbabel/kbabeldict/modules/tmx/pc_factory.cpp @@ -54,7 +54,7 @@ KInstance *PcFactory::s_instance = 0; KAboutData *PcFactory::s_about = 0; -PcFactory::PcFactory( QObject *parent, const char *name) +PcFactory::PcFactory( TQObject *parent, const char *name) : KLibFactory(parent,name) { } @@ -75,10 +75,10 @@ PcFactory::~PcFactory() } -QObject *PcFactory::createObject( QObject *parent, const char *name - , const char *classname, const QStringList &) +TQObject *PcFactory::createObject( TQObject *parent, const char *name + , const char *classname, const TQStringList &) { - if(QCString(classname) != "SearchEngine") + if(TQCString(classname) != "SearchEngine") { kdError() << "not a SearchEngine requested" << endl; return 0; diff --git a/kbabel/kbabeldict/modules/tmx/pc_factory.h b/kbabel/kbabeldict/modules/tmx/pc_factory.h index 5ef08277..74739e0a 100644 --- a/kbabel/kbabeldict/modules/tmx/pc_factory.h +++ b/kbabel/kbabeldict/modules/tmx/pc_factory.h @@ -45,12 +45,12 @@ class PcFactory : public KLibFactory { Q_OBJECT public: - PcFactory( QObject *parent=0, const char *name=0); + PcFactory( TQObject *parent=0, const char *name=0); ~PcFactory(); - virtual QObject *createObject( QObject *parent=0, const char *name=0 - , const char *classname="QObject" - , const QStringList &args = QStringList()); + virtual TQObject *createObject( TQObject *parent=0, const char *name=0 + , const char *classname="TQObject" + , const TQStringList &args = TQStringList()); static KInstance *instance(); diff --git a/kbabel/kbabeldict/modules/tmx/preferenceswidget.cpp b/kbabel/kbabeldict/modules/tmx/preferenceswidget.cpp index 1202496d..85d38294 100644 --- a/kbabel/kbabeldict/modules/tmx/preferenceswidget.cpp +++ b/kbabel/kbabeldict/modules/tmx/preferenceswidget.cpp @@ -32,13 +32,13 @@ your version. **************************************************************************** */ -#include <qcheckbox.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> #include <kfiledialog.h> -#include <qpushbutton.h> -#include <qwhatsthis.h> +#include <tqpushbutton.h> +#include <tqwhatsthis.h> #include <klineedit.h> #include <klocale.h> #include <kurlrequester.h> @@ -46,68 +46,68 @@ #include "preferenceswidget.h" #include "pwidget.h" -TmxCompendiumPreferencesWidget::TmxCompendiumPreferencesWidget(QWidget *parent, const char* name) +TmxCompendiumPreferencesWidget::TmxCompendiumPreferencesWidget(TQWidget *parent, const char* name) : PrefWidget(parent,name) , changed(false) { - QVBoxLayout *layout = new QVBoxLayout(this); + TQVBoxLayout *layout = new TQVBoxLayout(this); prefWidget = new TmxCompendiumPWidget(this); layout->addWidget(prefWidget); - connect(prefWidget->caseBtn, SIGNAL(toggled(bool)) - , this, SLOT(setChanged())); - connect(prefWidget->equalBtn, SIGNAL(toggled(bool)) - , this, SLOT(setChanged())); - connect(prefWidget->ngramBtn, SIGNAL(toggled(bool)) - , this, SLOT(setChanged())); - connect(prefWidget->isContainedBtn, SIGNAL(toggled(bool)) - , this, SLOT(setChanged())); - connect(prefWidget->containsBtn, SIGNAL(toggled(bool)) - , this, SLOT(setChanged())); - connect(prefWidget->hasWordBtn, SIGNAL(toggled(bool)) - , this, SLOT(setChanged())); - connect(prefWidget->wholeBtn, SIGNAL(toggled(bool)) - , this, SLOT(setChanged())); + connect(prefWidget->caseBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(setChanged())); + connect(prefWidget->equalBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(setChanged())); + connect(prefWidget->ngramBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(setChanged())); + connect(prefWidget->isContainedBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(setChanged())); + connect(prefWidget->containsBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(setChanged())); + connect(prefWidget->hasWordBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(setChanged())); + connect(prefWidget->wholeBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(setChanged())); - connect(prefWidget->urlInput->lineEdit(),SIGNAL(textChanged(const QString&)) - , this, SLOT(setChanged())); - - connect(prefWidget->equalBtn, SIGNAL(toggled(bool)) - , this, SLOT(equalBtnToggled(bool))); - connect(prefWidget->ngramBtn, SIGNAL(toggled(bool)) - , this, SLOT(ngramBtnToggled(bool))); - connect(prefWidget->isContainedBtn, SIGNAL(toggled(bool)) - , this, SLOT(isContainedBtnToggled(bool))); - connect(prefWidget->containsBtn, SIGNAL(toggled(bool)) - , this, SLOT(containsBtnToggled(bool))); - connect(prefWidget->hasWordBtn, SIGNAL(toggled(bool)) - , this, SLOT(hasWordBtnToggled(bool))); - - - QString whatsthis=i18n("<qt><p><b>Parameters</b></p>" + connect(prefWidget->urlInput->lineEdit(),TQT_SIGNAL(textChanged(const TQString&)) + , this, TQT_SLOT(setChanged())); + + connect(prefWidget->equalBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(equalBtnToggled(bool))); + connect(prefWidget->ngramBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(ngramBtnToggled(bool))); + connect(prefWidget->isContainedBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(isContainedBtnToggled(bool))); + connect(prefWidget->containsBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(containsBtnToggled(bool))); + connect(prefWidget->hasWordBtn, TQT_SIGNAL(toggled(bool)) + , this, TQT_SLOT(hasWordBtnToggled(bool))); + + + TQString whatsthis=i18n("<qt><p><b>Parameters</b></p>" "<p>Here you can fine-tune searching within the PO file. " "For example, if you want to perform a case sensitive search.</p></qt>" ); - QWhatsThis::add(prefWidget->caseBtn,whatsthis); - QWhatsThis::add(prefWidget->wholeBtn,whatsthis); + TQWhatsThis::add(prefWidget->caseBtn,whatsthis); + TQWhatsThis::add(prefWidget->wholeBtn,whatsthis); whatsthis = i18n("<qt><p><b>Comparison Options</b></p>" "<p>Choose here which messages you want to have treated as a matching " "message.</p></qt>"); - QWhatsThis::add(prefWidget->equalBtn,whatsthis); - QWhatsThis::add(prefWidget->containsBtn,whatsthis); - QWhatsThis::add(prefWidget->isContainedBtn,whatsthis); - QWhatsThis::add(prefWidget->hasWordBtn,whatsthis); + TQWhatsThis::add(prefWidget->equalBtn,whatsthis); + TQWhatsThis::add(prefWidget->containsBtn,whatsthis); + TQWhatsThis::add(prefWidget->isContainedBtn,whatsthis); + TQWhatsThis::add(prefWidget->hasWordBtn,whatsthis); whatsthis = i18n("<qt><p><b>3-Gram-matching</b></p>" "<p>A message matches another if most of its 3-letter groups are " "contained in the other message. e.g. 'abc123' matches 'abcx123c12'.</p></qt>"); - QWhatsThis::add(prefWidget->ngramBtn,whatsthis); + TQWhatsThis::add(prefWidget->ngramBtn,whatsthis); whatsthis = i18n("<qt><p><b>Location</b></p>" "<p>Configure here which file is to be used for searching." "</p></qt>"); - QWhatsThis::add(prefWidget->urlInput,whatsthis); + TQWhatsThis::add(prefWidget->urlInput,whatsthis); } TmxCompendiumPreferencesWidget::~TmxCompendiumPreferencesWidget() @@ -139,7 +139,7 @@ void TmxCompendiumPreferencesWidget::standard() changed=true; } -void TmxCompendiumPreferencesWidget::setURL(const QString url) +void TmxCompendiumPreferencesWidget::setURL(const TQString url) { prefWidget->urlInput->setURL(url); changed=false; @@ -190,7 +190,7 @@ void TmxCompendiumPreferencesWidget::setMatchWords(bool on) -QString TmxCompendiumPreferencesWidget::url() +TQString TmxCompendiumPreferencesWidget::url() { changed=false; return prefWidget->urlInput->url(); diff --git a/kbabel/kbabeldict/modules/tmx/preferenceswidget.h b/kbabel/kbabeldict/modules/tmx/preferenceswidget.h index c8356c3d..e2a4b900 100644 --- a/kbabel/kbabeldict/modules/tmx/preferenceswidget.h +++ b/kbabel/kbabeldict/modules/tmx/preferenceswidget.h @@ -46,14 +46,14 @@ class TmxCompendiumPreferencesWidget : public PrefWidget Q_OBJECT public: - TmxCompendiumPreferencesWidget(QWidget *parent=0, const char* name=0); + TmxCompendiumPreferencesWidget(TQWidget *parent=0, const char* name=0); virtual ~TmxCompendiumPreferencesWidget(); virtual void apply(); virtual void cancel(); virtual void standard(); - void setURL(const QString url); + void setURL(const TQString url); void setMatchEqual(bool); void setMatchNGram(bool); void setMatchIsContained(bool); @@ -62,7 +62,7 @@ public: void setWholeWords(bool); void setCaseSensitive(bool); - QString url(); + TQString url(); bool matchEqual(); bool matchNGram(); bool matchIsContained(); diff --git a/kbabel/kbabeldict/modules/tmx/tmxcompendium.cpp b/kbabel/kbabeldict/modules/tmx/tmxcompendium.cpp index 152bc536..415992bf 100644 --- a/kbabel/kbabeldict/modules/tmx/tmxcompendium.cpp +++ b/kbabel/kbabeldict/modules/tmx/tmxcompendium.cpp @@ -41,8 +41,8 @@ #include <kinstance.h> #include <kio/netaccess.h> -#include <qtextstream.h> -#include <qtimer.h> +#include <tqtextstream.h> +#include <tqtimer.h> #include "tmxcompendiumdata.h" #include "tmxcompendium.h" @@ -55,10 +55,10 @@ #define NGRAM_LEN 3 #define LIM_NGRAM 50 -static KStaticDeleter< QDict<TmxCompendiumData> > compDataDeleter; -QDict<TmxCompendiumData> *TmxCompendium::_compDict = 0; +static KStaticDeleter< TQDict<TmxCompendiumData> > compDataDeleter; +TQDict<TmxCompendiumData> *TmxCompendium::_compDict = 0; -TmxCompendium::TmxCompendium(QObject *parent, const char *name) +TmxCompendium::TmxCompendium(TQObject *parent, const char *name) : SearchEngine(parent, name) { prefWidget=0; @@ -81,8 +81,8 @@ TmxCompendium::TmxCompendium(QObject *parent, const char *name) matchWords=true; - loadTimer = new QTimer(this); - connect(loadTimer,SIGNAL(timeout()),this,SLOT(slotLoadCompendium())); + loadTimer = new TQTimer(this); + connect(loadTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(slotLoadCompendium())); } TmxCompendium::~TmxCompendium() @@ -137,7 +137,7 @@ void TmxCompendium::readSettings(KConfigBase *config) matchWords = config->readBoolEntry("MatchWords",true); matchNGram = config->readBoolEntry("MatchNGram",true); - QString newPath = config->readEntry("Compendium","http://i18n.kde.org/po_overview/@LANG@.messages"); + TQString newPath = config->readEntry("Compendium","http://i18n.kde.org/po_overview/@LANG@.messages"); if(!initialized) { url = newPath; @@ -152,12 +152,12 @@ void TmxCompendium::readSettings(KConfigBase *config) restoreSettings(); } -PrefWidget *TmxCompendium::preferencesWidget(QWidget *parent) +PrefWidget *TmxCompendium::preferencesWidget(TQWidget *parent) { prefWidget = new TmxCompendiumPreferencesWidget(parent,"tmxcompendium_prefwidget"); - connect(prefWidget, SIGNAL(applySettings()), this, SLOT(applySettings())); - connect(prefWidget, SIGNAL(restoreSettings()) - , this, SLOT(restoreSettings())); + connect(prefWidget, TQT_SIGNAL(applySettings()), this, TQT_SLOT(applySettings())); + connect(prefWidget, TQT_SIGNAL(restoreSettings()) + , this, TQT_SLOT(restoreSettings())); restoreSettings(); @@ -170,23 +170,23 @@ const KAboutData *TmxCompendium::about() const } -QString TmxCompendium::name() const +TQString TmxCompendium::name() const { return i18n("TMX Compendium"); } -QString TmxCompendium::id() const +TQString TmxCompendium::id() const { return "tmxcompendium"; } -QString TmxCompendium::lastError() +TQString TmxCompendium::lastError() { return errorMsg; } -bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const SearchFilter*) +bool TmxCompendium::startSearch(const TQString& text, uint pluralForm, const SearchFilter*) { if(autoUpdate && prefWidget && prefWidget->settingsChanged()) { @@ -223,8 +223,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear emit started(); - QValueList<int> foundIndices; - QValueList<int> checkedIndices; + TQValueList<int> foundIndices; + TQValueList<int> checkedIndices; uint checkCounter=0; const int *index = data->exactDict(text); @@ -240,8 +240,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear TranslationInfo *info = new TranslationInfo; info->location = directory(realURL,0); - info->translator = QString::null; - info->description = QString::null; + info->translator = TQString::null; + info->description = TQString::null; result->descriptions.append(info); results.append(result); @@ -250,7 +250,7 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear emit resultFound(result); } - QString searchStr=TmxCompendiumData::simplify(text); + TQString searchStr=TmxCompendiumData::simplify(text); if(!caseSensitive) @@ -258,13 +258,13 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear searchStr = searchStr.lower(); } - QString temp = searchStr; + TQString temp = searchStr; temp = temp.lower(); - const QValueList<int> *indexList = data->allDict(temp); + const TQValueList<int> *indexList = data->allDict(temp); if(indexList) { - QValueList<int>::ConstIterator it; + TQValueList<int>::ConstIterator it; for( it = indexList->begin(); it != indexList->end(); ++it ) { if(foundIndices.contains(*it)) @@ -272,7 +272,7 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear continue; } - QString origStr = data->msgid(*it); + TQString origStr = data->msgid(*it); origStr = TmxCompendiumData::simplify(origStr); @@ -294,8 +294,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear TranslationInfo *info = new TranslationInfo; info->location = directory(realURL,0); - info->translator = QString::null; - info->description = QString::null; + info->translator = TQString::null; + info->description = TQString::null; result->descriptions.append(info); addResult(result); @@ -303,8 +303,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear } } - QStringList wList = TmxCompendiumData::wordList(searchStr); - for ( QStringList::Iterator wit = wList.begin() + TQStringList wList = TmxCompendiumData::wordList(searchStr); + for ( TQStringList::Iterator wit = wList.begin() ; wit != wList.end(); ++wit ) { if(stop) @@ -313,7 +313,7 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear indexList = data->wordDict((*wit).lower()); if(indexList) { - QValueList<int>::ConstIterator it; + TQValueList<int>::ConstIterator it; for( it = indexList->begin(); it != indexList->end(); ++it ) { if(stop) @@ -339,7 +339,7 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear kapp->processEvents(100); - QString origStr = data->msgid(*it); + TQString origStr = data->msgid(*it); origStr = TmxCompendiumData::simplify(origStr); @@ -357,8 +357,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear } else { - QString s=*wit; - QString o=origStr; + TQString s=*wit; + TQString o=origStr; if(wholeWords) { @@ -389,8 +389,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear if(!found && matchContains && !wholeWords) { - QString s=maskString(searchStr); - QRegExp searchReg(s); + TQString s=maskString(searchStr); + TQRegExp searchReg(s); if(searchReg.search(origStr) >= 0) found=true; @@ -398,8 +398,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear if(!found && matchIsContained && !wholeWords) { - QString s=maskString(origStr); - QRegExp reg(s); + TQString s=maskString(origStr); + TQRegExp reg(s); if(reg.search(searchStr) >= 0) { @@ -408,13 +408,13 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear } if(!found && matchWords && !wholeWords) { - QStringList list = TmxCompendiumData::wordList(searchStr); + TQStringList list = TmxCompendiumData::wordList(searchStr); - for ( QStringList::Iterator wit2 = list.begin() + for ( TQStringList::Iterator wit2 = list.begin() ; wit2 != list.end(); ++wit2 ) { - QString s=maskString(*wit2); - QRegExp reg(s); + TQString s=maskString(*wit2); + TQRegExp reg(s); if(reg.search(origStr) >= 0) { @@ -436,8 +436,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear TranslationInfo *info = new TranslationInfo; info->location = directory(realURL,0); - info->translator = QString::null; - info->description = QString::null; + info->translator = TQString::null; + info->description = TQString::null; result->descriptions.append(info); addResult(result); @@ -451,10 +451,10 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear (!wholeWords && (matchContains || matchIsContained || matchWords)) ) { - QRegExp searchReg; + TQRegExp searchReg; if(matchContains) { - QString s=maskString(searchStr); + TQString s=maskString(searchStr); searchReg.setPattern(s); } @@ -497,7 +497,7 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear emit progress( (100*(checkCounter+1))/data->numberOfEntries()); } - QString origStr = data->msgid(i); + TQString origStr = data->msgid(i); origStr = TmxCompendiumData::simplify(origStr); if(!caseSensitive) @@ -523,8 +523,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear if(!found && matchIsContained) { - QString s=maskString(origStr); - QRegExp reg(s); + TQString s=maskString(origStr); + TQRegExp reg(s); if(reg.search(searchStr) >= 0) { @@ -533,19 +533,19 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear } if(!found && matchWords) { - QStringList list = TmxCompendiumData::wordList(searchStr); + TQStringList list = TmxCompendiumData::wordList(searchStr); - for ( QStringList::Iterator wit2 = list.begin() + for ( TQStringList::Iterator wit2 = list.begin() ; wit2 != list.end(); ++wit2 ) { - QString s=maskString(*wit2); + TQString s=maskString(*wit2); if(wholeWords) { origStr = " "+origStr+" "; s=" "+s+" "; } - QRegExp reg(s); + TQRegExp reg(s); if(reg.search(origStr) >= 0) { @@ -577,8 +577,8 @@ bool TmxCompendium::startSearch(const QString& text, uint pluralForm, const Sear TranslationInfo *info = new TranslationInfo; info->location = directory(realURL,0); - info->translator = QString::null; - info->description = QString::null; + info->translator = TQString::null; + info->description = TQString::null; result->descriptions.append(info); addResult(result); @@ -629,7 +629,7 @@ void TmxCompendium::applySettings() bool needLoading=false; - QString newPath = prefWidget->url(); + TQString newPath = prefWidget->url(); if(!initialized) { url = newPath; @@ -685,7 +685,7 @@ void TmxCompendium::slotLoadCompendium() } - QString path=url; + TQString path=url; if(path.contains("@LANG@")) { @@ -718,7 +718,7 @@ void TmxCompendium::slotLoadCompendium() } else { - connect(data, SIGNAL(progressEnds()), this, SLOT(recheckData())); + connect(data, TQT_SIGNAL(progressEnds()), this, TQT_SLOT(recheckData())); } } else @@ -737,7 +737,7 @@ void TmxCompendium::recheckData() { if(data) { - disconnect(data, SIGNAL(progressEnds()), this, SLOT(recheckData())); + disconnect(data, TQT_SIGNAL(progressEnds()), this, TQT_SLOT(recheckData())); error = data->hasErrors(); errorMsg = data->errorMsg(); @@ -746,7 +746,7 @@ void TmxCompendium::recheckData() loading=false; } -QString TmxCompendium::maskString(QString s) const +TQString TmxCompendium::maskString(TQString s) const { s.replace('\\',"\\\\"); s.replace('?',"\\?"); @@ -795,7 +795,7 @@ void TmxCompendium::addResult(SearchResult *result) } -void TmxCompendium::setLanguageCode(const QString& lang) +void TmxCompendium::setLanguageCode(const TQString& lang) { if(initialized && url.contains("@LANG@") && lang!=langCode && !loadTimer->isActive() ) @@ -806,7 +806,7 @@ void TmxCompendium::setLanguageCode(const QString& lang) langCode=lang; } -QString TmxCompendium::translate(const QString& text, uint pluralForm) +TQString TmxCompendium::translate(const TQString& text, uint pluralForm) { if(!initialized) { @@ -818,7 +818,7 @@ QString TmxCompendium::translate(const QString& text, uint pluralForm) if(error || !data || data->active()) { - return QString::null; + return TQString::null; } @@ -829,10 +829,10 @@ QString TmxCompendium::translate(const QString& text, uint pluralForm) return data->msgstr(*index); } - return QString::null; + return TQString::null; } -QString TmxCompendium::fuzzyTranslation(const QString& text, int &score, uint pluralForm) +TQString TmxCompendium::fuzzyTranslation(const TQString& text, int &score, uint pluralForm) { if(!initialized) { @@ -844,7 +844,7 @@ QString TmxCompendium::fuzzyTranslation(const QString& text, int &score, uint pl if(error || !data || data->active()) { - return QString::null; + return TQString::null; } // try to find fuzzy string @@ -855,7 +855,7 @@ QString TmxCompendium::fuzzyTranslation(const QString& text, int &score, uint pl int best_match = 0; int total = data->numberOfEntries(); - QString searchStr = TmxCompendiumData::simplify(text); + TQString searchStr = TmxCompendiumData::simplify(text); //kdDebug(750) << "find best match for " << searchStr << endl; @@ -883,7 +883,7 @@ QString TmxCompendium::fuzzyTranslation(const QString& text, int &score, uint pl } // get a message from the catalog - QString origStr = data->msgid(i); + TQString origStr = data->msgid(i); origStr = TmxCompendiumData::simplify(origStr); // don't match too long strings for short search string @@ -907,7 +907,7 @@ QString TmxCompendium::fuzzyTranslation(const QString& text, int &score, uint pl return data->msgstr(best_matching); } - return QString::null; + return TQString::null; } @@ -915,14 +915,14 @@ void TmxCompendium::unregisterData() { if(data) { - disconnect(data, SIGNAL(progressStarts(const QString&)), this - , SIGNAL(progressStarts(const QString&))); - disconnect(data, SIGNAL(progressEnds()), this , SIGNAL(progressEnds())); - disconnect(data, SIGNAL(progress(int)), this , SIGNAL(progress(int))); + disconnect(data, TQT_SIGNAL(progressStarts(const TQString&)), this + , TQT_SIGNAL(progressStarts(const TQString&))); + disconnect(data, TQT_SIGNAL(progressEnds()), this , TQT_SIGNAL(progressEnds())); + disconnect(data, TQT_SIGNAL(progress(int)), this , TQT_SIGNAL(progress(int))); if(data->active()) { - disconnect(data,SIGNAL(progressEnds()),this,SLOT(recheckData())); + disconnect(data,TQT_SIGNAL(progressEnds()),this,TQT_SLOT(recheckData())); } if(data->unregisterObject(this)) @@ -933,7 +933,7 @@ void TmxCompendium::unregisterData() } else { - connect(data,SIGNAL(progressEnds()),this,SLOT(removeData())); + connect(data,TQT_SIGNAL(progressEnds()),this,TQT_SLOT(removeData())); } } @@ -957,21 +957,21 @@ void TmxCompendium::registerData() emit progressStarts(i18n("Loading PO compendium")); } - connect(data, SIGNAL(progressStarts(const QString&)), this - , SIGNAL(progressStarts(const QString&))); - connect(data, SIGNAL(progressEnds()), this , SIGNAL(progressEnds())); - connect(data, SIGNAL(progress(int)), this , SIGNAL(progress(int))); + connect(data, TQT_SIGNAL(progressStarts(const TQString&)), this + , TQT_SIGNAL(progressStarts(const TQString&))); + connect(data, TQT_SIGNAL(progressEnds()), this , TQT_SIGNAL(progressEnds())); + connect(data, TQT_SIGNAL(progress(int)), this , TQT_SIGNAL(progress(int))); } void TmxCompendium::removeData() { - const QObject *s=sender(); + const TQObject *s=sender(); if(s && s->inherits("TmxCompendiumData")) { const TmxCompendiumData *d=static_cast<const TmxCompendiumData*>(s); if(d) { - QDictIterator<TmxCompendiumData> it(*compendiumDict()); + TQDictIterator<TmxCompendiumData> it(*compendiumDict()); while(it.current()) { if(it.current() == d) @@ -991,11 +991,11 @@ void TmxCompendium::removeData() } } -QDict<TmxCompendiumData> *TmxCompendium::compendiumDict() +TQDict<TmxCompendiumData> *TmxCompendium::compendiumDict() { if(!_compDict) { - _compDict=compDataDeleter.setObject( new QDict<TmxCompendiumData> ); + _compDict=compDataDeleter.setObject( new TQDict<TmxCompendiumData> ); _compDict->setAutoDelete(true); } diff --git a/kbabel/kbabeldict/modules/tmx/tmxcompendium.h b/kbabel/kbabeldict/modules/tmx/tmxcompendium.h index 9a2f8fba..21270799 100644 --- a/kbabel/kbabeldict/modules/tmx/tmxcompendium.h +++ b/kbabel/kbabeldict/modules/tmx/tmxcompendium.h @@ -39,9 +39,9 @@ #include "tmxcompendiumdata.h" #include "searchengine.h" -#include <qdict.h> -#include <qfile.h> -#include <qguardedptr.h> +#include <tqdict.h> +#include <tqfile.h> +#include <tqguardedptr.h> class TmxCompendiumPreferencesWidget; class KConfigBase; @@ -52,34 +52,34 @@ class TmxCompendium : public SearchEngine Q_OBJECT public: - TmxCompendium(QObject *parent=0, const char *name=0); + TmxCompendium(TQObject *parent=0, const char *name=0); virtual ~TmxCompendium(); virtual bool isReady() const; - virtual QString translate(const QString& text, uint pluralForm); - virtual QString fuzzyTranslation(const QString& text, int &score, uint pluralForm); + virtual TQString translate(const TQString& text, uint pluralForm); + virtual TQString fuzzyTranslation(const TQString& text, int &score, uint pluralForm); virtual bool isSearching() const; virtual void saveSettings(KConfigBase *config); virtual void readSettings(KConfigBase *config); - virtual PrefWidget *preferencesWidget(QWidget *parent); + virtual PrefWidget *preferencesWidget(TQWidget *parent); virtual const KAboutData *about() const; - virtual QString name() const; + virtual TQString name() const; - virtual QString id() const; + virtual TQString id() const; - virtual QString lastError(); + virtual TQString lastError(); public slots: - virtual bool startSearch(const QString& text, uint pluralForm, const SearchFilter* filter); + virtual bool startSearch(const TQString& text, uint pluralForm, const SearchFilter* filter); virtual void stopSearch(); - virtual void setLanguageCode(const QString& lang); + virtual void setLanguageCode(const TQString& lang); protected slots: /** reads the current settings from the preferences dialog */ @@ -96,19 +96,19 @@ protected slots: protected: void loadCompendium(); void addResult(SearchResult *); - QString maskString(QString string) const; + TQString maskString(TQString string) const; void registerData(); void unregisterData(); private: - QGuardedPtr<TmxCompendiumPreferencesWidget> prefWidget; + TQGuardedPtr<TmxCompendiumPreferencesWidget> prefWidget; TmxCompendiumData *data; - QTimer *loadTimer; + TQTimer *loadTimer; - QString url; - QString realURL; - QString langCode; + TQString url; + TQString realURL; + TQString langCode; bool caseSensitive; bool wholeWords; @@ -123,15 +123,15 @@ private: uint freeMemDelay; bool error; - QString errorMsg; + TQString errorMsg; bool stop; bool active; bool initialized; bool loading; - static QDict<TmxCompendiumData> *_compDict; - static QDict<TmxCompendiumData> *compendiumDict(); + static TQDict<TmxCompendiumData> *_compDict; + static TQDict<TmxCompendiumData> *compendiumDict(); }; #endif diff --git a/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.cpp b/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.cpp index 3fa84aa4..7893e837 100644 --- a/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.cpp +++ b/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.cpp @@ -34,8 +34,8 @@ **************************************************************************** */ #include "tmxcompendiumdata.h" -#include <qdom.h> -#include <qfile.h> +#include <tqdom.h> +#include <tqfile.h> #include <tagextractor.h> #include <resources.h> @@ -47,8 +47,8 @@ using namespace KBabel; -TmxCompendiumData::TmxCompendiumData(QObject *parent) - : QObject(parent) +TmxCompendiumData::TmxCompendiumData(TQObject *parent) + : TQObject(parent) , _active(false) , _error(false) , _initialized(false) @@ -62,7 +62,7 @@ TmxCompendiumData::TmxCompendiumData(QObject *parent) } -bool TmxCompendiumData::load(const KURL& url, const QString& language) +bool TmxCompendiumData::load(const KURL& url, const TQString& language) { kdDebug(KBABEL_SEARCH) << "Load " << url.url() << " in " << language << endl; if(_active) @@ -79,13 +79,13 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) emit progressStarts(i18n("Loading TMX compendium")); - QDomDocument doc( "mydocument" ); + TQDomDocument doc( "mydocument" ); - QString target; + TQString target; if( KIO::NetAccess::download( url, target ) ) { - QFile f( target ); + TQFile f( target ); if ( !f.open( IO_ReadOnly ) ) { _error = true; @@ -102,7 +102,7 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) _errorMsg = i18n( "Cannot open the file." ); } - QDomElement docElem = doc.documentElement(); + TQDomElement docElem = doc.documentElement(); if( docElem.tagName() != "tmx" || !(docElem.hasAttribute("version") && docElem.attribute("version") == "1.4" ) ) @@ -131,7 +131,7 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) emit progressStarts(i18n("Building indices")); - QDomNodeList tuTags = docElem.elementsByTagName("tu"); + TQDomNodeList tuTags = docElem.elementsByTagName("tu"); uint total = tuTags.count(); _originals.clear(); @@ -149,11 +149,11 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) kapp->processEvents(100); } - QDomNodeList tuvTags = tuTags.item(i).toElement().elementsByTagName("tuv"); - QString english, other; + TQDomNodeList tuvTags = tuTags.item(i).toElement().elementsByTagName("tuv"); + TQString english, other; for( uint j = 0 ; j < tuvTags.count() ; j++ ) { - QDomElement el = tuvTags.item(j).toElement(); + TQDomElement el = tuvTags.item(j).toElement(); if( el.attribute("xml:lang").upper() == "EN" ) english = el.text(); if( el.attribute("xml:lang").upper().startsWith(language.upper()) ) other = el.text(); @@ -165,7 +165,7 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) _originals[lastindex] = english; _translations[lastindex] = other; - QString temp = english; + TQString temp = english; int *index = new int(lastindex); _exactDict.insert(temp,index); @@ -175,18 +175,18 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) if(!temp.isEmpty() && temp.length() > 1) { - QValueList<int> *indexList=_allDict[temp]; + TQValueList<int> *indexList=_allDict[temp]; if(!indexList) { - indexList = new QValueList<int>; + indexList = new TQValueList<int>; _allDict.insert(temp,indexList); } indexList->append(lastindex); - QStringList wList = wordList(temp); - for ( QStringList::Iterator it = wList.begin() + TQStringList wList = wordList(temp); + for ( TQStringList::Iterator it = wList.begin() ; it != wList.end(); ++it ) { if( (*it).length() > 1) @@ -195,7 +195,7 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) if(!indexList) { - indexList = new QValueList<int>; + indexList = new TQValueList<int>; _wordDict.insert(*it,indexList); } @@ -210,7 +210,7 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) // remove words, that are too frequent uint max=_allDict.count()/10; - QDictIterator< QValueList<int> > it(_wordDict); + TQDictIterator< TQValueList<int> > it(_wordDict); while ( it.current() ) { if(it.current()->count() > max) @@ -240,39 +240,39 @@ bool TmxCompendiumData::load(const KURL& url, const QString& language) return true; } -const int* TmxCompendiumData::exactDict(const QString& text) const +const int* TmxCompendiumData::exactDict(const TQString& text) const { return _exactDict[text]; } -const QValueList<int>* TmxCompendiumData::allDict(const QString& text) const +const TQValueList<int>* TmxCompendiumData::allDict(const TQString& text) const { return _allDict[text]; } -const QValueList<int>* TmxCompendiumData::wordDict(const QString& text) const +const TQValueList<int>* TmxCompendiumData::wordDict(const TQString& text) const { return _wordDict[text]; } -const QString TmxCompendiumData::msgid(const int index) const +const TQString TmxCompendiumData::msgid(const int index) const { return _originals[index]; } -const QString TmxCompendiumData::msgstr(const int index) const +const TQString TmxCompendiumData::msgstr(const int index) const { return _translations[index]; } -void TmxCompendiumData::registerObject(QObject *obj) +void TmxCompendiumData::registerObject(TQObject *obj) { if(!_registered.containsRef(obj)) _registered.append(obj); } -bool TmxCompendiumData::unregisterObject(QObject *obj) +bool TmxCompendiumData::unregisterObject(TQObject *obj) { _registered.removeRef(obj); @@ -284,9 +284,9 @@ bool TmxCompendiumData::hasObjects() const return _registered.count()==0; } -QString TmxCompendiumData::simplify(const QString& string) +TQString TmxCompendiumData::simplify(const TQString& string) { - QString result; + TQString result; TagExtractor te; te.setString(string); @@ -298,11 +298,11 @@ QString TmxCompendiumData::simplify(const QString& string) return result; } -QStringList TmxCompendiumData::wordList(const QString& string) +TQStringList TmxCompendiumData::wordList(const TQString& string) { - QString result=TmxCompendiumData::simplify(string); + TQString result=TmxCompendiumData::simplify(string); - return QStringList::split(' ',result); + return TQStringList::split(' ',result); } #include "tmxcompendiumdata.moc" diff --git a/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.h b/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.h index bc88a92e..ce2692a1 100644 --- a/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.h +++ b/kbabel/kbabeldict/modules/tmx/tmxcompendiumdata.h @@ -37,52 +37,52 @@ #include <kurl.h> -#include <qdict.h> -#include <qobject.h> -#include <qstringlist.h> -#include <qvaluelist.h> -#include <qvaluevector.h> -#include <qptrlist.h> +#include <tqdict.h> +#include <tqobject.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> +#include <tqvaluevector.h> +#include <tqptrlist.h> class TmxCompendiumData : public QObject { Q_OBJECT public: - TmxCompendiumData(QObject *parent=0); + TmxCompendiumData(TQObject *parent=0); - bool load(const KURL& url, const QString& language); + bool load(const KURL& url, const TQString& language); - const int *exactDict(const QString& text) const; - const QValueList<int> *allDict(const QString& text) const; - const QValueList<int> *wordDict(const QString& text) const; + const int *exactDict(const TQString& text) const; + const TQValueList<int> *allDict(const TQString& text) const; + const TQValueList<int> *wordDict(const TQString& text) const; - const QString msgid(const int index) const; - const QString msgstr(const int index) const; + const TQString msgid(const int index) const; + const TQString msgstr(const int index) const; const int numberOfEntries() const { return _exactDict.count(); } bool active() const { return _active; } bool initialized() const { return _initialized; } bool hasErrors() const { return _error; } - QString errorMsg() const { return _errorMsg; } + TQString errorMsg() const { return _errorMsg; } /** registers an object, that uses this data */ - void registerObject(QObject *); + void registerObject(TQObject *); /** * unregisters an object, that uses this data * * @return true, if this was the last object */ - bool unregisterObject(QObject *); + bool unregisterObject(TQObject *); bool hasObjects() const; - static QString simplify(const QString& text); - static QStringList wordList(const QString& text); + static TQString simplify(const TQString& text); + static TQStringList wordList(const TQString& text); signals: - void progressStarts(const QString&); + void progressStarts(const TQString&); void progressEnds(); void progress(int); @@ -91,16 +91,16 @@ private: bool _active; bool _error; bool _initialized; - QString _errorMsg; + TQString _errorMsg; - QDict<int> _exactDict; - QDict< QValueList<int> > _allDict; - QDict< QValueList<int> > _wordDict; + TQDict<int> _exactDict; + TQDict< TQValueList<int> > _allDict; + TQDict< TQValueList<int> > _wordDict; - QValueVector<QString> _originals; - QValueVector<QString> _translations; + TQValueVector<TQString> _originals; + TQValueVector<TQString> _translations; - QPtrList<QObject> _registered; + TQPtrList<TQObject> _registered; }; #endif diff --git a/kbabel/kbabeldict/searchengine.cpp b/kbabel/kbabeldict/searchengine.cpp index 95ab5694..19112fe7 100644 --- a/kbabel/kbabeldict/searchengine.cpp +++ b/kbabel/kbabeldict/searchengine.cpp @@ -53,7 +53,7 @@ SearchResult::SearchResult(const SearchResult& r) descriptions.setAutoDelete(true); score=r.score; - QPtrListIterator<TranslationInfo> it(r.descriptions); + TQPtrListIterator<TranslationInfo> it(r.descriptions); for ( ; it.current(); ++it ) { TranslationInfo *ti=new TranslationInfo(*(*it)); @@ -62,8 +62,8 @@ SearchResult::SearchResult(const SearchResult& r) } -PrefWidget::PrefWidget(QWidget *parent, const char *name) - : QWidget(parent,name) +PrefWidget::PrefWidget(TQWidget *parent, const char *name) + : TQWidget(parent,name) { } @@ -72,8 +72,8 @@ PrefWidget::~PrefWidget() } -SearchEngine::SearchEngine(QObject *parent, const char *name) - : QObject(parent, name) +SearchEngine::SearchEngine(TQObject *parent, const char *name) + : TQObject(parent, name) { autoUpdate=false; results.setAutoDelete(true); @@ -83,7 +83,7 @@ SearchEngine::~SearchEngine() { } -bool SearchEngine::startSearchInTranslation(const QString&, unsigned int, const SearchFilter*) +bool SearchEngine::startSearchInTranslation(const TQString&, unsigned int, const SearchFilter*) { return true; } @@ -175,34 +175,34 @@ void SearchEngine::clearResults() -void SearchEngine::setEditedFile(const QString&) +void SearchEngine::setEditedFile(const TQString&) { } -void SearchEngine::setEditedPackage(const QString&) +void SearchEngine::setEditedPackage(const TQString&) { } -void SearchEngine::setLanguageCode(const QString&) +void SearchEngine::setLanguageCode(const TQString&) { } -void SearchEngine::setLanguage(const QString&,const QString&) +void SearchEngine::setLanguage(const TQString&,const TQString&) { } -void SearchEngine::stringChanged(const QStringList&,const QString&,unsigned int, const QString&) +void SearchEngine::stringChanged(const TQStringList&,const TQString&,unsigned int, const TQString&) { } -QString SearchEngine::directory(const QString& path, int n) +TQString SearchEngine::directory(const TQString& path, int n) { if(n<0) - return QString::null; + return TQString::null; int begin=path.findRev('/'); int end=path.length(); @@ -213,14 +213,14 @@ QString SearchEngine::directory(const QString& path, int n) if(n==0) return path; else - return QString::null; + return TQString::null; } for(int i=0; i < n; i++) { if(begin==0) { - return QString::null; + return TQString::null; } end = begin; @@ -228,7 +228,7 @@ QString SearchEngine::directory(const QString& path, int n) if(begin < 0) { - return QString::null; + return TQString::null; } } @@ -237,7 +237,7 @@ QString SearchEngine::directory(const QString& path, int n) } -uint SearchEngine::score(const QString& orig, const QString& found) +uint SearchEngine::score(const TQString& orig, const TQString& found) { if(orig == found) return 100; @@ -246,8 +246,8 @@ uint SearchEngine::score(const QString& orig, const QString& found) uint scoreB = ngramMatch(orig,found); uint score = QMIN(scoreA, scoreB); - QString f = found.lower(); - QString o = orig.lower(); + TQString f = found.lower(); + TQString o = orig.lower(); scoreA = ngramMatch(f, o); scoreB = ngramMatch(o, f); @@ -256,7 +256,7 @@ uint SearchEngine::score(const QString& orig, const QString& found) return score; } -uint SearchEngine::ngramMatch (const QString& text1, const QString& text2, +uint SearchEngine::ngramMatch (const TQString& text1, const TQString& text2, uint ngram_len) { if (text1.length() < ngram_len || text2.length() < ngram_len) diff --git a/kbabel/kbabeldict/searchengine.h b/kbabel/kbabeldict/searchengine.h index db722362..a10e6193 100644 --- a/kbabel/kbabeldict/searchengine.h +++ b/kbabel/kbabeldict/searchengine.h @@ -34,11 +34,11 @@ #ifndef SEARCH_ENGINE_H #define SEARCH_ENGINE_H -#include <qdatetime.h> -#include <qptrlist.h> -#include <qobject.h> -#include <qstring.h> -#include <qwidget.h> +#include <tqdatetime.h> +#include <tqptrlist.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqwidget.h> #include <kaboutdata.h> #include <kconfigbase.h> @@ -55,50 +55,50 @@ public: * Information about the location, where this entry was found. * For example the PO-file it was found in, etc. * */ - QString location; + TQString location; /** * The complete path of the file, where this entry was found */ - QString filePath; + TQString filePath; /** The date of the last change */ - QDateTime lastChange; + TQDateTime lastChange; /** The language, the translation belongs to */ - QString languageCode; + TQString languageCode; /** * The translator of this string * For example the translator found in the header of the PO-file. */ - QString translator; + TQString translator; /** * The name of a project this translation is a part of. */ - QString projectName; + TQString projectName; /** * Keywords defined for @ref projectName. For example KDE_3_1_BRANCH (project branch) */ - QStringList projectKeywords; + TQStringList projectKeywords; /** * Part/context in a project, for example "multimedia", "admin", etc. */ - QString projectContext; + TQString projectContext; /** * Status of the translation, for example "approved", "spellchecked", "unknown" */ - QString status; + TQString status; /** * Additional information to be presented to the user, for example a comment */ - QString description; + TQString description; }; @@ -114,16 +114,16 @@ public: SearchResult(const SearchResult&); /** The requested string to search for */ - QString requested; + TQString requested; /** The string that, was found (a list if it is a plural form) */ - QStringList found; + TQStringList found; /** The number of a plural form to search for */ uint requestedPluralForm; /** The translation of the found string */ - QString translation; + TQString translation; /** The number of a plural form of the translated string found */ uint translationPluralForm; @@ -133,21 +133,21 @@ public: * using rich text. If you don't use rich text, you can leave * it empty */ - QString plainTranslation; + TQString plainTranslation; /** * This string contains the plain string, that was found, if you are * using rich text. If you don't use rich text, you can leave * it empty */ - QString plainFound; + TQString plainFound; /** * This string contains the plain requested string if you are * using rich text. If you don't use rich text, you can leave * it empty */ - QString plainRequested; + TQString plainRequested; /** * Constains a score for the found translation. 0 means exact matching. @@ -156,7 +156,7 @@ public: */ int score; - QPtrList<TranslationInfo> descriptions; + TQPtrList<TranslationInfo> descriptions; }; /** @@ -167,9 +167,9 @@ class KDE_EXPORT SearchFilter public: SearchFilter() : _projects() - , _location( QString::null ) - , _languageCode( QString::null ) - , _origLanguageCode( QString::null ) + , _location( TQString::null ) + , _languageCode( TQString::null ) + , _origLanguageCode( TQString::null ) , _translators() , _projectKeywords() , _projectContexts() @@ -178,45 +178,45 @@ public: virtual ~SearchFilter() {} - void setProjectName( const QString& project ) { _projects = project; } - void setProjectName( const QStringList& projects ) { _projects = projects; } + void setProjectName( const TQString& project ) { _projects = project; } + void setProjectName( const TQStringList& projects ) { _projects = projects; } /** * Information about the location, where this entry was found. * For example the PO-file it was found in, etc. * */ - void setLocation( const QString& location) { _location = location; } - QString location() const { return _location; } + void setLocation( const TQString& location) { _location = location; } + TQString location() const { return _location; } /** The original language, the translation was made from */ - void setOriginalLanguage( const QString& languageCode) { _origLanguageCode = languageCode; } + void setOriginalLanguage( const TQString& languageCode) { _origLanguageCode = languageCode; } /** The language, the translation belongs to */ - void setTranslationLanguage( const QString& languageCode) { _languageCode = languageCode; } + void setTranslationLanguage( const TQString& languageCode) { _languageCode = languageCode; } /** * The translator of this string * For example the translator found in the header of the PO-file. */ - void setTranslator( const QString& translator) { _translators = translator ; } - void setTranslator( const QStringList& translators) { _translators = translators ; } + void setTranslator( const TQString& translator) { _translators = translator ; } + void setTranslator( const TQStringList& translators) { _translators = translators ; } /** * Keywords defined for @ref projectName. For example KDE_3_1_BRANCH (project branch) */ - void setProjectKeywords( const QStringList& projectKeywords ) { _projectKeywords = projectKeywords; } + void setProjectKeywords( const TQStringList& projectKeywords ) { _projectKeywords = projectKeywords; } /** * Part/context in a project, for example "multimedia", "admin", etc. */ - void setProjectContext( const QString& projectContext) { _projectContexts = projectContext; } - void setProjectContext( const QStringList& projectContexts) { _projectContexts = projectContexts; } + void setProjectContext( const TQString& projectContext) { _projectContexts = projectContext; } + void setProjectContext( const TQStringList& projectContexts) { _projectContexts = projectContexts; } /** * Status of the translation, for example "approved", "spellchecked", "unknown" */ - void setStatus( const QString& translationStatus) { _translationStatus = translationStatus; } - void setStatus( const QStringList& translationStati) { _translationStatus = translationStati; } + void setStatus( const TQString& translationStatus) { _translationStatus = translationStatus; } + void setStatus( const TQStringList& translationStati) { _translationStatus = translationStati; } /** * The key method of the class - check, if the argument @@ -225,14 +225,14 @@ public: virtual bool match( const TranslationInfo& toCheck ); private: - QStringList _projects; - QString _location; - QString _languageCode; - QString _origLanguageCode; - QStringList _translators; - QStringList _projectKeywords ; - QStringList _projectContexts; - QStringList _translationStatus; + TQStringList _projects; + TQString _location; + TQString _languageCode; + TQString _origLanguageCode; + TQStringList _translators; + TQStringList _projectKeywords ; + TQStringList _projectContexts; + TQStringList _translationStatus; }; /** @@ -246,7 +246,7 @@ class KDE_EXPORT PrefWidget : public QWidget Q_OBJECT public: - PrefWidget(QWidget *parent, const char* name=0); + PrefWidget(TQWidget *parent, const char* name=0); virtual ~PrefWidget(); public slots: @@ -270,7 +270,7 @@ class KDE_EXPORT SearchEngine : public QObject Q_OBJECT public: - SearchEngine(QObject *parent=0, const char *name=0); + SearchEngine(TQObject *parent=0, const char *name=0); virtual ~SearchEngine(); @@ -297,26 +297,26 @@ public: * @returns the exact translation of text or a empty string * if no exact match was found. */ - virtual QString translate(const QString& text, const uint pluralForm = 0)=0; + virtual TQString translate(const TQString& text, const uint pluralForm = 0)=0; /** * @returns the translation of text according to the plugin settings or a empty string * if no match was found. */ - virtual QString searchTranslation(const QString&, int &score, const uint pluralForm = 0) { + virtual TQString searchTranslation(const TQString&, int &score, const uint pluralForm = 0) { Q_UNUSED(pluralForm); - score = 0; return QString::null; + score = 0; return TQString::null; } /** * @returns a fuzzy translation of text or a empty string * if no good match was found. */ - virtual QString fuzzyTranslation(const QString& /*text*/, int &score, const uint pluralForm = 0) { + virtual TQString fuzzyTranslation(const TQString& /*text*/, int &score, const uint pluralForm = 0) { Q_UNUSED(pluralForm); - score = 0; return QString::null; }; + score = 0; return TQString::null; }; /** @@ -329,7 +329,7 @@ public: * @return true, if successfull */ virtual bool messagesForFilter(const SearchFilter* filter - , QValueList<SearchResult>& resultList, QString& error) + , TQValueList<SearchResult>& resultList, TQString& error) { Q_UNUSED(filter); Q_UNUSED(resultList); @@ -354,19 +354,19 @@ public: * a tabbed widget. * @param parent the parent of the returned widget */ - virtual PrefWidget* preferencesWidget(QWidget *parent)=0; + virtual PrefWidget* preferencesWidget(TQWidget *parent)=0; /** @returns information about this SearchEngine */ virtual const KAboutData *about() const= 0; /** @returns the i18n name of this search engine */ - virtual QString name() const= 0; + virtual TQString name() const= 0; /** @returns a untranslated name of this engine */ - virtual QString id() const= 0; + virtual TQString id() const= 0; /** @returns the last error message */ - virtual QString lastError() = 0; + virtual TQString lastError() = 0; /** @@ -382,7 +382,7 @@ public: * a number between 0 and 100. @param ngram_len should be * a value between 3 and 5. */ - static uint ngramMatch (const QString& text1, const QString& text2, + static uint ngramMatch (const TQString& text1, const TQString& text2, uint ngram_len=3); public slots: @@ -391,14 +391,14 @@ public slots: * @returns false, if an error occured. Use @ref lastError * to get the last error message */ - virtual bool startSearch(const QString& s, uint pluralForm = 0, const SearchFilter* filter = 0) = 0; + virtual bool startSearch(const TQString& s, uint pluralForm = 0, const SearchFilter* filter = 0) = 0; /** * starts a search for string s in the translated text * @returns false, if an error occured. Use @ref lastError * to get the last error message */ - virtual bool startSearchInTranslation(const QString& s, uint pluralForm = 0, const SearchFilter* filter = 0); + virtual bool startSearchInTranslation(const TQString& s, uint pluralForm = 0, const SearchFilter* filter = 0); /** stops a search */ @@ -425,22 +425,22 @@ public slots: * on the edited file. The default implementation does nothing. * @param file The edited file with path */ - virtual void setEditedFile(const QString& file); + virtual void setEditedFile(const TQString& file); /** * This method allows a search engine to use different settings depending * on the edited package. The default implementation does nothing. * @param package The name of the package, that is currently translated. */ - virtual void setEditedPackage(const QString& package); + virtual void setEditedPackage(const TQString& package); /** * This method allows a search engine to use different settings depending * on the language code. The default implementation does nothing. * @param lang The current language code (e.g. de). */ - 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); @@ -453,8 +453,8 @@ public slots: * @param pluralForm the number of the plural form of the translation * @param description the additional description, e.g., a PO comment */ - 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); /** * If the database is editable this slot should open an dialog to let @@ -470,13 +470,13 @@ public slots: * returns "foobar", while n=1 would return "src" * FIXME: isn't it a code duplication? */ - static QString directory(const QString& path, int n); + static TQString directory(const TQString& path, int n); /** * computes a score to assess the match of the two strings: * 0 means exact match, bigger means worse */ - static uint score(const QString& orig, const QString& found); + static uint score(const TQString& orig, const TQString& found); signals: /** signals, that a new search started */ @@ -493,7 +493,7 @@ signals: * progressbar or if you do something else then searching, * maybe loading a big file */ - void progressStarts(const QString&); + void progressStarts(const TQString&); void progressEnds(); @@ -523,10 +523,10 @@ signals: * signals, that an error occured, for example, that you wasn't * able to open a database. */ - void hasError(const QString& error); + void hasError(const TQString& error); protected: - QPtrList<SearchResult> results; + TQPtrList<SearchResult> results; bool autoUpdate; }; |