summaryrefslogtreecommitdiffstats
path: root/kmouth/wordcompletion
diff options
context:
space:
mode:
Diffstat (limited to 'kmouth/wordcompletion')
-rw-r--r--kmouth/wordcompletion/creationsourcedetailsui.ui.h10
-rw-r--r--kmouth/wordcompletion/creationsourceui.ui.h4
-rw-r--r--kmouth/wordcompletion/dictionarycreationwizard.cpp132
-rw-r--r--kmouth/wordcompletion/dictionarycreationwizard.h40
-rw-r--r--kmouth/wordcompletion/kdedocsourceui.ui.h2
-rw-r--r--kmouth/wordcompletion/klanguagebutton.cpp96
-rw-r--r--kmouth/wordcompletion/klanguagebutton.h38
-rw-r--r--kmouth/wordcompletion/klanguagebuttonhelper.cpp26
-rw-r--r--kmouth/wordcompletion/klanguagebuttonhelper.h2
-rw-r--r--kmouth/wordcompletion/wordcompletion.cpp94
-rw-r--r--kmouth/wordcompletion/wordcompletion.h18
-rw-r--r--kmouth/wordcompletion/wordcompletionui.ui.h10
-rw-r--r--kmouth/wordcompletion/wordcompletionwidget.cpp120
-rw-r--r--kmouth/wordcompletion/wordcompletionwidget.h8
-rw-r--r--kmouth/wordcompletion/wordlist.cpp170
-rw-r--r--kmouth/wordcompletion/wordlist.h46
16 files changed, 408 insertions, 408 deletions
diff --git a/kmouth/wordcompletion/creationsourcedetailsui.ui.h b/kmouth/wordcompletion/creationsourcedetailsui.ui.h
index 956f021..16ecdc5 100644
--- a/kmouth/wordcompletion/creationsourcedetailsui.ui.h
+++ b/kmouth/wordcompletion/creationsourcedetailsui.ui.h
@@ -12,23 +12,23 @@ void CreationSourceDetailsUI::init() {
languageButton = new KLanguageButton (this, "languageButton");
CreationSourceDetailsUILayout->addWidget (languageButton, 2, 1);
languageLabel->setBuddy (languageButton);
- QWhatsThis::add (languageButton, i18n("With this combo box you decide which language should be associated with the new dictionary."));
+ TQWhatsThis::add (languageButton, i18n("With this combo box you decide which language should be associated with the new dictionary."));
loadLanguageList(languageButton);
- languageButton->insertLanguage("??", i18n("Other"), QString::fromLatin1("l10n/"), QString::null);
+ languageButton->insertLanguage("??", i18n("Other"), TQString::fromLatin1("l10n/"), TQString::null);
- connect (languageButton, SIGNAL(activated(int)), this, SLOT(languageButton_activated(int)));
+ connect (languageButton, TQT_SIGNAL(activated(int)), this, TQT_SLOT(languageButton_activated(int)));
}
void CreationSourceDetailsUI::languageButton_activated (int) {
if (languageButton->currentTag() == "??") {
- QString customLanguage = KInputDialog::getText(i18n("Create Custom Language"), i18n("Please enter the code for the custom language:"));
+ TQString customLanguage = KInputDialog::getText(i18n("Create Custom Language"), i18n("Please enter the code for the custom language:"));
if (languageButton->containsTag(customLanguage)) {
languageButton->setCurrentItem(customLanguage);
}
else {
- languageButton->insertLanguage(customLanguage, i18n("without name"), QString::fromLatin1("l10n/"), QString::null);
+ languageButton->insertLanguage(customLanguage, i18n("without name"), TQString::fromLatin1("l10n/"), TQString::null);
languageButton->setCurrentItem(customLanguage);
}
}
diff --git a/kmouth/wordcompletion/creationsourceui.ui.h b/kmouth/wordcompletion/creationsourceui.ui.h
index d78a439..f9f3dad 100644
--- a/kmouth/wordcompletion/creationsourceui.ui.h
+++ b/kmouth/wordcompletion/creationsourceui.ui.h
@@ -9,11 +9,11 @@
void CreationSourceUI::init() {
- group1 = new QButtonGroup (0);
+ group1 = new TQButtonGroup (0);
group1->insert (createButton);
group1->insert (mergeButton);
group1->insert (emptyButton);
- group2 = new QButtonGroup (0);
+ group2 = new TQButtonGroup (0);
group2->insert (kdeDocButton);
group2->insert (fileButton);
group2->insert (directoryButton);
diff --git a/kmouth/wordcompletion/dictionarycreationwizard.cpp b/kmouth/wordcompletion/dictionarycreationwizard.cpp
index a0711ce..13c770e 100644
--- a/kmouth/wordcompletion/dictionarycreationwizard.cpp
+++ b/kmouth/wordcompletion/dictionarycreationwizard.cpp
@@ -15,14 +15,14 @@
* *
***************************************************************************/
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qcheckbox.h>
-#include <qradiobutton.h>
-#include <qlineedit.h>
-#include <qcombobox.h>
-#include <qtextcodec.h>
-#include <qwhatsthis.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqcheckbox.h>
+#include <tqradiobutton.h>
+#include <tqlineedit.h>
+#include <tqcombobox.h>
+#include <tqtextcodec.h>
+#include <tqwhatsthis.h>
#include <klistview.h>
#include <klineedit.h>
@@ -42,9 +42,9 @@
#include "kdedocsourceui.h"
#include "wordlist.h"
-DictionaryCreationWizard::DictionaryCreationWizard (QWidget *parent, const char *name,
- QStringList dictionaryNames, QStringList dictionaryFiles,
- QStringList dictionaryLanguages)
+DictionaryCreationWizard::DictionaryCreationWizard (TQWidget *parent, const char *name,
+ TQStringList dictionaryNames, TQStringList dictionaryFiles,
+ TQStringList dictionaryLanguages)
: KWizard (parent, name)
{
buildCodecList ();
@@ -61,9 +61,9 @@ DictionaryCreationWizard::DictionaryCreationWizard (QWidget *parent, const char
dirWidget= new CreationSourceDetailsUI (this, "directory source page");
addPage (dirWidget, i18n("Source of New Dictionary (2)"));
dirWidget->urlLabel->setText (i18n("&Directory:"));
- QWhatsThis::add (dirWidget->urlLabel, i18n("With this input field you specify which directory you want to load for creating the new dictionary."));
+ TQWhatsThis::add (dirWidget->urlLabel, i18n("With this input field you specify which directory you want to load for creating the new dictionary."));
dirWidget->url->setMode(KFile::Directory);
- QWhatsThis::add (dirWidget->url, i18n("With this input field you specify which directory you want to load for creating the new dictionary."));
+ TQWhatsThis::add (dirWidget->url, i18n("With this input field you specify which directory you want to load for creating the new dictionary."));
buildCodecCombo (dirWidget->encodingCombo);
kdeDocWidget= new KDEDocSourceUI (this, "KDE documentation source page");
@@ -72,11 +72,11 @@ DictionaryCreationWizard::DictionaryCreationWizard (QWidget *parent, const char
mergeWidget = new MergeWidget (this, "merge source page", dictionaryNames, dictionaryFiles, dictionaryLanguages);
addPage (mergeWidget, i18n("Source of New Dictionary (2)"));
- connect (creationSource->fileButton, SIGNAL (toggled(bool)), this, SLOT(calculateAppropriate(bool)) );
- connect (creationSource->directoryButton,SIGNAL(toggled(bool)), this, SLOT(calculateAppropriate(bool)) );
- connect (creationSource->kdeDocButton, SIGNAL (toggled(bool)), this, SLOT(calculateAppropriate(bool)) );
- connect (creationSource->mergeButton, SIGNAL (toggled(bool)), this, SLOT(calculateAppropriate(bool)) );
- connect (creationSource->emptyButton, SIGNAL (toggled(bool)), this, SLOT(calculateAppropriate(bool)) );
+ connect (creationSource->fileButton, TQT_SIGNAL (toggled(bool)), this, TQT_SLOT(calculateAppropriate(bool)) );
+ connect (creationSource->directoryButton,TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(calculateAppropriate(bool)) );
+ connect (creationSource->kdeDocButton, TQT_SIGNAL (toggled(bool)), this, TQT_SLOT(calculateAppropriate(bool)) );
+ connect (creationSource->mergeButton, TQT_SIGNAL (toggled(bool)), this, TQT_SLOT(calculateAppropriate(bool)) );
+ connect (creationSource->emptyButton, TQT_SIGNAL (toggled(bool)), this, TQT_SLOT(calculateAppropriate(bool)) );
calculateAppropriate (true);
}
@@ -90,16 +90,16 @@ DictionaryCreationWizard::~DictionaryCreationWizard () {
}
void DictionaryCreationWizard::buildCodecList () {
- codecList = new QPtrList<QTextCodec>;
- QTextCodec *codec;
+ codecList = new TQPtrList<TQTextCodec>;
+ TQTextCodec *codec;
int i;
- for (i = 0; (codec = QTextCodec::codecForIndex(i)); i++)
+ for (i = 0; (codec = TQTextCodec::codecForIndex(i)); i++)
codecList->append (codec);
}
-void DictionaryCreationWizard::buildCodecCombo (QComboBox *combo) {
- QString local = i18n("Local")+" (";
- local += QTextCodec::codecForLocale()->name();
+void DictionaryCreationWizard::buildCodecCombo (TQComboBox *combo) {
+ TQString local = i18n("Local")+" (";
+ local += TQTextCodec::codecForLocale()->name();
local += ")";
combo->insertItem (local, 0);
combo->insertItem (i18n("Latin1"), 1);
@@ -154,58 +154,58 @@ void DictionaryCreationWizard::calculateAppropriate (bool) {
}
}
-QString DictionaryCreationWizard::createDictionary() {
+TQString DictionaryCreationWizard::createDictionary() {
WordList::WordMap map;
- QString dicFile = "";
+ TQString dicFile = "";
KProgressDialog *pdlg = WordList::progressDialog();
if (creationSource->mergeButton->isChecked()) {
map = WordList::mergeFiles (mergeWidget->mergeParameters(), pdlg);
- dicFile = QString::null;
+ dicFile = TQString::null;
}
else if (creationSource->emptyButton->isChecked()) {
- dicFile = QString::null;
+ dicFile = TQString::null;
}
else if (creationSource->fileButton->isChecked()) {
- QString filename = fileWidget->url->url();
+ TQString filename = fileWidget->url->url();
int encoding = fileWidget->encodingCombo->currentItem();
if (fileWidget->spellCheckBox->isChecked())
dicFile = fileWidget->ooDictURL->url();
switch (encoding) {
case 0:
- map = WordList::parseFile (filename, QTextStream::Locale, 0, pdlg);
+ map = WordList::parseFile (filename, TQTextStream::Locale, 0, pdlg);
break;
case 1:
- map = WordList::parseFile (filename, QTextStream::Latin1, 0, pdlg);
+ map = WordList::parseFile (filename, TQTextStream::Latin1, 0, pdlg);
break;
case 2:
- map = WordList::parseFile (filename, QTextStream::Unicode, 0, pdlg);
+ map = WordList::parseFile (filename, TQTextStream::Unicode, 0, pdlg);
break;
default:
- map = WordList::parseFile (filename, (QTextStream::Encoding)0, codecList->at(encoding-3), pdlg);
+ map = WordList::parseFile (filename, (TQTextStream::Encoding)0, codecList->at(encoding-3), pdlg);
}
}
else if (creationSource->directoryButton->isChecked()) {
- QString directory = dirWidget->url->url();
+ TQString directory = dirWidget->url->url();
int encoding = dirWidget->encodingCombo->currentItem();
if (dirWidget->spellCheckBox->isChecked())
dicFile = dirWidget->ooDictURL->url();
switch (encoding) {
case 0:
- map = WordList::parseDir (directory, QTextStream::Locale, 0, pdlg);
+ map = WordList::parseDir (directory, TQTextStream::Locale, 0, pdlg);
break;
case 1:
- map = WordList::parseDir (directory, QTextStream::Latin1, 0, pdlg);
+ map = WordList::parseDir (directory, TQTextStream::Latin1, 0, pdlg);
break;
case 2:
- map = WordList::parseDir (directory, QTextStream::Unicode, 0, pdlg);
+ map = WordList::parseDir (directory, TQTextStream::Unicode, 0, pdlg);
break;
default:
- map = WordList::parseDir (directory, (QTextStream::Encoding)0, codecList->at(encoding-3), pdlg);
+ map = WordList::parseDir (directory, (TQTextStream::Encoding)0, codecList->at(encoding-3), pdlg);
}
}
else { // creationSource->kdeDocButton must be checked
- QString language = kdeDocWidget->languageButton->currentTag();
+ TQString language = kdeDocWidget->languageButton->currentTag();
if (kdeDocWidget->spellCheckBox->isChecked())
dicFile = kdeDocWidget->ooDictURL->url();
map = WordList::parseKDEDoc (language, pdlg);
@@ -217,11 +217,11 @@ QString DictionaryCreationWizard::createDictionary() {
delete pdlg;
int dictnumber = 0;
- QString filename;
- QString dictionaryFile;
+ TQString filename;
+ TQString dictionaryFile;
do {
dictnumber++;
- filename = QString("wordcompletion%1.dict").arg(dictnumber);
+ filename = TQString("wordcompletion%1.dict").arg(dictnumber);
dictionaryFile = KApplication::kApplication()->dirs()->findResource("appdata", filename);
}
while (KStandardDirs::exists(dictionaryFile));
@@ -233,7 +233,7 @@ QString DictionaryCreationWizard::createDictionary() {
return "";
}
-QString DictionaryCreationWizard::name() {
+TQString DictionaryCreationWizard::name() {
if (creationSource->mergeButton->isChecked()) {
return i18n("Merge result");
}
@@ -251,7 +251,7 @@ QString DictionaryCreationWizard::name() {
}
}
-QString DictionaryCreationWizard::language() {
+TQString DictionaryCreationWizard::language() {
if (creationSource->mergeButton->isChecked()) {
return mergeWidget->language();
}
@@ -275,25 +275,25 @@ QString DictionaryCreationWizard::language() {
/***************************************************************************/
MergeWidget::MergeWidget(KWizard *parent, const char *name,
- QStringList dictionaryNames, QStringList dictionaryFiles,
- QStringList dictionaryLanguages)
-: QScrollView (parent, name) {
+ TQStringList dictionaryNames, TQStringList dictionaryFiles,
+ TQStringList dictionaryLanguages)
+: TQScrollView (parent, name) {
dictionaries.setAutoDelete (false);
weights.setAutoDelete (false);
- QWidget *contents = new QWidget(viewport());
+ TQWidget *contents = new TQWidget(viewport());
addChild(contents);
- QGridLayout *layout = new QGridLayout (contents);
- setResizePolicy (QScrollView::AutoOneFit);
+ TQGridLayout *layout = new TQGridLayout (contents);
+ setResizePolicy (TQScrollView::AutoOneFit);
layout->setColStretch (0, 0);
layout->setColStretch (1, 1);
int row = 0;
- QStringList::Iterator nIt = dictionaryNames.begin();
- QStringList::Iterator fIt = dictionaryFiles.begin();
- QStringList::Iterator lIt = dictionaryLanguages.begin();
+ TQStringList::Iterator nIt = dictionaryNames.begin();
+ TQStringList::Iterator fIt = dictionaryFiles.begin();
+ TQStringList::Iterator lIt = dictionaryLanguages.begin();
for (; nIt != dictionaryNames.end(); ++nIt, ++fIt, ++lIt) {
- QCheckBox *checkbox = new QCheckBox(*nIt, contents);
+ TQCheckBox *checkbox = new TQCheckBox(*nIt, contents);
KIntNumInput *numInput = new KIntNumInput(contents);
layout->addWidget (checkbox, row, 0);
layout->addWidget (numInput, row, 1);
@@ -301,7 +301,7 @@ MergeWidget::MergeWidget(KWizard *parent, const char *name,
checkbox->setChecked (true);
numInput->setRange (1, 100, 10, true);
numInput->setValue (100);
- connect (checkbox, SIGNAL (toggled(bool)), numInput, SLOT(setEnabled(bool)));
+ connect (checkbox, TQT_SIGNAL (toggled(bool)), numInput, TQT_SLOT(setEnabled(bool)));
dictionaries.insert(*fIt, checkbox);
weights.insert(*fIt, numInput);
@@ -313,13 +313,13 @@ MergeWidget::MergeWidget(KWizard *parent, const char *name,
MergeWidget::~MergeWidget() {
}
-QMap <QString, int> MergeWidget::mergeParameters () {
- QMap <QString, int> files;
- QDictIterator<QCheckBox> it(dictionaries);
+TQMap <TQString, int> MergeWidget::mergeParameters () {
+ TQMap <TQString, int> files;
+ TQDictIterator<TQCheckBox> it(dictionaries);
for (; it.current(); ++it) {
if (it.current()->isChecked()) {
- QString name = it.currentKey();
- QString dictionaryFile = KApplication::kApplication()->dirs()->findResource("appdata", name);
+ TQString name = it.currentKey();
+ TQString dictionaryFile = KApplication::kApplication()->dirs()->findResource("appdata", name);
files[dictionaryFile] = weights[name]->value();
}
}
@@ -327,15 +327,15 @@ QMap <QString, int> MergeWidget::mergeParameters () {
return files;
}
-QString MergeWidget::language () {
- QDictIterator<QCheckBox> it(dictionaries);
+TQString MergeWidget::language () {
+ TQDictIterator<TQCheckBox> it(dictionaries);
for (; it.current(); ++it) {
if (it.current()->isChecked()) {
return languages [it.currentKey()];
}
}
- return QString::null;
+ return TQString::null;
}
/***************************************************************************/
@@ -351,7 +351,7 @@ void CompletionWizardWidget::ok (KConfig *config) {
WordList::WordMap map;
KProgressDialog *pdlg = WordList::progressDialog();
- QString language = languageButton->currentTag();
+ TQString language = languageButton->currentTag();
map = WordList::parseKDEDoc (language, pdlg);
if (spellCheckBox->isChecked())
@@ -360,8 +360,8 @@ void CompletionWizardWidget::ok (KConfig *config) {
pdlg->close();
delete pdlg;
- QString filename;
- QString dictionaryFile;
+ TQString filename;
+ TQString dictionaryFile;
dictionaryFile = KApplication::kApplication()->dirs()->saveLocation ("appdata", "/") + "wordcompletion1.dict";
if (WordList::saveWordList (map, dictionaryFile)) {
diff --git a/kmouth/wordcompletion/dictionarycreationwizard.h b/kmouth/wordcompletion/dictionarycreationwizard.h
index 18928e1..0977680 100644
--- a/kmouth/wordcompletion/dictionarycreationwizard.h
+++ b/kmouth/wordcompletion/dictionarycreationwizard.h
@@ -20,8 +20,8 @@
#ifndef DICTIONARYCREATIONWIZARD_H
#define DICTIONARYCREATIONWIZARD_H
-#include <qptrlist.h>
-#include <qmap.h>
+#include <tqptrlist.h>
+#include <tqmap.h>
#include <kwizard.h>
#include <knuminput.h>
@@ -43,22 +43,22 @@ class MergeWidget;
class DictionaryCreationWizard : public KWizard {
Q_OBJECT
public:
- DictionaryCreationWizard (QWidget *parent, const char *name,
- QStringList dictionaryNames,
- QStringList dictionaryFiles,
- QStringList dictionaryLanguages);
+ DictionaryCreationWizard (TQWidget *parent, const char *name,
+ TQStringList dictionaryNames,
+ TQStringList dictionaryFiles,
+ TQStringList dictionaryLanguages);
~DictionaryCreationWizard();
- QString createDictionary();
- QString name();
- QString language();
+ TQString createDictionary();
+ TQString name();
+ TQString language();
private slots:
void calculateAppropriate (bool);
private:
void buildCodecList ();
- void buildCodecCombo (QComboBox *combo);
+ void buildCodecCombo (TQComboBox *combo);
CreationSourceUI *creationSource;
CreationSourceDetailsUI *fileWidget;
@@ -66,7 +66,7 @@ private:
KDEDocSourceUI *kdeDocWidget;
MergeWidget *mergeWidget;
- QPtrList<QTextCodec> *codecList;
+ TQPtrList<TQTextCodec> *codecList;
};
/**
@@ -74,22 +74,22 @@ private:
* KDE documentation.
* @author Gunnar Schmi Dt
*/
-class MergeWidget : public QScrollView {
+class MergeWidget : public TQScrollView {
Q_OBJECT
public:
MergeWidget(KWizard *parent, const char *name,
- QStringList dictionaryNames,
- QStringList dictionaryFiles,
- QStringList dictionaryLanguages);
+ TQStringList dictionaryNames,
+ TQStringList dictionaryFiles,
+ TQStringList dictionaryLanguages);
~MergeWidget();
- QMap <QString, int> mergeParameters ();
- QString language ();
+ TQMap <TQString, int> mergeParameters ();
+ TQString language ();
private:
- QDict<QCheckBox> dictionaries;
- QDict<KIntNumInput> weights;
- QMap<QString,QString> languages;
+ TQDict<TQCheckBox> dictionaries;
+ TQDict<KIntNumInput> weights;
+ TQMap<TQString,TQString> languages;
};
/**
diff --git a/kmouth/wordcompletion/kdedocsourceui.ui.h b/kmouth/wordcompletion/kdedocsourceui.ui.h
index 4c42b32..92a4c6b 100644
--- a/kmouth/wordcompletion/kdedocsourceui.ui.h
+++ b/kmouth/wordcompletion/kdedocsourceui.ui.h
@@ -11,7 +11,7 @@ void KDEDocSourceUI::init() {
languageButton = new KLanguageButton (this, "languageButton");
KDEDocSourceUILayout->addWidget (languageButton, 0, 1);
languageLabel->setBuddy (languageButton);
- QWhatsThis::add (languageButton, i18n("With this combo box you select which of the installed languages is used for creating the new dictionary. KMouth will only parse documentation files of this language."));
+ TQWhatsThis::add (languageButton, i18n("With this combo box you select which of the installed languages is used for creating the new dictionary. KMouth will only parse documentation files of this language."));
loadLanguageList(languageButton);
diff --git a/kmouth/wordcompletion/klanguagebutton.cpp b/kmouth/wordcompletion/klanguagebutton.cpp
index 72182d4..b954a62 100644
--- a/kmouth/wordcompletion/klanguagebutton.cpp
+++ b/kmouth/wordcompletion/klanguagebutton.cpp
@@ -23,7 +23,7 @@
*/
#define INCLUDE_MENUITEM_DEF
-#include <qpopupmenu.h>
+#include <tqpopupmenu.h>
#include <kstandarddirs.h>
#include "klanguagebutton.h"
@@ -31,7 +31,7 @@
#include <kdebug.h>
-static inline void checkInsertPos( QPopupMenu *popup, const QString & str,
+static inline void checkInsertPos( TQPopupMenu *popup, const TQString & str,
int &index )
{
if ( index == -2 )
@@ -57,15 +57,15 @@ static inline void checkInsertPos( QPopupMenu *popup, const QString & str,
index = a; // it doesn't really matter ... a == b here.
}
-static inline QPopupMenu * checkInsertIndex( QPopupMenu *popup,
- const QStringList *tags, const QString &submenu )
+static inline TQPopupMenu * checkInsertIndex( TQPopupMenu *popup,
+ const TQStringList *tags, const TQString &submenu )
{
int pos = tags->findIndex( submenu );
- QPopupMenu *pi = 0;
+ TQPopupMenu *pi = 0;
if ( pos != -1 )
{
- QMenuItem *p = popup->findItem( pos );
+ TQMenuItem *p = popup->findItem( pos );
pi = p ? p->popup() : 0;
}
if ( !pi )
@@ -80,8 +80,8 @@ KLanguageButton::~KLanguageButton()
delete m_tags;
}
-KLanguageButton::KLanguageButton( QWidget * parent, const char *name )
-: QPushButton( parent, name ),
+KLanguageButton::KLanguageButton( TQWidget * parent, const char *name )
+: TQPushButton( parent, name ),
m_popup( 0 ),
m_oldPopup( 0 )
{
@@ -90,54 +90,54 @@ KLanguageButton::KLanguageButton( QWidget * parent, const char *name )
clear();
}
-void KLanguageButton::insertItem( const QIconSet& icon, const QString &text,
- const QString &tag, const QString &submenu, int index )
+void KLanguageButton::insertItem( const TQIconSet& icon, const TQString &text,
+ const TQString &tag, const TQString &submenu, int index )
{
- QPopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu );
+ TQPopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu );
checkInsertPos( pi, text, index );
pi->insertItem( icon, text, count(), index );
m_tags->append( tag );
}
-void KLanguageButton::insertItem( const QString &text, const QString &tag,
- const QString &submenu, int index )
+void KLanguageButton::insertItem( const TQString &text, const TQString &tag,
+ const TQString &submenu, int index )
{
- QPopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu );
+ TQPopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu );
checkInsertPos( pi, text, index );
pi->insertItem( text, count(), index );
m_tags->append( tag );
}
-void KLanguageButton::insertSeparator( const QString &submenu, int index )
+void KLanguageButton::insertSeparator( const TQString &submenu, int index )
{
- QPopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu );
+ TQPopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu );
pi->insertSeparator( index );
- m_tags->append( QString::null );
+ m_tags->append( TQString::null );
}
-void KLanguageButton::insertSubmenu( const QString &text, const QString &tag,
- const QString &submenu, int index )
+void KLanguageButton::insertSubmenu( const TQString &text, const TQString &tag,
+ const TQString &submenu, int index )
{
- QPopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu );
- QPopupMenu *p = new QPopupMenu( pi );
+ TQPopupMenu *pi = checkInsertIndex( m_popup, m_tags, submenu );
+ TQPopupMenu *p = new TQPopupMenu( pi );
checkInsertPos( pi, text, index );
pi->insertItem( text, p, count(), index );
m_tags->append( tag );
- connect( p, SIGNAL( activated( int ) ),
- SLOT( slotActivated( int ) ) );
- connect( p, SIGNAL( highlighted( int ) ), this,
- SIGNAL( highlighted( int ) ) );
+ connect( p, TQT_SIGNAL( activated( int ) ),
+ TQT_SLOT( slotActivated( int ) ) );
+ connect( p, TQT_SIGNAL( highlighted( int ) ), this,
+ TQT_SIGNAL( highlighted( int ) ) );
}
-void KLanguageButton::insertLanguage( const QString& path, const QString& name,
- const QString& sub, const QString &submenu, int index )
+void KLanguageButton::insertLanguage( const TQString& path, const TQString& name,
+ const TQString& sub, const TQString &submenu, int index )
{
- QString output = name + QString::fromLatin1( " (" ) + path +
- QString::fromLatin1( ")" );
+ TQString output = name + TQString::fromLatin1( " (" ) + path +
+ TQString::fromLatin1( ")" );
#if 0
// Nooooo ! Country != language
- QPixmap flag( locate( "locale", sub + path +
- QString::fromLatin1( "/flag.png" ) ) );
+ TQPixmap flag( locate( "locale", sub + path +
+ TQString::fromLatin1( "/flag.png" ) ) );
#endif
insertItem( output, path, submenu, index );
}
@@ -165,44 +165,44 @@ void KLanguageButton::clear()
delete m_oldPopup;
m_oldPopup = m_popup;
- m_popup = new QPopupMenu( this );
+ m_popup = new TQPopupMenu( this );
setPopup( m_popup );
- connect( m_popup, SIGNAL( activated( int ) ),
- SLOT( slotActivated( int ) ) );
- connect( m_popup, SIGNAL( highlighted( int ) ),
- SIGNAL( highlighted( int ) ) );
+ connect( m_popup, TQT_SIGNAL( activated( int ) ),
+ TQT_SLOT( slotActivated( int ) ) );
+ connect( m_popup, TQT_SIGNAL( highlighted( int ) ),
+ TQT_SIGNAL( highlighted( int ) ) );
- setText( QString::null );
- setIconSet( QIconSet() );
+ setText( TQString::null );
+ setIconSet( TQIconSet() );
}
-/*void KLanguageButton::changeLanguage( const QString& name, int i )
+/*void KLanguageButton::changeLanguage( const TQString& name, int i )
{
if ( i < 0 || i >= count() )
return;
- QString output = name + QString::fromLatin1( " (" ) + tag( i ) +
- QString::fromLatin1( ")" );
+ TQString output = name + TQString::fromLatin1( " (" ) + tag( i ) +
+ TQString::fromLatin1( ")" );
changeItem( output, i );
}*/
-bool KLanguageButton::containsTag( const QString &str ) const
+bool KLanguageButton::containsTag( const TQString &str ) const
{
return m_tags->contains( str ) > 0;
}
-QString KLanguageButton::currentTag() const
+TQString KLanguageButton::currentTag() const
{
return *m_tags->at( currentItem() );
}
-QString KLanguageButton::tag( int i ) const
+TQString KLanguageButton::tag( int i ) const
{
if ( i < 0 || i >= count() )
{
kdDebug() << "KLanguageButton::tag(), unknown tag " << i << endl;
- return QString::null;
+ return TQString::null;
}
return *m_tags->at( i );
}
@@ -219,14 +219,14 @@ void KLanguageButton::setCurrentItem( int i )
m_current = i;
setText( m_popup->text( m_current ) );
- QIconSet *icon = m_popup->iconSet( m_current );
+ TQIconSet *icon = m_popup->iconSet( m_current );
if( icon )
setIconSet( *icon );
else
- setIconSet( QPixmap() );
+ setIconSet( TQPixmap() );
}
-void KLanguageButton::setCurrentItem( const QString &code )
+void KLanguageButton::setCurrentItem( const TQString &code )
{
int i = m_tags->findIndex( code );
if ( code.isNull() )
diff --git a/kmouth/wordcompletion/klanguagebutton.h b/kmouth/wordcompletion/klanguagebutton.h
index ee1d58f..0ebe5c7 100644
--- a/kmouth/wordcompletion/klanguagebutton.h
+++ b/kmouth/wordcompletion/klanguagebutton.h
@@ -30,9 +30,9 @@
#include "kpushbutton.h"
/*
- * Extended QPushButton that shows a menu with submenu for language selection.
+ * Extended TQPushButton that shows a menu with submenu for language selection.
* Essentially just a combo box with a 2-D dataset, but using a real
- * QComboBox will produce ugly results.
+ * TQComboBox will produce ugly results.
*
* Combined version of KTagCombo and KLanguageCombo but using a QPushButton
* instead.
@@ -42,39 +42,39 @@ class KLanguageButton : public QPushButton
Q_OBJECT
public:
- KLanguageButton(QWidget *parent=0, const char *name=0);
+ KLanguageButton(TQWidget *parent=0, const char *name=0);
~KLanguageButton();
- void insertItem( const QIconSet& icon, const QString &text,
- const QString &tag, const QString &submenu = QString::null,
+ void insertItem( const TQIconSet& icon, const TQString &text,
+ const TQString &tag, const TQString &submenu = TQString::null,
int index = -1 );
- void insertItem( const QString &text, const QString &tag,
- const QString &submenu = QString::null, int index = -1 );
- void insertSeparator( const QString &submenu = QString::null,
+ void insertItem( const TQString &text, const TQString &tag,
+ const TQString &submenu = TQString::null, int index = -1 );
+ void insertSeparator( const TQString &submenu = TQString::null,
int index = -1 );
- void insertSubmenu( const QString &text, const QString &tag,
- const QString &submenu = QString::null, int index = -1);
+ void insertSubmenu( const TQString &text, const TQString &tag,
+ const TQString &submenu = TQString::null, int index = -1);
int count() const;
void clear();
- void insertLanguage( const QString& path, const QString& name,
- const QString& sub = QString::null,
- const QString &submenu = QString::null, int index = -1);
+ void insertLanguage( const TQString& path, const TQString& name,
+ const TQString& sub = TQString::null,
+ const TQString &submenu = TQString::null, int index = -1);
/*
* Tag of the selected item
*/
- QString currentTag() const;
- QString tag( int i ) const;
- bool containsTag( const QString &str ) const;
+ TQString currentTag() const;
+ TQString tag( int i ) const;
+ bool containsTag( const TQString &str ) const;
/*
* Set the current item
*/
int currentItem() const;
void setCurrentItem( int i );
- void setCurrentItem( const QString &code );
+ void setCurrentItem( const TQString &code );
signals:
void activated( int index );
@@ -85,8 +85,8 @@ private slots:
private:
// work space for the new class
- QStringList *m_tags;
- QPopupMenu *m_popup, *m_oldPopup;
+ TQStringList *m_tags;
+ TQPopupMenu *m_popup, *m_oldPopup;
int m_current;
};
diff --git a/kmouth/wordcompletion/klanguagebuttonhelper.cpp b/kmouth/wordcompletion/klanguagebuttonhelper.cpp
index 918553e..a68007b 100644
--- a/kmouth/wordcompletion/klanguagebuttonhelper.cpp
+++ b/kmouth/wordcompletion/klanguagebuttonhelper.cpp
@@ -29,32 +29,32 @@
#include <ksimpleconfig.h>
#include "klanguagebutton.h"
-QString languageName (QString languageCode) {
- QString filename = KGlobal::dirs()->findResource("locale",
- languageCode + QString::fromLatin1("/entry.desktop"));
+TQString languageName (TQString languageCode) {
+ TQString filename = KGlobal::dirs()->findResource("locale",
+ languageCode + TQString::fromLatin1("/entry.desktop"));
KSimpleConfig entry(filename);
- entry.setGroup(QString::fromLatin1("KCM Locale"));
- return entry.readEntry(QString::fromLatin1("Name"), i18n("without name"));
+ entry.setGroup(TQString::fromLatin1("KCM Locale"));
+ return entry.readEntry(TQString::fromLatin1("Name"), i18n("without name"));
}
void loadLanguageList(KLanguageButton *combo)
// This function was taken from kdebase/kcontrol/kdm/kdm-appear.cpp
{
- QStringList langlist = KGlobal::dirs()->findAllResources("locale",
- QString::fromLatin1("*/entry.desktop"));
+ TQStringList langlist = KGlobal::dirs()->findAllResources("locale",
+ TQString::fromLatin1("*/entry.desktop"));
langlist.sort();
- for ( QStringList::ConstIterator it = langlist.begin();
+ for ( TQStringList::ConstIterator it = langlist.begin();
it != langlist.end(); ++it )
{
- QString fpath = (*it).left((*it).length() - 14);
+ TQString fpath = (*it).left((*it).length() - 14);
int index = fpath.findRev('/');
- QString nid = fpath.mid(index + 1);
+ TQString nid = fpath.mid(index + 1);
KSimpleConfig entry(*it);
- entry.setGroup(QString::fromLatin1("KCM Locale"));
- QString name = entry.readEntry(QString::fromLatin1("Name"), i18n("without name"));
- combo->insertLanguage(nid, name, QString::fromLatin1("l10n/"), QString::null);
+ entry.setGroup(TQString::fromLatin1("KCM Locale"));
+ TQString name = entry.readEntry(TQString::fromLatin1("Name"), i18n("without name"));
+ combo->insertLanguage(nid, name, TQString::fromLatin1("l10n/"), TQString::null);
}
if (KGlobal::locale())
diff --git a/kmouth/wordcompletion/klanguagebuttonhelper.h b/kmouth/wordcompletion/klanguagebuttonhelper.h
index 9bee5f7..a33cdb9 100644
--- a/kmouth/wordcompletion/klanguagebuttonhelper.h
+++ b/kmouth/wordcompletion/klanguagebuttonhelper.h
@@ -24,5 +24,5 @@
class QString;
class KLanguageButton;
-QString languageName (QString languageCode);
+TQString languageName (TQString languageCode);
void loadLanguageList(KLanguageButton *combo);
diff --git a/kmouth/wordcompletion/wordcompletion.cpp b/kmouth/wordcompletion/wordcompletion.cpp
index d4ae651..268872a 100644
--- a/kmouth/wordcompletion/wordcompletion.cpp
+++ b/kmouth/wordcompletion/wordcompletion.cpp
@@ -1,5 +1,5 @@
-#include <qregexp.h>
-#include <qfile.h>
+#include <tqregexp.h>
+#include <tqfile.h>
#include <kapplication.h>
#include <kstandarddirs.h>
@@ -10,18 +10,18 @@
class WordCompletion::WordCompletionPrivate {
friend class WordCompletion;
private:
- typedef QMap<QString,int> WordMap;
+ typedef TQMap<TQString,int> WordMap;
struct DictionaryDetails {
- QString filename;
- QString language;
+ TQString filename;
+ TQString language;
};
- QString lastText;
- QMap<QString,int> map;
- QMap<QString,int> addedWords;
- QMap<QString,DictionaryDetails> dictDetails;
- QStringList dictionaries;
- QString current;
+ TQString lastText;
+ TQMap<TQString,int> map;
+ TQMap<TQString,int> addedWords;
+ TQMap<TQString,DictionaryDetails> dictDetails;
+ TQStringList dictionaries;
+ TQString current;
bool blockCurrentListSignal;
bool wordsToSave;
};
@@ -38,21 +38,21 @@ WordCompletion::~WordCompletion() {
delete d;
}
-typedef QPair<int,QString> Match;
-typedef QValueList<Match> MatchList;
+typedef QPair<int,TQString> Match;
+typedef TQValueList<Match> MatchList;
-QString WordCompletion::makeCompletion(const QString &text) {
+TQString WordCompletion::makeCompletion(const TQString &text) {
if (d->lastText != text) {
d->lastText = text;
KCompletion::clear();
- int border = text.findRev(QRegExp("\\W"));
- QString suffix = text.right (text.length() - border - 1).lower();
- QString prefix = text.left (border + 1);
+ int border = text.findRev(TQRegExp("\\W"));
+ TQString suffix = text.right (text.length() - border - 1).lower();
+ TQString prefix = text.left (border + 1);
if (suffix.length() > 0) {
MatchList matches;
- QMap<QString,int>::ConstIterator it;
+ TQMap<TQString,int>::ConstIterator it;
for (it = d->map.begin(); it != d->map.end(); ++it)
if (it.key().startsWith(suffix))
matches += Match (-it.data(), it.key());
@@ -70,27 +70,27 @@ QString WordCompletion::makeCompletion(const QString &text) {
return KCompletion::makeCompletion (text);
}
-QStringList WordCompletion::wordLists() {
+TQStringList WordCompletion::wordLists() {
return d->dictionaries;
}
-QStringList WordCompletion::wordLists(const QString &language) {
- QStringList result;
- for (QStringList::Iterator it = d->dictionaries.begin();
+TQStringList WordCompletion::wordLists(const TQString &language) {
+ TQStringList result;
+ for (TQStringList::Iterator it = d->dictionaries.begin();
it != d->dictionaries.end(); ++it)
if (d->dictDetails[*it].language == language)
result += *it;
return result;
}
-QString WordCompletion::languageOfWordList(const QString &wordlist) {
+TQString WordCompletion::languageOfWordList(const TQString &wordlist) {
if (d->dictDetails.contains(wordlist))
return d->dictDetails[wordlist].language;
else
- return QString::null;
+ return TQString::null;
}
-QString WordCompletion::currentWordList() {
+TQString WordCompletion::currentWordList() {
return d->current;
}
@@ -111,14 +111,14 @@ void WordCompletion::configure() {
d->dictDetails.clear();
KConfig *config = new KConfig("kmouthrc");
- QStringList groups = config->groupList();
- for (QStringList::Iterator it = groups.begin(); it != groups.end(); ++it)
+ TQStringList groups = config->groupList();
+ for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it)
if ((*it).startsWith ("Dictionary ")) {
config->setGroup(*it);
WordCompletionPrivate::DictionaryDetails details;
details.filename = config->readEntry("Filename");
details.language = config->readEntry("Language");
- QString name = config->readEntry("Name");
+ TQString name = config->readEntry("Name");
d->dictDetails[name] = details;
d->dictionaries += name;
}
@@ -131,7 +131,7 @@ void WordCompletion::configure() {
emit currentListChanged (d->current);
}
-bool WordCompletion::setWordList(const QString &wordlist) {
+bool WordCompletion::setWordList(const TQString &wordlist) {
if (d->wordsToSave)
save ();
d->wordsToSave = false;
@@ -143,18 +143,18 @@ bool WordCompletion::setWordList(const QString &wordlist) {
else
d->current = d->dictionaries[0];
- QString filename = d->dictDetails[d->current].filename;
- QString dictionaryFile = KApplication::kApplication()->dirs()->findResource("appdata", filename);
- QFile file(dictionaryFile);
+ TQString filename = d->dictDetails[d->current].filename;
+ TQString dictionaryFile = KApplication::kApplication()->dirs()->findResource("appdata", filename);
+ TQFile file(dictionaryFile);
if (file.exists() && file.open(IO_ReadOnly)) {
- QTextStream stream(&file);
- stream.setEncoding (QTextStream::UnicodeUTF8);
+ TQTextStream stream(&file);
+ stream.setEncoding (TQTextStream::UnicodeUTF8);
if (!stream.atEnd()) {
if (stream.readLine() == "WPDictFile") {
while (!stream.atEnd()) {
- QString s = stream.readLine();
+ TQString s = stream.readLine();
if (!(s.isNull() || s.isEmpty())) {
- QStringList list = QStringList::split("\t", s);
+ TQStringList list = TQStringList::split("\t", s);
bool ok;
int weight = list[1].toInt(&ok);
if (ok && (weight > 0))
@@ -172,13 +172,13 @@ bool WordCompletion::setWordList(const QString &wordlist) {
return result;
}
-void WordCompletion::addSentence (const QString &sentence) {
- QStringList words = QStringList::split(QRegExp("\\W"), sentence);
+void WordCompletion::addSentence (const TQString &sentence) {
+ TQStringList words = TQStringList::split(TQRegExp("\\W"), sentence);
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for (it = words.begin(); it != words.end(); ++it) {
- if (!(*it).contains(QRegExp("\\d|_"))) {
- QString key = (*it).lower();
+ if (!(*it).contains(TQRegExp("\\d|_"))) {
+ TQString key = (*it).lower();
if (d->map.contains(key))
d->map[key] += 1;
else
@@ -194,19 +194,19 @@ void WordCompletion::addSentence (const QString &sentence) {
void WordCompletion::save () {
if (d->wordsToSave) {
- QString filename = d->dictDetails[d->current].filename;
- QString dictionaryFile = KApplication::kApplication()->dirs()->findResource("appdata", filename);
- QFile file(dictionaryFile);
+ TQString filename = d->dictDetails[d->current].filename;
+ TQString dictionaryFile = KApplication::kApplication()->dirs()->findResource("appdata", filename);
+ TQFile file(dictionaryFile);
if (!file.exists())
return;
if (!file.open(IO_WriteOnly))
return;
- QTextStream stream(&file);
- stream.setEncoding (QTextStream::UnicodeUTF8);
+ TQTextStream stream(&file);
+ stream.setEncoding (TQTextStream::UnicodeUTF8);
stream << "WPDictFile\n";
- QMap<QString,int>::ConstIterator it;
+ TQMap<TQString,int>::ConstIterator it;
for (it = d->map.begin(); it != d->map.end(); ++it) {
if (d->addedWords.contains(it.key())) {
stream << it.key() << "\t" << d->addedWords[it.key()] << "\t1\n";
diff --git a/kmouth/wordcompletion/wordcompletion.h b/kmouth/wordcompletion/wordcompletion.h
index f0cb812..2bc5ceb 100644
--- a/kmouth/wordcompletion/wordcompletion.h
+++ b/kmouth/wordcompletion/wordcompletion.h
@@ -16,35 +16,35 @@ public:
/**
* Returns the names for the available word lists
*/
- QStringList wordLists();
+ TQStringList wordLists();
/**
* Returns the names for those word lists that contain
* words of a given language.
*/
- QStringList wordLists(const QString &language);
+ TQStringList wordLists(const TQString &language);
/**
* Returns the language of a given word list.
*/
- QString languageOfWordList(const QString &wordlist);
+ TQString languageOfWordList(const TQString &wordlist);
/**
* Returns the name of the currently active word list.
*/
- QString currentWordList();
+ TQString currentWordList();
/**
* Finds completions to the given text.
*/
- virtual QString makeCompletion(const QString&);
+ virtual TQString makeCompletion(const TQString&);
static bool isConfigured();
/**
* Adds the words from the given sentence to the list of words.
*/
- void addSentence (const QString &sentence);
+ void addSentence (const TQString &sentence);
public slots:
/**
@@ -58,7 +58,7 @@ public slots:
* list gets used.
* The method returns true if the specified word list was found.
*/
- bool setWordList(const QString &wordlist);
+ bool setWordList(const TQString &wordlist);
/**
* Saves the added words to disk.
@@ -66,8 +66,8 @@ public slots:
void save ();
signals:
- void wordListsChanged (const QStringList &wordLists);
- void currentListChanged (const QString &wordList);
+ void wordListsChanged (const TQStringList &wordLists);
+ void currentListChanged (const TQString &wordList);
private:
class WordCompletionPrivate;
diff --git a/kmouth/wordcompletion/wordcompletionui.ui.h b/kmouth/wordcompletion/wordcompletionui.ui.h
index 96878da..9a428df 100644
--- a/kmouth/wordcompletion/wordcompletionui.ui.h
+++ b/kmouth/wordcompletion/wordcompletionui.ui.h
@@ -12,23 +12,23 @@ void WordCompletionUI::init() {
languageButton = new KLanguageButton (selectedDictionaryDetails, "languageButton");
selectedDictionaryDetailsLayout->addWidget (languageButton, 1, 1);
languageLabel->setBuddy (languageButton);
- QWhatsThis::add (languageButton, i18n("With this combo box you select the language associated with the selected dictionary."));
+ TQWhatsThis::add (languageButton, i18n("With this combo box you select the language associated with the selected dictionary."));
loadLanguageList(languageButton);
- languageButton->insertLanguage("??", i18n("Other"), QString::fromLatin1("l10n/"), QString::null);
+ languageButton->insertLanguage("??", i18n("Other"), TQString::fromLatin1("l10n/"), TQString::null);
- connect (languageButton, SIGNAL(activated(int)), this, SLOT(languageButton_activated(int)));
+ connect (languageButton, TQT_SIGNAL(activated(int)), this, TQT_SLOT(languageButton_activated(int)));
}
void WordCompletionUI::languageButton_activated (int) {
if (languageButton->currentTag() == "??") {
- QString customLanguage = KInputDialog::getText(i18n("Create Custom Language"), i18n("Please enter the code for the custom language:"));
+ TQString customLanguage = KInputDialog::getText(i18n("Create Custom Language"), i18n("Please enter the code for the custom language:"));
if (languageButton->containsTag(customLanguage)) {
languageButton->setCurrentItem(customLanguage);
}
else {
- languageButton->insertLanguage(customLanguage, i18n("without name"), QString::fromLatin1("l10n/"), QString::null);
+ languageButton->insertLanguage(customLanguage, i18n("without name"), TQString::fromLatin1("l10n/"), TQString::null);
languageButton->setCurrentItem(customLanguage);
}
}
diff --git a/kmouth/wordcompletion/wordcompletionwidget.cpp b/kmouth/wordcompletion/wordcompletionwidget.cpp
index e5eab23..b25df12 100644
--- a/kmouth/wordcompletion/wordcompletionwidget.cpp
+++ b/kmouth/wordcompletion/wordcompletionwidget.cpp
@@ -15,10 +15,10 @@
* *
***************************************************************************/
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qcheckbox.h>
-#include <qlineedit.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqcheckbox.h>
+#include <tqlineedit.h>
#include <klistview.h>
#include <klineedit.h>
@@ -39,17 +39,17 @@
class DictionaryListItem : public KListViewItem {
public:
- DictionaryListItem (QListView *parent, QString filename, QString name, QString language, QString languageCode)
+ DictionaryListItem (TQListView *parent, TQString filename, TQString name, TQString language, TQString languageCode)
: KListViewItem (parent, name) {
setFilename (filename);
setLanguage (language, languageCode);
};
- DictionaryListItem (QListView *parent, QString filename, QString name, QString languageCode)
+ DictionaryListItem (TQListView *parent, TQString filename, TQString name, TQString languageCode)
: KListViewItem (parent, name) {
setFilename (filename);
setLanguage (languageCode);
};
- DictionaryListItem (QListView *parent, QListViewItem *after, QString filename, QString name, QString languageCode)
+ DictionaryListItem (TQListView *parent, TQListViewItem *after, TQString filename, TQString name, TQString languageCode)
: KListViewItem (parent, after, name) {
setFilename (filename);
setLanguage (languageCode);
@@ -57,53 +57,53 @@ public:
~DictionaryListItem () {
};
- QString filename() {
+ TQString filename() {
return myFilename;
}
- QString languageCode() {
+ TQString languageCode() {
return myLanguageCode;
}
- void setFilename(QString filename) {
+ void setFilename(TQString filename) {
myFilename = filename;
}
- void setLanguage (QString languageCode) {
- QString filename = KGlobal::dirs()->findResource("locale",
- languageCode + QString::fromLatin1("/entry.desktop"));
+ void setLanguage (TQString languageCode) {
+ TQString filename = KGlobal::dirs()->findResource("locale",
+ languageCode + TQString::fromLatin1("/entry.desktop"));
KSimpleConfig entry(filename);
- entry.setGroup(QString::fromLatin1("KCM Locale"));
- QString name = entry.readEntry(QString::fromLatin1("Name"), i18n("without name"));
+ entry.setGroup(TQString::fromLatin1("KCM Locale"));
+ TQString name = entry.readEntry(TQString::fromLatin1("Name"), i18n("without name"));
setLanguage (name + " (" + languageCode + ")", languageCode);
}
- void setLanguage (QString name, QString languageCode) {
+ void setLanguage (TQString name, TQString languageCode) {
myLanguageCode = languageCode;
setText (1, name);
}
private:
- QString myFilename;
- QString myLanguageCode;
+ TQString myFilename;
+ TQString myLanguageCode;
};
/***************************************************************************/
-WordCompletionWidget::WordCompletionWidget(QWidget *parent, const char *name) : WordCompletionUI (parent, name) {
+WordCompletionWidget::WordCompletionWidget(TQWidget *parent, const char *name) : WordCompletionUI (parent, name) {
dictionaryList->setSorting (-1); // no sorted list
// Connect the signals from hte KCMKTTSDWidget to this class
- connect (addButton, SIGNAL (clicked()), this, SLOT(addDictionary()) );
- connect (deleteButton, SIGNAL (clicked()), this, SLOT (deleteDictionary()) );
- connect (moveUpButton, SIGNAL (clicked()), this, SLOT (moveUp()) );
- connect (moveDownButton, SIGNAL (clicked()), this, SLOT (moveDown()) );
- connect (exportButton, SIGNAL (clicked()), this, SLOT (exportDictionary()) );
+ connect (addButton, TQT_SIGNAL (clicked()), this, TQT_SLOT(addDictionary()) );
+ connect (deleteButton, TQT_SIGNAL (clicked()), this, TQT_SLOT (deleteDictionary()) );
+ connect (moveUpButton, TQT_SIGNAL (clicked()), this, TQT_SLOT (moveUp()) );
+ connect (moveDownButton, TQT_SIGNAL (clicked()), this, TQT_SLOT (moveDown()) );
+ connect (exportButton, TQT_SIGNAL (clicked()), this, TQT_SLOT (exportDictionary()) );
- connect (dictionaryList, SIGNAL (selectionChanged()), this, SLOT (selectionChanged()) );
- connect (dictionaryName, SIGNAL (textChanged (const QString &)), this, SLOT (nameChanged (const QString &)) );
- connect (languageButton, SIGNAL (activated (int)), this, SLOT (languageSelected(int)) );
+ connect (dictionaryList, TQT_SIGNAL (selectionChanged()), this, TQT_SLOT (selectionChanged()) );
+ connect (dictionaryName, TQT_SIGNAL (textChanged (const TQString &)), this, TQT_SLOT (nameChanged (const TQString &)) );
+ connect (languageButton, TQT_SIGNAL (activated (int)), this, TQT_SLOT (languageSelected(int)) );
// Object for the KCMKTTSD configuration
config = new KConfig("kmouthrc");
@@ -125,41 +125,41 @@ void WordCompletionWidget::load() {
dictionaryList->clear();
// Set the group general for the configuration of kttsd itself (no plug ins)
- QStringList groups = config->groupList();
+ TQStringList groups = config->groupList();
DictionaryListItem *last = 0;
- for (QStringList::Iterator it = groups.begin(); it != groups.end(); ++it)
+ for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it)
if ((*it).startsWith ("Dictionary ")) {
config->setGroup(*it);
- QString languageTag = config->readEntry("Language");
+ TQString languageTag = config->readEntry("Language");
last = new DictionaryListItem (dictionaryList, last,
config->readEntry("Filename"),
config->readEntry("Name"),
languageTag);
if (!languageButton->containsTag(languageTag))
- languageButton->insertLanguage(languageTag, i18n("without name"), QString::fromLatin1("l10n/"), QString::null);
+ languageButton->insertLanguage(languageTag, i18n("without name"), TQString::fromLatin1("l10n/"), TQString::null);
}
// Clean up disc space
- for (QStringList::Iterator it = newDictionaryFiles.begin(); it != newDictionaryFiles.end(); ++it) {
- QString filename = KGlobal::dirs()->findResource ("appdata", *it);
+ for (TQStringList::Iterator it = newDictionaryFiles.begin(); it != newDictionaryFiles.end(); ++it) {
+ TQString filename = KGlobal::dirs()->findResource ("appdata", *it);
if (!filename.isEmpty() && !filename.isNull())
- QFile::remove (filename);
+ TQFile::remove (filename);
}
newDictionaryFiles.clear();
}
void WordCompletionWidget::save() {
- QStringList groups = config->groupList();
- for (QStringList::Iterator it = groups.begin(); it != groups.end(); ++it)
+ TQStringList groups = config->groupList();
+ for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it)
if ((*it).startsWith ("Dictionary "))
config->deleteGroup (*it);
int number = 0;
- QListViewItemIterator it(dictionaryList);
+ TQListViewItemIterator it(dictionaryList);
while (it.current()) {
DictionaryListItem *item = dynamic_cast<DictionaryListItem*>(it.current());
if (item != 0) {
- config->setGroup(QString("Dictionary %1").arg(number));
+ config->setGroup(TQString("Dictionary %1").arg(number));
config->writeEntry ("Filename", item->filename());
config->writeEntry ("Name", item->text (0));
config->writeEntry ("Language", item->languageCode());
@@ -170,10 +170,10 @@ void WordCompletionWidget::save() {
config->sync();
// Clean up disc space
- for (QStringList::Iterator it = removedDictionaryFiles.begin(); it != removedDictionaryFiles.end(); ++it) {
- QString filename = KGlobal::dirs()->findResource ("appdata", *it);
+ for (TQStringList::Iterator it = removedDictionaryFiles.begin(); it != removedDictionaryFiles.end(); ++it) {
+ TQString filename = KGlobal::dirs()->findResource ("appdata", *it);
if (!filename.isEmpty() && !filename.isNull())
- QFile::remove (filename);
+ TQFile::remove (filename);
}
removedDictionaryFiles.clear();
}
@@ -181,10 +181,10 @@ void WordCompletionWidget::save() {
/***************************************************************************/
void WordCompletionWidget::addDictionary() {
- QStringList dictionaryNames;
- QStringList dictionaryFiles;
- QStringList dictionaryLanguages;
- QListViewItemIterator it(dictionaryList);
+ TQStringList dictionaryNames;
+ TQStringList dictionaryFiles;
+ TQStringList dictionaryLanguages;
+ TQListViewItemIterator it(dictionaryList);
while (it.current()) {
DictionaryListItem *item = dynamic_cast<DictionaryListItem*>(it.current());
if (item != 0) {
@@ -195,12 +195,12 @@ void WordCompletionWidget::addDictionary() {
++it;
}
DictionaryCreationWizard *wizard = new DictionaryCreationWizard (this, "Dictionary creation wizard", dictionaryNames, dictionaryFiles, dictionaryLanguages);
- if (wizard->exec() == QDialog::Accepted) {
- QString filename = wizard->createDictionary();
+ if (wizard->exec() == TQDialog::Accepted) {
+ TQString filename = wizard->createDictionary();
newDictionaryFiles += filename;
- QString languageTag = wizard->language();
+ TQString languageTag = wizard->language();
if (!languageButton->containsTag(languageTag)) {
- languageButton->insertLanguage(languageTag, i18n("without name"), QString::fromLatin1("l10n/"), QString::null);
+ languageButton->insertLanguage(languageTag, i18n("without name"), TQString::fromLatin1("l10n/"), TQString::null);
}
KListViewItem *item = new DictionaryListItem (dictionaryList,
filename, wizard->name(), languageTag);
@@ -219,10 +219,10 @@ void WordCompletionWidget::deleteDictionary() {
}
void WordCompletionWidget::moveUp() {
- QListViewItem *item = dictionaryList->selectedItem ();
+ TQListViewItem *item = dictionaryList->selectedItem ();
if (item != 0) {
- QListViewItem *above = item->itemAbove();
+ TQListViewItem *above = item->itemAbove();
if (above != 0) {
above->moveItem (item);
@@ -231,10 +231,10 @@ void WordCompletionWidget::moveUp() {
}
void WordCompletionWidget::moveDown() {
- QListViewItem *item = dictionaryList->selectedItem ();
+ TQListViewItem *item = dictionaryList->selectedItem ();
if (item != 0) {
- QListViewItem *next = item->itemBelow();
+ TQListViewItem *next = item->itemBelow();
if (next != 0) {
item->moveItem (next);
@@ -246,12 +246,12 @@ void WordCompletionWidget::exportDictionary() {
DictionaryListItem *item = dynamic_cast<DictionaryListItem*>(dictionaryList->selectedItem ());
if (item != 0) {
- KURL url = KFileDialog::getSaveURL(QString::null, QString::null, this, i18n("Export Dictionary"));
+ KURL url = KFileDialog::getSaveURL(TQString::null, TQString::null, this, i18n("Export Dictionary"));
if (url.isEmpty() || !url.isValid())
return;
if (KIO::NetAccess::exists(url, false, this)) {
- if (KMessageBox::warningContinueCancel(0,QString("<qt>%1</qt>").arg(i18n("The file %1 already exists. "
+ if (KMessageBox::warningContinueCancel(0,TQString("<qt>%1</qt>").arg(i18n("The file %1 already exists. "
"Do you want to overwrite it?").arg(url.url())),i18n("File Exists"),i18n("&Overwrite"))==KMessageBox::Cancel) {
return;
}
@@ -295,11 +295,11 @@ void WordCompletionWidget::selectionChanged() {
}
}
-void WordCompletionWidget::nameChanged (const QString &text) {
- QListViewItem *item = dictionaryList->selectedItem ();
+void WordCompletionWidget::nameChanged (const TQString &text) {
+ TQListViewItem *item = dictionaryList->selectedItem ();
if (item != 0) {
- QString old = item->text(0);
+ TQString old = item->text(0);
if (old != text) {
item->setText(0, text);
@@ -312,8 +312,8 @@ void WordCompletionWidget::languageSelected (int) {
DictionaryListItem *item = dynamic_cast<DictionaryListItem*>(dictionaryList->selectedItem ());
if (item != 0) {
- QString old = item->text(1);
- QString text = languageButton->currentTag();
+ TQString old = item->text(1);
+ TQString text = languageButton->currentTag();
if (old != text) {
item->setLanguage(languageButton->text(), text);
diff --git a/kmouth/wordcompletion/wordcompletionwidget.h b/kmouth/wordcompletion/wordcompletionwidget.h
index 574a4e9..fddf074 100644
--- a/kmouth/wordcompletion/wordcompletionwidget.h
+++ b/kmouth/wordcompletion/wordcompletionwidget.h
@@ -31,7 +31,7 @@ class KLanguageButton;
class WordCompletionWidget : public WordCompletionUI {
Q_OBJECT
public:
- WordCompletionWidget(QWidget *parent, const char *name);
+ WordCompletionWidget(TQWidget *parent, const char *name);
~WordCompletionWidget();
/**
@@ -57,7 +57,7 @@ private slots:
void exportDictionary();
void selectionChanged();
- void nameChanged (const QString &text);
+ void nameChanged (const TQString &text);
void languageSelected (int);
/**
@@ -73,8 +73,8 @@ private:
* Object holding all the configuration
*/
KConfig *config;
- QStringList newDictionaryFiles;
- QStringList removedDictionaryFiles;
+ TQStringList newDictionaryFiles;
+ TQStringList removedDictionaryFiles;
};
#endif
diff --git a/kmouth/wordcompletion/wordlist.cpp b/kmouth/wordcompletion/wordlist.cpp
index 67f05d8..f10feaf 100644
--- a/kmouth/wordcompletion/wordlist.cpp
+++ b/kmouth/wordcompletion/wordlist.cpp
@@ -17,8 +17,8 @@
// $Id$
-#include <qregexp.h>
-#include <qdir.h>
+#include <tqregexp.h>
+#include <tqdir.h>
#include <kapplication.h>
#include <kstandarddirs.h>
@@ -28,7 +28,7 @@
#include "wordlist.h"
namespace WordList {
-void addWords (WordMap &map, QString line);
+void addWords (WordMap &map, TQString line);
XMLParser::XMLParser() {
}
@@ -36,57 +36,57 @@ XMLParser::XMLParser() {
XMLParser::~XMLParser() {
}
-bool XMLParser::warning (const QXmlParseException &) {
+bool XMLParser::warning (const TQXmlParseException &) {
return false;
}
-bool XMLParser::error (const QXmlParseException &) {
+bool XMLParser::error (const TQXmlParseException &) {
return false;
}
-bool XMLParser::fatalError (const QXmlParseException &) {
+bool XMLParser::fatalError (const TQXmlParseException &) {
return false;
}
-QString XMLParser::errorString() {
+TQString XMLParser::errorString() {
return "";
}
bool XMLParser::startDocument() {
- text = QString::null;
+ text = TQString::null;
return true;
}
-bool XMLParser::startElement (const QString &, const QString &,
- const QString &,
- const QXmlAttributes &)
+bool XMLParser::startElement (const TQString &, const TQString &,
+ const TQString &,
+ const TQXmlAttributes &)
{
if (!text.isNull() && !text.isEmpty()) {
addWords (list, text);
- text = QString::null;
+ text = TQString::null;
}
return true;
}
-bool XMLParser::characters (const QString &ch) {
+bool XMLParser::characters (const TQString &ch) {
text += ch;
return true;
}
-bool XMLParser::ignorableWhitespace (const QString &) {
+bool XMLParser::ignorableWhitespace (const TQString &) {
if (!text.isNull() && !text.isEmpty()) {
addWords (list, text);
- text = QString::null;
+ text = TQString::null;
}
return true;
}
-bool XMLParser::endElement (const QString &, const QString &,
- const QString &)
+bool XMLParser::endElement (const TQString &, const TQString &,
+ const TQString &)
{
if (!text.isNull() && !text.isEmpty()) {
addWords (list, text);
- text = QString::null;
+ text = TQString::null;
}
return true;
}
@@ -94,7 +94,7 @@ bool XMLParser::endElement (const QString &, const QString &,
bool XMLParser::endDocument() {
if (!text.isNull() && !text.isEmpty()) {
addWords (list, text);
- text = QString::null;
+ text = TQString::null;
}
return true;
}
@@ -116,13 +116,13 @@ KProgressDialog *progressDialog() {
return pdlg;
}
-bool saveWordList (WordMap map, QString filename) {
- QFile file(filename);
+bool saveWordList (WordMap map, TQString filename) {
+ TQFile file(filename);
if(!file.open(IO_WriteOnly))
return false;
- QTextStream stream(&file);
- stream.setEncoding (QTextStream::UnicodeUTF8);
+ TQTextStream stream(&file);
+ stream.setEncoding (TQTextStream::UnicodeUTF8);
stream << "WPDictFile\n";
WordMap::ConstIterator it;
@@ -134,13 +134,13 @@ bool saveWordList (WordMap map, QString filename) {
/***************************************************************************/
-void addWords (WordMap &map, QString line) {
- QStringList words = QStringList::split(QRegExp("\\W"), line);
+void addWords (WordMap &map, TQString line) {
+ TQStringList words = TQStringList::split(TQRegExp("\\W"), line);
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for (it = words.begin(); it != words.end(); ++it) {
- if (!(*it).contains(QRegExp("\\d|_"))) {
- QString key = (*it).lower();
+ if (!(*it).contains(TQRegExp("\\d|_"))) {
+ TQString key = (*it).lower();
if (map.contains(key))
map[key] += 1;
else
@@ -158,11 +158,11 @@ void addWords (WordMap &map, WordMap add) {
map[it.key()] = it.data();
}
-void addWordsFromFile (WordMap &map, QString filename, QTextStream::Encoding encoding, QTextCodec *codec) {
- QFile xmlfile(filename);
- QXmlInputSource source (&xmlfile);
+void addWordsFromFile (WordMap &map, TQString filename, TQTextStream::Encoding encoding, TQTextCodec *codec) {
+ TQFile xmlfile(filename);
+ TQXmlInputSource source (&xmlfile);
XMLParser parser;
- QXmlSimpleReader reader;
+ TQXmlSimpleReader reader;
reader.setFeature ("http://trolltech.com/xml/features/report-start-end-entity", true);
reader.setContentHandler (&parser);
@@ -170,19 +170,19 @@ void addWordsFromFile (WordMap &map, QString filename, QTextStream::Encoding enc
if (reader.parse(source)) // try to load the file as an xml-file
addWords(map, parser.getList());
else {
- QFile wpdfile(filename);
+ TQFile wpdfile(filename);
if (wpdfile.open(IO_ReadOnly)) {
- QTextStream stream(&wpdfile);
- stream.setEncoding (QTextStream::UnicodeUTF8);
+ TQTextStream stream(&wpdfile);
+ stream.setEncoding (TQTextStream::UnicodeUTF8);
if (!stream.atEnd()) {
- QString s = stream.readLine();
+ TQString s = stream.readLine();
if (s == "WPDictFile") { // Contains the file a weighted word list?
// We can assume that weighted word lists are always UTF8 coded.
while (!stream.atEnd()) {
- QString s = stream.readLine();
+ TQString s = stream.readLine();
if (!(s.isNull() || s.isEmpty())) {
- QStringList list = QStringList::split("\t", s);
+ TQStringList list = TQStringList::split("\t", s);
bool ok;
int weight = list[1].toInt(&ok);
if (ok && (weight > 0)) {
@@ -195,9 +195,9 @@ void addWordsFromFile (WordMap &map, QString filename, QTextStream::Encoding enc
}
}
else { // Count the words in an ordinary text file
- QFile file(filename);
+ TQFile file(filename);
if (file.open(IO_ReadOnly)) {
- QTextStream stream(&file);
+ TQTextStream stream(&file);
if (codec != 0)
stream.setCodec (codec);
else
@@ -215,13 +215,13 @@ void addWordsFromFile (WordMap &map, QString filename, QTextStream::Encoding enc
#include <kdebug.h>
namespace WordList {
-WordMap parseFiles (QStringList files, QTextStream::Encoding encoding, QTextCodec *codec, KProgressDialog *pdlg) {
+WordMap parseFiles (TQStringList files, TQTextStream::Encoding encoding, TQTextCodec *codec, KProgressDialog *pdlg) {
int progress = 0;
int steps = files.count();
int percent = 0;
WordMap map;
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for (progress = 1, it = files.begin(); it != files.end(); ++progress, ++it) {
addWordsFromFile (map, *it, encoding, codec);
@@ -234,7 +234,7 @@ WordMap parseFiles (QStringList files, QTextStream::Encoding encoding, QTextCode
return map;
}
-WordMap mergeFiles (QMap<QString,int> files, KProgressDialog *pdlg) {
+WordMap mergeFiles (TQMap<TQString,int> files, KProgressDialog *pdlg) {
pdlg->setLabel (i18n("Merging dictionaries..."));
pdlg->show();
qApp->processEvents (20);
@@ -245,11 +245,11 @@ WordMap mergeFiles (QMap<QString,int> files, KProgressDialog *pdlg) {
float totalWeight = 0;
long long maxWeight = 0;
- QMap<QString,float> map;
- QMap<QString,int>::ConstIterator it;
+ TQMap<TQString,float> map;
+ TQMap<TQString,int>::ConstIterator it;
for (progress = 1, it = files.begin(); it != files.end(); ++progress, ++it) {
WordMap fileMap;
- addWordsFromFile (fileMap, it.key(), QTextStream::UnicodeUTF8, 0);
+ addWordsFromFile (fileMap, it.key(), TQTextStream::UnicodeUTF8, 0);
long long weight = 0;
WordMap::ConstIterator iter;
@@ -280,52 +280,52 @@ WordMap mergeFiles (QMap<QString,int> files, KProgressDialog *pdlg) {
factor = 1.0 * maxWeight;
WordMap resultMap;
- QMap<QString,float>::ConstIterator iter;
+ TQMap<TQString,float>::ConstIterator iter;
for (iter = map.begin(); iter != map.end(); ++iter)
resultMap[iter.key()] = (int)(factor * iter.data() + 0.5);
return resultMap;
}
-WordMap parseKDEDoc (QString language, KProgressDialog *pdlg) {
+WordMap parseKDEDoc (TQString language, KProgressDialog *pdlg) {
pdlg->setLabel (i18n("Parsing the KDE documentation..."));
pdlg->show();
qApp->processEvents (20);
- QStringList files = KApplication::kApplication()->dirs()->findAllResources ("html", language + "/*.docbook", true, true);
+ TQStringList files = KApplication::kApplication()->dirs()->findAllResources ("html", language + "/*.docbook", true, true);
if ((files.count() == 0) && (language.length() == 5)) {
language = language.left(2);
files = KApplication::kApplication()->dirs()->findAllResources ("html", language + "/*.docbook", true, true);
}
- return parseFiles (files, QTextStream::UnicodeUTF8, 0, pdlg);
+ return parseFiles (files, TQTextStream::UnicodeUTF8, 0, pdlg);
}
-WordMap parseFile (QString filename, QTextStream::Encoding encoding, QTextCodec *codec, KProgressDialog *pdlg) {
+WordMap parseFile (TQString filename, TQTextStream::Encoding encoding, TQTextCodec *codec, KProgressDialog *pdlg) {
pdlg->setLabel (i18n("Parsing file..."));
pdlg->show();
qApp->processEvents (20);
- QStringList files = filename;
+ TQStringList files = filename;
return parseFiles (files, encoding, codec, pdlg);
}
-WordMap parseDir (QString directory, QTextStream::Encoding encoding, QTextCodec *codec, KProgressDialog *pdlg) {
+WordMap parseDir (TQString directory, TQTextStream::Encoding encoding, TQTextCodec *codec, KProgressDialog *pdlg) {
pdlg->setLabel (i18n("Parsing directory..."));
pdlg->show();
qApp->processEvents (20);
- QStringList directories;
+ TQStringList directories;
directories += directory;
- QStringList files;
- for (QStringList::Iterator it = directories.begin(); it != directories.end(); it = directories.remove(it)) {
- QDir dir(*it);
- const QFileInfoList *entries = dir.entryInfoList ("*", QDir::Dirs | QDir::Files | QDir::NoSymLinks | QDir::Readable);
+ TQStringList files;
+ for (TQStringList::Iterator it = directories.begin(); it != directories.end(); it = directories.remove(it)) {
+ TQDir dir(*it);
+ const QFileInfoList *entries = dir.entryInfoList ("*", TQDir::Dirs | TQDir::Files | TQDir::NoSymLinks | TQDir::Readable);
if (entries != 0) {
QFileInfoListIterator iter (*entries);
while ((iter.current()) != 0) {
- QString name = iter.current()->fileName();
+ TQString name = iter.current()->fileName();
if (name != "." && name != "..") {
if (iter.current()->isDir())
directories += iter.current()->filePath ();
@@ -347,23 +347,23 @@ WordMap parseDir (QString directory, QTextStream::Encoding encoding, QTextCodec
struct AffEntry {
bool cross;
int charsToRemove;
- QString add;
- QStringList condition;
+ TQString add;
+ TQStringList condition;
};
-typedef QValueList<AffEntry> AffList;
-typedef QMap<QChar,AffList> AffMap;
+typedef TQValueList<AffEntry> AffList;
+typedef TQMap<TQChar,AffList> AffMap;
/** Loads an *.aff file (part of OpenOffice.org dictionaries)
*/
-void loadAffFile(const QString &filename, AffMap &prefixes, AffMap &suffixes) {
+void loadAffFile(const TQString &filename, AffMap &prefixes, AffMap &suffixes) {
bool cross = false;
- QFile afile(filename);
+ TQFile afile(filename);
if (afile.open(IO_ReadOnly)) {
- QTextStream stream(&afile);
+ TQTextStream stream(&afile);
while (!stream.atEnd()) {
- QString s = stream.readLine();
- QStringList fields = QStringList::split(QRegExp("\\s"), s);
+ TQString s = stream.readLine();
+ TQStringList fields = TQStringList::split(TQRegExp("\\s"), s);
if (fields.count() == 4) {
cross = (fields[2] == "Y");
@@ -379,16 +379,16 @@ void loadAffFile(const QString &filename, AffMap &prefixes, AffMap &suffixes) {
e.add = fields[3];
if (fields[4] != ".") {
- QString condition = fields[4];
+ TQString condition = fields[4];
for (uint idx = 0; idx < condition.length(); ++idx) {
if (condition[idx] == '[') {
- QString code;
+ TQString code;
for (++idx; (idx < condition.length()) && condition[idx] != ']'; ++idx)
code += condition[idx];
e.condition << code;
}
else
- e.condition << QString(condition[idx]);
+ e.condition << TQString(condition[idx]);
}
}
@@ -413,20 +413,20 @@ void loadAffFile(const QString &filename, AffMap &prefixes, AffMap &suffixes) {
}
/** Checks if the given word matches the given condition. Each entry of the
- * QStringList "condition" describes one character of the word. (If the word
+ * TQStringList "condition" describes one character of the word. (If the word
* has more characters than condition entries only the last characters are
* compared).
* Each entry contains either all valid characters (if it does _not_ start
* with "^") or all invalid characters (if it starts with "^").
*/
-inline bool checkCondition (const QString &word, const QStringList &condition) {
+inline bool checkCondition (const TQString &word, const TQStringList &condition) {
if (condition.count() == 0)
return true;
if (word.length() < condition.count())
return false;
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
int idx;
for (it = condition.begin(), idx = word.length()-condition.count();
it != condition.end();
@@ -443,7 +443,7 @@ inline bool checkCondition (const QString &word, const QStringList &condition) {
* @param modifiers discribes which suffixes are valid
* @param cross true if the word has a prefix
*/
-inline void checkWord(const QString &word, const QString &modifiers, bool cross, const WordMap &map, WordMap &checkedMap, const AffMap &suffixes) {
+inline void checkWord(const TQString &word, const TQString &modifiers, bool cross, const WordMap &map, WordMap &checkedMap, const AffMap &suffixes) {
for (uint i = 0; i < modifiers.length(); i++) {
if (suffixes.contains(modifiers[i])) {
AffList sList = suffixes[modifiers[i]];
@@ -453,7 +453,7 @@ inline void checkWord(const QString &word, const QString &modifiers, bool cross,
if (((*sIt).cross || !cross)
&& (checkCondition(word, (*sIt).condition)))
{
- QString sWord = word.left(word.length()-(*sIt).charsToRemove) + (*sIt).add;
+ TQString sWord = word.left(word.length()-(*sIt).charsToRemove) + (*sIt).add;
if (map.contains(sWord))
checkedMap[sWord] = map[sWord];
}
@@ -466,7 +466,7 @@ inline void checkWord(const QString &word, const QString &modifiers, bool cross,
* copies the resulting words from map to checkedMap.
* @param modifiers discribes which pre- and suffixes are valid
*/
-void checkWord (const QString &word, const QString &modifiers, const WordMap &map, WordMap &checkedMap, const AffMap &prefixes, const AffMap &suffixes) {
+void checkWord (const TQString &word, const TQString &modifiers, const WordMap &map, WordMap &checkedMap, const AffMap &prefixes, const AffMap &suffixes) {
if (map.contains(word))
checkedMap[word] = map[word];
@@ -478,7 +478,7 @@ void checkWord (const QString &word, const QString &modifiers, const WordMap &ma
AffList::ConstIterator pIt;
for (pIt = pList.begin(); pIt != pList.end(); ++pIt) {
- QString pWord = (*pIt).add + word;
+ TQString pWord = (*pIt).add + word;
if (map.contains(pWord))
checkedMap[pWord] = map[pWord];
@@ -488,7 +488,7 @@ void checkWord (const QString &word, const QString &modifiers, const WordMap &ma
}
}
-WordMap spellCheck (WordMap map, QString dictionary, KProgressDialog *pdlg) {
+WordMap spellCheck (WordMap map, TQString dictionary, KProgressDialog *pdlg) {
if (dictionary.endsWith(".dic")) {
AffMap prefixes;
@@ -509,20 +509,20 @@ WordMap spellCheck (WordMap map, QString dictionary, KProgressDialog *pdlg) {
int steps = 0;
int percent = 0;
- QFile dfile(dictionary);
+ TQFile dfile(dictionary);
if (dfile.open(IO_ReadOnly)) {
- QTextStream stream(&dfile);
+ TQTextStream stream(&dfile);
if (!stream.atEnd()) {
- QString s = stream.readLine(); // Number of words
+ TQString s = stream.readLine(); // Number of words
steps = s.toInt();
}
while (!stream.atEnd()) {
- QString s = stream.readLine();
+ TQString s = stream.readLine();
if (s.contains("/")) {
- QString word = s.left(s.find("/")).lower();
- QString modifiers = s.right(s.length() - s.find("/"));
+ TQString word = s.left(s.find("/")).lower();
+ TQString modifiers = s.right(s.length() - s.find("/"));
checkWord(word, modifiers, map, checkedMap, prefixes, suffixes);
}
diff --git a/kmouth/wordcompletion/wordlist.h b/kmouth/wordcompletion/wordlist.h
index d2f85ac..1e8da1a 100644
--- a/kmouth/wordcompletion/wordlist.h
+++ b/kmouth/wordcompletion/wordlist.h
@@ -20,29 +20,29 @@
#ifndef WORDLIST_H
#define WORDLIST_H
-#include <qxml.h>
-#include <qvaluestack.h>
-#include <qstring.h>
-#include <qobject.h>
-#include <qmap.h>
+#include <tqxml.h>
+#include <tqvaluestack.h>
+#include <tqstring.h>
+#include <tqobject.h>
+#include <tqmap.h>
class QTextCodec;
class KProgressDialog;
namespace WordList {
-typedef QMap<QString,int> WordMap;
+typedef TQMap<TQString,int> WordMap;
KProgressDialog *progressDialog();
-WordMap parseKDEDoc (QString language, KProgressDialog *pdlg);
-WordMap parseFile (QString filename, QTextStream::Encoding encoding, QTextCodec *codec, KProgressDialog *pdlg);
-WordMap parseDir (QString directory, QTextStream::Encoding encoding, QTextCodec *codec, KProgressDialog *pdlg);
-WordMap mergeFiles (QMap<QString,int> files, KProgressDialog *pdlg);
+WordMap parseKDEDoc (TQString language, KProgressDialog *pdlg);
+WordMap parseFile (TQString filename, TQTextStream::Encoding encoding, TQTextCodec *codec, KProgressDialog *pdlg);
+WordMap parseDir (TQString directory, TQTextStream::Encoding encoding, TQTextCodec *codec, KProgressDialog *pdlg);
+WordMap mergeFiles (TQMap<TQString,int> files, KProgressDialog *pdlg);
-WordMap spellCheck (WordMap wordlist, QString dictionary, KProgressDialog *pdlg);
+WordMap spellCheck (WordMap wordlist, TQString dictionary, KProgressDialog *pdlg);
-bool saveWordList (WordMap map, QString filename);
+bool saveWordList (WordMap map, TQString filename);
/**
* This class implements a parser for reading docbooks and generating word
@@ -50,31 +50,31 @@ bool saveWordList (WordMap map, QString filename);
* @author Gunnar Schmi Dt
*/
-class XMLParser : public QXmlDefaultHandler {
+class XMLParser : public TQXmlDefaultHandler {
public:
XMLParser();
~XMLParser();
- bool warning (const QXmlParseException &exception);
- bool error (const QXmlParseException &exception);
- bool fatalError (const QXmlParseException &exception);
- QString errorString();
+ bool warning (const TQXmlParseException &exception);
+ bool error (const TQXmlParseException &exception);
+ bool fatalError (const TQXmlParseException &exception);
+ TQString errorString();
/** Processes the start of the document. */
bool startDocument();
/** Processes the start tag of an element. */
- bool startElement (const QString &, const QString &, const QString &name,
- const QXmlAttributes &attributes);
+ bool startElement (const TQString &, const TQString &, const TQString &name,
+ const TQXmlAttributes &attributes);
/** Processes a chunk of normal character data. */
- bool characters (const QString &ch);
+ bool characters (const TQString &ch);
/** Processes whitespace. */
- bool ignorableWhitespace (const QString &ch);
+ bool ignorableWhitespace (const TQString &ch);
/** Processes the end tag of an element. */
- bool endElement (const QString &, const QString &, const QString &name);
+ bool endElement (const TQString &, const TQString &, const TQString &name);
/** Processes the end of the document. */
bool endDocument();
@@ -84,7 +84,7 @@ public:
private:
WordMap list;
- QString text;
+ TQString text;
};
}