summaryrefslogtreecommitdiffstats
path: root/kmouth
diff options
context:
space:
mode:
Diffstat (limited to 'kmouth')
-rw-r--r--kmouth/configwizard.cpp16
-rw-r--r--kmouth/configwizard.h4
-rw-r--r--kmouth/kmouth.cpp80
-rw-r--r--kmouth/kmouth.h6
-rw-r--r--kmouth/optionsdialog.cpp48
-rw-r--r--kmouth/optionsdialog.h8
-rw-r--r--kmouth/phrasebook/phrasebook.cpp146
-rw-r--r--kmouth/phrasebook/phrasebook.h72
-rw-r--r--kmouth/phrasebook/phrasebookdialog.cpp226
-rw-r--r--kmouth/phrasebook/phrasebookdialog.h58
-rw-r--r--kmouth/phrasebook/phrasebookparser.cpp22
-rw-r--r--kmouth/phrasebook/phrasebookparser.h24
-rw-r--r--kmouth/phrasebook/phrasetree.cpp126
-rw-r--r--kmouth/phrasebook/phrasetree.h40
-rw-r--r--kmouth/phraseedit.cpp4
-rw-r--r--kmouth/phraseedit.h4
-rw-r--r--kmouth/phraselist.cpp124
-rw-r--r--kmouth/phraselist.h32
-rw-r--r--kmouth/phraselistitem.cpp20
-rw-r--r--kmouth/phraselistitem.h10
-rw-r--r--kmouth/speech.cpp66
-rw-r--r--kmouth/speech.h14
-rw-r--r--kmouth/texttospeechconfigurationwidget.cpp26
-rw-r--r--kmouth/texttospeechconfigurationwidget.h6
-rw-r--r--kmouth/texttospeechsystem.cpp32
-rw-r--r--kmouth/texttospeechsystem.h16
-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
42 files changed, 1023 insertions, 1023 deletions
diff --git a/kmouth/configwizard.cpp b/kmouth/configwizard.cpp
index d22c463..3d99005 100644
--- a/kmouth/configwizard.cpp
+++ b/kmouth/configwizard.cpp
@@ -17,8 +17,8 @@
#include "configwizard.h"
-#include <qlayout.h>
-#include <qlabel.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
#include <klistview.h>
#include <klocale.h>
#include <kapplication.h>
@@ -31,7 +31,7 @@
#include "wordcompletion/wordcompletion.h"
#include "wordcompletion/dictionarycreationwizard.h"
-ConfigWizard::ConfigWizard (QWidget *parent, const char *name, KConfig *config)
+ConfigWizard::ConfigWizard (TQWidget *parent, const char *name, KConfig *config)
: KWizard(parent, name, true)
{
setCaption (i18n("Initial Configuration - KMouth"));
@@ -63,7 +63,7 @@ void ConfigWizard::initCommandPage(KConfig *config) {
}
void ConfigWizard::initBookPage() {
- QString standardBook = KApplication::kApplication()->dirs()->findResource("appdata", "standard.phrasebook");
+ TQString standardBook = KApplication::kApplication()->dirs()->findResource("appdata", "standard.phrasebook");
bool displayBook = (standardBook.isNull() || standardBook.isEmpty());
if (displayBook) {
@@ -80,15 +80,15 @@ void ConfigWizard::initBookPage() {
void ConfigWizard::initCompletion (KConfig *config) {
if (!WordCompletion::isConfigured()) {
- QString dictionaryFile = KApplication::kApplication()->dirs()->findResource("appdata", "dictionary.txt");
- QFile file(dictionaryFile);
+ TQString dictionaryFile = KApplication::kApplication()->dirs()->findResource("appdata", "dictionary.txt");
+ TQFile file(dictionaryFile);
if (file.exists()) {
// If there is a word completion dictionary but no entry in the
// configuration file, we need to add it there.
config->setGroup("Dictionary 0");
config->writeEntry ("Filename", "dictionary.txt");
config->writeEntry ("Name", "Default");
- config->writeEntry ("Language", QString::null);
+ config->writeEntry ("Language", TQString::null);
config->sync();
}
}
@@ -128,7 +128,7 @@ void ConfigWizard::saveConfig (KConfig *config) {
bool ConfigWizard::requestConfiguration () {
if (commandWidget != 0 || bookWidget != 0 || completionWidget != 0)
- return (exec() == QDialog::Accepted);
+ return (exec() == TQDialog::Accepted);
else
return false;
}
diff --git a/kmouth/configwizard.h b/kmouth/configwizard.h
index 8ddcb60..112e25a 100644
--- a/kmouth/configwizard.h
+++ b/kmouth/configwizard.h
@@ -19,7 +19,7 @@
#ifndef CONFIGWIZARD_H
#define CONFIGWIZARD_H
-#include <qwidget.h>
+#include <tqwidget.h>
#include <kwizard.h>
@@ -36,7 +36,7 @@ class CompletionWizardWidget;
class ConfigWizard : public KWizard {
Q_OBJECT
public:
- ConfigWizard (QWidget *parent, const char *name, KConfig *config);
+ ConfigWizard (TQWidget *parent, const char *name, KConfig *config);
~ConfigWizard();
bool configurationNeeded ();
diff --git a/kmouth/kmouth.cpp b/kmouth/kmouth.cpp
index c78a010..76c715f 100644
--- a/kmouth/kmouth.cpp
+++ b/kmouth/kmouth.cpp
@@ -16,8 +16,8 @@
***************************************************************************/
// include files for QT
-#include <qdir.h>
-#include <qpainter.h>
+#include <tqdir.h>
+#include <tqpainter.h>
// include files for KDE
#include <kiconloader.h>
@@ -40,7 +40,7 @@
#define ID_STATUS_MSG 1
-KMouthApp::KMouthApp(QWidget* , const char* name):KMainWindow(0, name)
+KMouthApp::KMouthApp(TQWidget* , const char* name):KMainWindow(0, name)
{
isConfigured = false;
config=kapp->config();
@@ -51,10 +51,10 @@ KMouthApp::KMouthApp(QWidget* , const char* name):KMainWindow(0, name)
initPhraseList();
initActions();
optionsDialog = new OptionsDialog(this);
- connect (optionsDialog, SIGNAL(configurationChanged ()),
- this, SLOT(slotConfigurationChanged ()));
- connect (optionsDialog, SIGNAL(configurationChanged ()),
- phraseList, SLOT(configureCompletion ()));
+ connect (optionsDialog, TQT_SIGNAL(configurationChanged ()),
+ this, TQT_SLOT(slotConfigurationChanged ()));
+ connect (optionsDialog, TQT_SIGNAL(configurationChanged ()),
+ phraseList, TQT_SLOT(configureCompletion ()));
phrases = new KActionCollection (this);
@@ -95,57 +95,57 @@ bool KMouthApp::configured() {
void KMouthApp::initActions() {
// The "File" menu
- fileOpen = new KAction(i18n("&Open as History..."), "phrasehistory_open", KStdAccel::open(), this, SLOT(slotFileOpen()), actionCollection(),"file_open");
+ fileOpen = new KAction(i18n("&Open as History..."), "phrasehistory_open", KStdAccel::open(), this, TQT_SLOT(slotFileOpen()), actionCollection(),"file_open");
fileOpen->setStatusText(i18n("Opens an existing file as history"));
fileOpen->setWhatsThis (i18n("Opens an existing file as history"));
- fileSaveAs = new KAction(i18n("Save &History As..."), "phrasehistory_save", KStdAccel::save(), this, SLOT(slotFileSaveAs()), actionCollection(),"file_save_as");
+ fileSaveAs = new KAction(i18n("Save &History As..."), "phrasehistory_save", KStdAccel::save(), this, TQT_SLOT(slotFileSaveAs()), actionCollection(),"file_save_as");
fileSaveAs->setStatusText(i18n("Saves the actual history as..."));
fileSaveAs->setWhatsThis (i18n("Saves the actual history as..."));
- filePrint = new KAction(i18n("&Print History..."), "phrasehistory_print", KStdAccel::print(), this, SLOT(slotFilePrint()), actionCollection(),"file_print");
+ filePrint = new KAction(i18n("&Print History..."), "phrasehistory_print", KStdAccel::print(), this, TQT_SLOT(slotFilePrint()), actionCollection(),"file_print");
filePrint->setStatusText(i18n("Prints out the actual history"));
filePrint->setWhatsThis (i18n("Prints out the actual history"));
- fileQuit = KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection());
+ fileQuit = KStdAction::quit(this, TQT_SLOT(slotFileQuit()), actionCollection());
fileQuit->setStatusText(i18n("Quits the application"));
fileQuit->setWhatsThis (i18n("Quits the application"));
// The "Edit" menu
- editCut = KStdAction::cut(phraseList, SLOT(cut()), actionCollection());
+ editCut = KStdAction::cut(phraseList, TQT_SLOT(cut()), actionCollection());
editCut->setStatusText(i18n("Cuts the selected section and puts it to the clipboard"));
editCut->setWhatsThis (i18n("Cuts the selected section and puts it to the clipboard. If there is some text selected in the edit field it is placed it on the clipboard. Otherwise the selected sentences in the history (if any) are placed on the clipboard."));
- editCopy = KStdAction::copy(phraseList, SLOT(copy()), actionCollection());
+ editCopy = KStdAction::copy(phraseList, TQT_SLOT(copy()), actionCollection());
editCopy->setStatusText(i18n("Copies the selected section to the clipboard"));
editCopy->setWhatsThis (i18n("Copies the selected section to the clipboard. If there is some text selected in the edit field it is copied to the clipboard. Otherwise the selected sentences in the history (if any) are copied to the clipboard."));
- editPaste = KStdAction::paste(phraseList, SLOT(paste()), actionCollection());
+ editPaste = KStdAction::paste(phraseList, TQT_SLOT(paste()), actionCollection());
editPaste->setStatusText(i18n("Pastes the clipboard contents to actual position"));
editPaste->setWhatsThis (i18n("Pastes the clipboard contents at the current cursor position into the edit field."));
- editSpeak = new KAction (i18n("&Speak"), "speak", 0, phraseList, SLOT(speak()), actionCollection(),"edit_speak");
+ editSpeak = new KAction (i18n("&Speak"), "speak", 0, phraseList, TQT_SLOT(speak()), actionCollection(),"edit_speak");
editSpeak->setStatusText(i18n("Speaks the currently active sentence(s)"));
editSpeak->setWhatsThis (i18n("Speaks the currently active sentence(s). If there is some text in the edit field it is spoken. Otherwise the selected sentences in the history (if any) are spoken."));
// The "Phrase book" menu
- phrasebookEdit = new KAction(i18n("&Edit..."), 0, 0, this, SLOT(slotEditPhrasebook()), actionCollection(),"phrasebook_edit");
+ phrasebookEdit = new KAction(i18n("&Edit..."), 0, 0, this, TQT_SLOT(slotEditPhrasebook()), actionCollection(),"phrasebook_edit");
// The "Options" menu
- viewMenuBar = KStdAction::showMenubar(this, SLOT(slotViewMenuBar()), actionCollection());
- viewToolBar = KStdAction::showToolbar(this, SLOT(slotViewToolBar()), actionCollection());
+ viewMenuBar = KStdAction::showMenubar(this, TQT_SLOT(slotViewMenuBar()), actionCollection());
+ viewToolBar = KStdAction::showToolbar(this, TQT_SLOT(slotViewToolBar()), actionCollection());
viewToolBar->setStatusText(i18n("Enables/disables the toolbar"));
viewToolBar->setWhatsThis (i18n("Enables/disables the toolbar"));
- viewPhrasebookBar = new KToggleAction (i18n("Show P&hrasebook Bar"), 0, 0, this, SLOT(slotViewPhrasebookBar()), actionCollection(), "showPhrasebookBar");
+ viewPhrasebookBar = new KToggleAction (i18n("Show P&hrasebook Bar"), 0, 0, this, TQT_SLOT(slotViewPhrasebookBar()), actionCollection(), "showPhrasebookBar");
viewPhrasebookBar->setStatusText(i18n("Enables/disables the phrasebook bar"));
viewPhrasebookBar->setWhatsThis (i18n("Enables/disables the phrasebook bar"));
- viewStatusBar = KStdAction::showStatusbar(this, SLOT(slotViewStatusBar()), actionCollection());
+ viewStatusBar = KStdAction::showStatusbar(this, TQT_SLOT(slotViewStatusBar()), actionCollection());
viewStatusBar->setStatusText(i18n("Enables/disables the statusbar"));
viewStatusBar->setWhatsThis (i18n("Enables/disables the statusbar"));
- configureTTS = new KAction (i18n("&Configure KMouth..."), "configure", 0, this, SLOT(slotConfigureTTS()), actionCollection(), "configureTTS");
+ configureTTS = new KAction (i18n("&Configure KMouth..."), "configure", 0, this, TQT_SLOT(slotConfigureTTS()), actionCollection(), "configureTTS");
configureTTS->setStatusText(i18n("Opens the configuration dialog"));
configureTTS->setWhatsThis (i18n("Opens the configuration dialog"));
@@ -153,27 +153,27 @@ void KMouthApp::initActions() {
// The "Help" menu will automatically get created.
// The popup menu of the list of spoken sentences
- phraseListSpeak = new KAction (i18n("&Speak"), "speak", 0, phraseList, SLOT(speakListSelection()), actionCollection(), "phraselist_speak");
+ phraseListSpeak = new KAction (i18n("&Speak"), "speak", 0, phraseList, TQT_SLOT(speakListSelection()), actionCollection(), "phraselist_speak");
phraseListSpeak->setStatusText(i18n("Speaks the currently selected phrases in the history"));
phraseListSpeak->setWhatsThis (i18n("Speaks the currently selected phrases in the history"));
- phraseListRemove = new KAction (i18n("&Delete"), "editdelete", 0, phraseList, SLOT(removeListSelection()), actionCollection(), "phraselist_remove");
+ phraseListRemove = new KAction (i18n("&Delete"), "editdelete", 0, phraseList, TQT_SLOT(removeListSelection()), actionCollection(), "phraselist_remove");
phraseListRemove->setStatusText(i18n("Deletes the currently selected phrases from the history"));
phraseListRemove->setWhatsThis (i18n("Deletes the currently selected phrases from the history"));
- phraseListCut = new KAction (i18n("Cu&t"), "editcut", 0, phraseList, SLOT(cutListSelection()), actionCollection(), "phraselist_cut");
+ phraseListCut = new KAction (i18n("Cu&t"), "editcut", 0, phraseList, TQT_SLOT(cutListSelection()), actionCollection(), "phraselist_cut");
phraseListCut->setStatusText(i18n("Cuts the currently selected phrases from the history and puts them to the clipboard"));
phraseListCut->setWhatsThis (i18n("Cuts the currently selected phrases from the history and puts them to the clipboard"));
- phraseListCopy = new KAction (i18n("&Copy"), "editcopy", 0, phraseList, SLOT(copyListSelection()), actionCollection(), "phraselist_copy");
+ phraseListCopy = new KAction (i18n("&Copy"), "editcopy", 0, phraseList, TQT_SLOT(copyListSelection()), actionCollection(), "phraselist_copy");
phraseListCut->setStatusText(i18n("Copies the currently selected phrases from the history to the clipboard"));
phraseListCut->setWhatsThis (i18n("Copies the currently selected phrases from the history to the clipboard"));
- phraselistSelectAll = new KAction (i18n("Select &All Entries"), 0, 0, phraseList, SLOT(selectAllEntries()), actionCollection(),"phraselist_select_all");
+ phraselistSelectAll = new KAction (i18n("Select &All Entries"), 0, 0, phraseList, TQT_SLOT(selectAllEntries()), actionCollection(),"phraselist_select_all");
phraselistSelectAll->setStatusText(i18n("Selects all phrases in the history"));
phraselistSelectAll->setWhatsThis (i18n("Selects all phrases in the history"));
- phraselistDeselectAll = new KAction (i18n("D&eselect All Entries"), 0, 0, phraseList, SLOT(deselectAllEntries()), actionCollection(),"phraselist_deselect_all");
+ phraselistDeselectAll = new KAction (i18n("D&eselect All Entries"), 0, 0, phraseList, TQT_SLOT(deselectAllEntries()), actionCollection(),"phraselist_deselect_all");
phraselistDeselectAll->setStatusText(i18n("Deselects all phrases in the history"));
phraselistDeselectAll->setWhatsThis (i18n("Deselects all phrases in the history"));
@@ -255,7 +255,7 @@ void KMouthApp::readOptions()
toolBarPos=(KToolBar::BarPosition) config->readNumEntry("ToolBarPos", KToolBar::Top);
toolBar("mainToolBar")->setBarPos(toolBarPos);
- QSize size=config->readSizeEntry("Geometry");
+ TQSize size=config->readSizeEntry("Geometry");
if(!size.isEmpty())
{
resize(size);
@@ -266,7 +266,7 @@ void KMouthApp::readOptions()
toolBar("mainToolBar")->applySettings (config, "mainToolBar");
toolBar("phrasebookBar")->applySettings (config, "phrasebookBar");
- QString standardBook = KApplication::kApplication()->dirs()->findResource("appdata", "standard.phrasebook");
+ TQString standardBook = KApplication::kApplication()->dirs()->findResource("appdata", "standard.phrasebook");
if (!standardBook.isEmpty()) {
PhraseBook book;
book.open(KURL::fromPathOrURL( standardBook ));
@@ -302,7 +302,7 @@ void KMouthApp::enableMenuEntries(bool existSelectedEntries, bool existDeselecte
}
/////////////////////////////////////////////////////////////////////
-// SLOT IMPLEMENTATION
+// TQT_SLOT IMPLEMENTATION
/////////////////////////////////////////////////////////////////////
void KMouthApp::slotFileOpen() {
@@ -358,10 +358,10 @@ void KMouthApp::slotEditPhrasebook () {
PhraseBookDialog *phraseBookDialog = PhraseBookDialog::get();
// As we do not know whether the we are already connected to the slot,
// we first disconnect and then connect again.
- disconnect (phraseBookDialog, SIGNAL(phrasebookConfirmed (PhraseBook &)),
- this, SLOT(slotPhrasebookConfirmed (PhraseBook &)));
- connect (phraseBookDialog, SIGNAL(phrasebookConfirmed (PhraseBook &)),
- this, SLOT(slotPhrasebookConfirmed (PhraseBook &)));
+ disconnect (phraseBookDialog, TQT_SIGNAL(phrasebookConfirmed (PhraseBook &)),
+ this, TQT_SLOT(slotPhrasebookConfirmed (PhraseBook &)));
+ connect (phraseBookDialog, TQT_SIGNAL(phrasebookConfirmed (PhraseBook &)),
+ this, TQT_SLOT(slotPhrasebookConfirmed (PhraseBook &)));
// As we do not know whether the phrase book edit window is already open,
// we first open and then raise it, so that it is surely the top window.
@@ -437,7 +437,7 @@ void KMouthApp::slotConfigureTTS() {
}
-void KMouthApp::slotStatusMsg(const QString &text)
+void KMouthApp::slotStatusMsg(const TQString &text)
{
///////////////////////////////////////////////////////////////////
// change status message permanently
@@ -446,8 +446,8 @@ void KMouthApp::slotStatusMsg(const QString &text)
}
void KMouthApp::slotPhrasebookConfirmed (PhraseBook &book) {
- QString name = "phrasebooks";
- QPopupMenu *popup = (QPopupMenu *)factory()->container(name, this);
+ TQString name = "phrasebooks";
+ TQPopupMenu *popup = (TQPopupMenu *)factory()->container(name, this);
KToolBar *toolbar = toolBar ("phrasebookBar");
KActionPtrList actions = phrases->actions ();
@@ -458,9 +458,9 @@ void KMouthApp::slotPhrasebookConfirmed (PhraseBook &book) {
delete phrases;
phrases = new KActionCollection (this, actionCollection());
- book.addToGUI (popup, toolbar, phrases, this, SLOT(slotPhraseSelected (const QString &)));
+ book.addToGUI (popup, toolbar, phrases, this, TQT_SLOT(slotPhraseSelected (const TQString &)));
- QString bookLocation = KApplication::kApplication()->dirs()->saveLocation ("appdata", "/");
+ TQString bookLocation = KApplication::kApplication()->dirs()->saveLocation ("appdata", "/");
if (!bookLocation.isNull() && !bookLocation.isEmpty()) {
book.save (KURL::fromPathOrURL( bookLocation + "standard.phrasebook" ));
}
@@ -471,7 +471,7 @@ void KMouthApp::slotConfigurationChanged()
optionsDialog->saveOptions (config);
}
-void KMouthApp::slotPhraseSelected (const QString &phrase) {
+void KMouthApp::slotPhraseSelected (const TQString &phrase) {
phraseList->insert (phrase);
if (optionsDialog->isSpeakImmediately())
phraseList->speak ();
diff --git a/kmouth/kmouth.h b/kmouth/kmouth.h
index 6ff6bad..ba7756d 100644
--- a/kmouth/kmouth.h
+++ b/kmouth/kmouth.h
@@ -60,7 +60,7 @@ class KMouthApp : public KMainWindow
public:
/** construtor of KMouthApp, calls all init functions to create the application.
*/
- KMouthApp(QWidget* parent=0, const char* name=0);
+ KMouthApp(TQWidget* parent=0, const char* name=0);
~KMouthApp();
/** Returns true if the configuration wizard was not needed or when it
* was successfully completed.
@@ -139,13 +139,13 @@ class KMouthApp : public KMainWindow
/** changes the statusbar contents for the standard label permanently, used to indicate current actions.
* @param text the text that is displayed in the statusbar
*/
- void slotStatusMsg(const QString &text);
+ void slotStatusMsg(const TQString &text);
void slotPhrasebookConfirmed (PhraseBook &book);
void slotConfigurationChanged();
- void slotPhraseSelected (const QString &phrase);
+ void slotPhraseSelected (const TQString &phrase);
private:
bool isConfigured;
diff --git a/kmouth/optionsdialog.cpp b/kmouth/optionsdialog.cpp
index 4873167..a16e1e4 100644
--- a/kmouth/optionsdialog.cpp
+++ b/kmouth/optionsdialog.cpp
@@ -16,13 +16,13 @@
***************************************************************************/
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qwhatsthis.h>
-#include <qgrid.h>
-#include <qtabwidget.h>
-#include <qpixmap.h>
-#include <qfile.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqwhatsthis.h>
+#include <tqgrid.h>
+#include <tqtabwidget.h>
+#include <tqpixmap.h>
+#include <tqfile.h>
#include <kcombobox.h>
#include <klocale.h>
@@ -39,7 +39,7 @@
#include "texttospeechconfigurationwidget.h"
#include "speech.h"
-PreferencesWidget::PreferencesWidget (QWidget *parent, const char *name)
+PreferencesWidget::PreferencesWidget (TQWidget *parent, const char *name)
: PreferencesUI (parent, name)
{
speakCombo->setCurrentItem (1);
@@ -113,16 +113,16 @@ bool PreferencesWidget::isSpeakImmediately () {
/***************************************************************************/
-OptionsDialog::OptionsDialog (QWidget *parent)
+OptionsDialog::OptionsDialog (TQWidget *parent)
: KDialogBase(IconList, i18n("Configuration"), Ok|Apply|Cancel|Help, Ok,
parent, "configuration", false, true)
{
setHelp ("config-dialog");
- QPixmap iconGeneral = KGlobal::iconLoader()->loadIcon("configure", KIcon::NoGroup, KIcon::SizeMedium);
- QGrid *pageGeneral = addGridPage (1, Qt::Horizontal, i18n("General Options"), QString::null, iconGeneral);
+ TQPixmap iconGeneral = KGlobal::iconLoader()->loadIcon("configure", KIcon::NoGroup, KIcon::SizeMedium);
+ TQGrid *pageGeneral = addGridPage (1, Qt::Horizontal, i18n("General Options"), TQString::null, iconGeneral);
- tabCtl = new QTabWidget (pageGeneral, "general");
+ tabCtl = new TQTabWidget (pageGeneral, "general");
behaviourWidget = new PreferencesWidget (tabCtl, "prefPage");
behaviourWidget->layout()->setMargin(KDialog::marginHint());
@@ -132,17 +132,17 @@ OptionsDialog::OptionsDialog (QWidget *parent)
commandWidget->layout()->setMargin(KDialog::marginHint());
tabCtl->addTab (commandWidget, i18n("&Text-to-Speech"));
- QPixmap iconCompletion = KGlobal::iconLoader()->loadIcon("keyboard", KIcon::NoGroup, KIcon::SizeMedium);
- QGrid *pageCompletion = addGridPage (1, Qt::Horizontal, i18n("Word Completion"), QString::null, iconCompletion);
+ TQPixmap iconCompletion = KGlobal::iconLoader()->loadIcon("keyboard", KIcon::NoGroup, KIcon::SizeMedium);
+ TQGrid *pageCompletion = addGridPage (1, Qt::Horizontal, i18n("Word Completion"), TQString::null, iconCompletion);
completionWidget = new WordCompletionWidget(pageCompletion, "Word Completion widget");
kttsd = loadKttsd();
if (kttsd != 0) {
- QPixmap iconKttsd = KGlobal::iconLoader()->loadIcon("multimedia", KIcon::NoGroup, KIcon::SizeMedium);
- QGrid *pageKttsd = addGridPage (1, Qt::Horizontal, i18n("KTTSD Speech Service"),
+ TQPixmap iconKttsd = KGlobal::iconLoader()->loadIcon("multimedia", KIcon::NoGroup, KIcon::SizeMedium);
+ TQGrid *pageKttsd = addGridPage (1, Qt::Horizontal, i18n("KTTSD Speech Service"),
i18n("KDE Text-to-Speech Daemon Configuration"), iconKttsd);
- kttsd->reparent(pageKttsd,0,QPoint(0,0),true);
+ kttsd->reparent(pageKttsd,0,TQPoint(0,0),true);
}
}
@@ -202,19 +202,19 @@ bool OptionsDialog::isSpeakImmediately () {
KCModule *OptionsDialog::loadKttsd () {
KLibLoader *loader = KLibLoader::self();
- QString libname = "kcm_kttsd";
- KLibrary *lib = loader->library(QFile::encodeName(libname));
+ TQString libname = "kcm_kttsd";
+ KLibrary *lib = loader->library(TQFile::encodeName(libname));
if (lib == 0) {
libname = "libkcm_kttsd";
- lib = loader->library(QFile::encodeName("libkcm_kttsd"));
+ lib = loader->library(TQFile::encodeName("libkcm_kttsd"));
}
if (lib != 0) {
- QString initSym("init_");
+ TQString initSym("init_");
initSym += libname;
- if (lib->hasSymbol(QFile::encodeName(initSym))) {
+ if (lib->hasSymbol(TQFile::encodeName(initSym))) {
// Reuse "lib" instead of letting createInstanceFromLibrary recreate it
KLibFactory *factory = lib->factory();
if (factory != 0) {
@@ -231,8 +231,8 @@ KCModule *OptionsDialog::loadKttsd () {
void OptionsDialog::unloadKttsd () {
KLibLoader *loader = KLibLoader::self();
- loader->unloadLibrary(QFile::encodeName("libkcm_kttsd"));
- loader->unloadLibrary(QFile::encodeName("kcm_kttsd"));
+ loader->unloadLibrary(TQFile::encodeName("libkcm_kttsd"));
+ loader->unloadLibrary(TQFile::encodeName("kcm_kttsd"));
}
#include "optionsdialog.moc"
diff --git a/kmouth/optionsdialog.h b/kmouth/optionsdialog.h
index 8597e70..b9b796f 100644
--- a/kmouth/optionsdialog.h
+++ b/kmouth/optionsdialog.h
@@ -20,7 +20,7 @@
#ifndef OPTIONSDIALOG_H
#define OPTIONSDIALOG_H
-#include <qobject.h>
+#include <tqobject.h>
#include "preferencesui.h"
#include "texttospeechconfigurationwidget.h"
class QTabWidget;
@@ -34,7 +34,7 @@ class WordCompletionWidget;
class PreferencesWidget : public PreferencesUI {
Q_OBJECT
public:
- PreferencesWidget(QWidget *parent, const char *name);
+ PreferencesWidget(TQWidget *parent, const char *name);
~PreferencesWidget();
void readOptions (KConfig *config);
@@ -57,7 +57,7 @@ private:
class OptionsDialog : public KDialogBase {
Q_OBJECT
public:
- OptionsDialog(QWidget *parent);
+ OptionsDialog(TQWidget *parent);
~OptionsDialog();
void slotCancel();
@@ -75,7 +75,7 @@ signals:
void configurationChanged ();
private:
- QTabWidget *tabCtl;
+ TQTabWidget *tabCtl;
TextToSpeechConfigurationWidget *commandWidget;
PreferencesWidget *behaviourWidget;
KCModule *kttsd;
diff --git a/kmouth/phrasebook/phrasebook.cpp b/kmouth/phrasebook/phrasebook.cpp
index 0ec8da3..cc5d900 100644
--- a/kmouth/phrasebook/phrasebook.cpp
+++ b/kmouth/phrasebook/phrasebook.cpp
@@ -15,12 +15,12 @@
* *
***************************************************************************/
-#include <qprinter.h>
-#include <qpainter.h>
-#include <qfile.h>
-#include <qxml.h>
-#include <qregexp.h>
-#include <qptrstack.h>
+#include <tqprinter.h>
+#include <tqpainter.h>
+#include <tqfile.h>
+#include <tqxml.h>
+#include <tqregexp.h>
+#include <tqptrstack.h>
#include <klocale.h>
#include <kaction.h>
@@ -40,29 +40,29 @@ Phrase::Phrase() {
this->shortcut = "";
}
-Phrase::Phrase (const QString &phrase) {
+Phrase::Phrase (const TQString &phrase) {
this->phrase = phrase;
this->shortcut = "";
}
-Phrase::Phrase (const QString &phrase, const QString &shortcut) {
+Phrase::Phrase (const TQString &phrase, const TQString &shortcut) {
this->phrase = phrase;
this->shortcut = shortcut;
}
-QString Phrase::getPhrase() const {
+TQString Phrase::getPhrase() const {
return phrase;
}
-QString Phrase::getShortcut() const {
+TQString Phrase::getShortcut() const {
return shortcut;
}
-void Phrase::setPhrase (const QString &phrase) {
+void Phrase::setPhrase (const TQString &phrase) {
this->phrase = phrase;
}
-void Phrase::setShortcut (const QString &shortcut) {
+void Phrase::setShortcut (const TQString &shortcut) {
this->shortcut = shortcut;
}
@@ -95,19 +95,19 @@ int PhraseBookEntry::getLevel() const {
// ***************************************************************************
void PhraseBook::print(KPrinter *pPrinter) {
- QPainter printpainter;
+ TQPainter printpainter;
printpainter.begin(pPrinter);
- QRect size = printpainter.viewport ();
+ TQRect size = printpainter.viewport ();
int x = size.x();
int y = size.y();
int w = size.width();
- printpainter.setFont (QFont (KGlobalSettings::generalFont().family(), 12));
- QFontMetrics metrics = printpainter.fontMetrics();
+ printpainter.setFont (TQFont (KGlobalSettings::generalFont().family(), 12));
+ TQFontMetrics metrics = printpainter.fontMetrics();
PhraseBookEntryList::iterator it;
for (it = begin(); it != end(); ++it) {
- QRect rect = metrics.boundingRect (x+16*(*it).getLevel(), y,
+ TQRect rect = metrics.boundingRect (x+16*(*it).getLevel(), y,
w-16*(*it).getLevel(), 0,
Qt::AlignJustify | Qt::WordBreak,
(*it).getPhrase().getPhrase());
@@ -126,15 +126,15 @@ void PhraseBook::print(KPrinter *pPrinter) {
printpainter.end();
}
-bool PhraseBook::decode (const QString &xml) {
- QXmlInputSource source;
+bool PhraseBook::decode (const TQString &xml) {
+ TQXmlInputSource source;
source.setData (xml);
return decode (source);
}
-bool PhraseBook::decode (QXmlInputSource &source) {
+bool PhraseBook::decode (TQXmlInputSource &source) {
PhraseBookParser parser;
- QXmlSimpleReader reader;
+ TQXmlSimpleReader reader;
reader.setFeature ("http://trolltech.com/xml/features/report-start-end-entity", true);
reader.setContentHandler (&parser);
@@ -147,12 +147,12 @@ bool PhraseBook::decode (QXmlInputSource &source) {
return false;
}
-QCString encodeString (const QString str) {
- QCString res = "";
+TQCString encodeString (const TQString str) {
+ TQCString res = "";
for (int i = 0; i < (int)str.length(); i++) {
- QChar ch = str.at(i);
+ TQChar ch = str.at(i);
ushort uc = ch.unicode();
- QCString number; number.setNum(uc);
+ TQCString number; number.setNum(uc);
if ((uc>127) || (uc<32) || (ch=='<') || (ch=='>') || (ch=='&') || (ch==';'))
res = res + "&#" + number + ";";
else
@@ -161,8 +161,8 @@ QCString encodeString (const QString str) {
return res;
}
-QString PhraseBook::encode () {
- QString result;
+TQString PhraseBook::encode () {
+ TQString result;
result = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
result += "<!DOCTYPE phrasebook>\n";
result += "<phrasebook>\n";
@@ -199,8 +199,8 @@ QString PhraseBook::encode () {
return result;
}
-QStringList PhraseBook::toStringList () {
- QStringList result;
+TQStringList PhraseBook::toStringList () {
+ TQStringList result;
PhraseBook::iterator it;
for (it = begin(); it != end(); ++it) {
@@ -211,12 +211,12 @@ QStringList PhraseBook::toStringList () {
}
bool PhraseBook::save (const KURL &url) {
- QRegExp pattern("*.phrasebook",true,true);
+ TQRegExp pattern("*.phrasebook",true,true);
return save (url, pattern.exactMatch(url.filename()));
}
-void PhraseBook::save (QTextStream &stream, bool asPhrasebook) {
+void PhraseBook::save (TQTextStream &stream, bool asPhrasebook) {
if (asPhrasebook)
stream << encode();
else
@@ -225,11 +225,11 @@ void PhraseBook::save (QTextStream &stream, bool asPhrasebook) {
bool PhraseBook::save (const KURL &url, bool asPhrasebook) {
if (url.isLocalFile()) {
- QFile file(url.path());
+ TQFile file(url.path());
if(!file.open(IO_WriteOnly))
return false;
- QTextStream stream(&file);
+ TQTextStream stream(&file);
save (stream, asPhrasebook);
file.close();
@@ -249,21 +249,21 @@ bool PhraseBook::save (const KURL &url, bool asPhrasebook) {
}
}
-int PhraseBook::save (QWidget *parent, const QString &title, KURL &url, bool phrasebookFirst) {
+int PhraseBook::save (TQWidget *parent, const TQString &title, KURL &url, bool phrasebookFirst) {
// KFileDialog::getSaveURL(...) is not useful here as we need
// to know the requested file type.
- QString filters;
+ TQString filters;
if (phrasebookFirst)
filters = i18n("*.phrasebook|Phrase Books (*.phrasebook)\n*.txt|Plain Text Files (*.txt)\n*|All Files");
else
filters = i18n("*.txt|Plain Text Files (*.txt)\n*.phrasebook|Phrase Books (*.phrasebook)\n*|All Files");
- KFileDialog fdlg(QString::null,filters, parent, "filedialog", true);
+ KFileDialog fdlg(TQString::null,filters, parent, "filedialog", true);
fdlg.setCaption(title);
fdlg.setOperationMode( KFileDialog::Saving );
- if (fdlg.exec() != QDialog::Accepted) {
+ if (fdlg.exec() != TQDialog::Accepted) {
return 0;
}
@@ -274,7 +274,7 @@ int PhraseBook::save (QWidget *parent, const QString &title, KURL &url, bool phr
}
if (KIO::NetAccess::exists(url)) {
- 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 0;
}
@@ -286,7 +286,7 @@ int PhraseBook::save (QWidget *parent, const QString &title, KURL &url, bool phr
url.setFileName (url.fileName(false) + ".phrasebook");
}
else if (url.fileName (false).right (11).contains (".phrasebook", false) == 0) {
- int filetype = KMessageBox::questionYesNoCancel (0,QString("<qt>%1</qt>").arg(i18n("Your chosen filename <i>%1</i> has a different extension than <i>.phrasebook</i>. "
+ int filetype = KMessageBox::questionYesNoCancel (0,TQString("<qt>%1</qt>").arg(i18n("Your chosen filename <i>%1</i> has a different extension than <i>.phrasebook</i>. "
"Do you wish to add <i>.phrasebook</i> to the filename?").arg(url.filename())),i18n("File Extension"),i18n("Add"),i18n("Do Not Add"));
if (filetype == KMessageBox::Cancel) {
return 0;
@@ -302,7 +302,7 @@ int PhraseBook::save (QWidget *parent, const QString &title, KURL &url, bool phr
result = save (url, false);
}
else {
- int filetype = KMessageBox::questionYesNoCancel (0,QString("<qt>%1</qt>").arg(i18n("Your chosen filename <i>%1</i> has the extension <i>.phrasebook</i>. "
+ int filetype = KMessageBox::questionYesNoCancel (0,TQString("<qt>%1</qt>").arg(i18n("Your chosen filename <i>%1</i> has the extension <i>.phrasebook</i>. "
"Do you wish to save in phrasebook format?").arg(url.filename())),i18n("File Extension"),i18n("As Phrasebook"),i18n("As Plain Text"));
if (filetype == KMessageBox::Cancel) {
return 0;
@@ -325,21 +325,21 @@ int PhraseBook::save (QWidget *parent, const QString &title, KURL &url, bool phr
}
bool PhraseBook::open (const KURL &url) {
- QString tempFile;
+ TQString tempFile;
KURL fileUrl = url;
- QString protocol = fileUrl.protocol();
+ TQString protocol = fileUrl.protocol();
if (protocol.isEmpty() || protocol.isNull()) {
fileUrl.setProtocol ("file");
fileUrl.setPath (url.url());
}
if (KIO::NetAccess::download (fileUrl, tempFile)) {
- QStringList list = QStringList();
+ TQStringList list = TQStringList();
// First: try to load it as a normal phrase book
- QFile file(tempFile);
- QXmlInputSource source (&file);
+ TQFile file(tempFile);
+ TQXmlInputSource source (&file);
bool error = !decode (source);
// Second: if the file does not contain a phrase book, load it as
@@ -347,12 +347,12 @@ bool PhraseBook::open (const KURL &url) {
if (error) {
// Load each line of the plain text file as a new phrase
- QFile file(tempFile);
+ TQFile file(tempFile);
if (file.open(IO_ReadOnly)) {
- QTextStream stream(&file);
+ TQTextStream stream(&file);
while (!stream.atEnd()) {
- QString s = stream.readLine();
+ TQString s = stream.readLine();
if (!(s.isNull() || s.isEmpty()))
*this += PhraseBookEntry(Phrase(s, ""), 0, true);
}
@@ -370,14 +370,14 @@ bool PhraseBook::open (const KURL &url) {
return false;
}
-void PhraseBook::addToGUI (QPopupMenu *popup, KToolBar *toolbar, KActionCollection *phrases,
- QObject *receiver, const char *slot) const {
+void PhraseBook::addToGUI (TQPopupMenu *popup, KToolBar *toolbar, KActionCollection *phrases,
+ TQObject *receiver, const char *slot) const {
if ((popup != 0) || (toolbar != 0)) {
- QPtrStack<QWidget> stack;
- QWidget *parent = popup;
+ TQPtrStack<TQWidget> stack;
+ TQWidget *parent = popup;
int level = 0;
- QValueListConstIterator<PhraseBookEntry> it;
+ TQValueListConstIterator<PhraseBookEntry> it;
for (it = begin(); it != end(); ++it) {
int newLevel = (*it).getLevel();
while (newLevel > level) {
@@ -422,10 +422,10 @@ void PhraseBook::addToGUI (QPopupMenu *popup, KToolBar *toolbar, KActionCollecti
}
}
-void PhraseBook::insert (const QString &name, const PhraseBook &book) {
+void PhraseBook::insert (const TQString &name, const PhraseBook &book) {
*this += PhraseBookEntry(Phrase(name), 0, false);
- QValueListConstIterator<PhraseBookEntry> it;
+ TQValueListConstIterator<PhraseBookEntry> it;
for (it = book.begin(); it != book.end(); ++it) {
*this += PhraseBookEntry ((*it).getPhrase(), (*it).getLevel()+1, (*it).isPhrase());
}
@@ -433,14 +433,14 @@ void PhraseBook::insert (const QString &name, const PhraseBook &book) {
// ***************************************************************************
-PhraseBookDrag::PhraseBookDrag (PhraseBook *book, QWidget *dragSource, const char *name)
- : QDragObject (dragSource, name)
+PhraseBookDrag::PhraseBookDrag (PhraseBook *book, TQWidget *dragSource, const char *name)
+ : TQDragObject (dragSource, name)
{
setBook (book);
}
-PhraseBookDrag::PhraseBookDrag (QWidget *dragSource, const char *name)
- : QDragObject (dragSource, name)
+PhraseBookDrag::PhraseBookDrag (TQWidget *dragSource, const char *name)
+ : TQDragObject (dragSource, name)
{
setBook (0);
}
@@ -451,9 +451,9 @@ PhraseBookDrag::~PhraseBookDrag () {
void PhraseBookDrag::setBook (PhraseBook *book) {
if (book == 0) {
isEmpty = true;
- xmlphrasebook.setText(QString::null);
- xml.setText(QString::null);
- plain.setText(QString::null);
+ xmlphrasebook.setText(TQString::null);
+ xml.setText(TQString::null);
+ plain.setText(TQString::null);
}
else {
isEmpty = false;
@@ -477,8 +477,8 @@ const char *PhraseBookDrag::format (int i) const {
return xmlphrasebook.format(i/3);
}
-QByteArray PhraseBookDrag::encodedData (const char* mime) const {
- QCString m(mime);
+TQByteArray PhraseBookDrag::encodedData (const char* mime) const {
+ TQCString m(mime);
m = m.lower();
if (m.contains("xml-phrasebook"))
return xmlphrasebook.encodedData(mime);
@@ -488,18 +488,18 @@ QByteArray PhraseBookDrag::encodedData (const char* mime) const {
return plain.encodedData(mime);
}
-bool PhraseBookDrag::canDecode (const QMimeSource* e) {
- return QTextDrag::canDecode(e);
+bool PhraseBookDrag::canDecode (const TQMimeSource* e) {
+ return TQTextDrag::canDecode(e);
}
-bool PhraseBookDrag::decode (const QMimeSource *e, PhraseBook *book) {
- QString string;
- QCString subtype1 = "x-xml-phrasebook";
- QCString subtype2 = "xml";
+bool PhraseBookDrag::decode (const TQMimeSource *e, PhraseBook *book) {
+ TQString string;
+ TQCString subtype1 = "x-xml-phrasebook";
+ TQCString subtype2 = "xml";
- if (!QTextDrag::decode(e, string, subtype1))
- if (!QTextDrag::decode(e, string, subtype2)) {
- if (QTextDrag::decode(e, string)) {
+ if (!TQTextDrag::decode(e, string, subtype1))
+ if (!TQTextDrag::decode(e, string, subtype2)) {
+ if (TQTextDrag::decode(e, string)) {
*book += PhraseBookEntry(Phrase(string, ""), 0, true);
return true;
}
diff --git a/kmouth/phrasebook/phrasebook.h b/kmouth/phrasebook/phrasebook.h
index 83cb3a9..b0133b1 100644
--- a/kmouth/phrasebook/phrasebook.h
+++ b/kmouth/phrasebook/phrasebook.h
@@ -18,9 +18,9 @@
#ifndef PHRASEBOOK_H
#define PHRASEBOOK_H
-#include <qobject.h>
-#include <qdragobject.h>
-#include <qxml.h>
+#include <tqobject.h>
+#include <tqdragobject.h>
+#include <tqxml.h>
#include <kaction.h>
#include <kprinter.h>
@@ -35,18 +35,18 @@ class Phrase {
friend class PhraseBookParser;
public:
Phrase();
- Phrase (const QString &phrase);
- Phrase (const QString &phrase, const QString &shortcut);
+ Phrase (const TQString &phrase);
+ Phrase (const TQString &phrase, const TQString &shortcut);
- QString getPhrase() const;
- QString getShortcut() const;
+ TQString getPhrase() const;
+ TQString getShortcut() const;
- void setPhrase (const QString &phrase);
- void setShortcut (const QString &shortcut);
+ void setPhrase (const TQString &phrase);
+ void setShortcut (const TQString &shortcut);
private:
- QString phrase;
- QString shortcut;
+ TQString phrase;
+ TQString shortcut;
};
/**
@@ -72,7 +72,7 @@ private:
int level;
};
-typedef QValueList<PhraseBookEntry> PhraseBookEntryList;
+typedef TQValueList<PhraseBookEntry> PhraseBookEntryList;
/**
* The class PhraseBook implements a phrase book. It mainly stores a
@@ -96,10 +96,10 @@ public:
bool open (const KURL &url);
/** decodes a phrase book. Returns true if successful. */
- bool decode (const QString &xml);
+ bool decode (const TQString &xml);
/** decodes a phrase book. Returns true if successful. */
- bool decode (QXmlInputSource &source);
+ bool decode (TQXmlInputSource &source);
/** Writes the phrases to a file. Returns true if successful. */
bool save (const KURL &url);
@@ -107,8 +107,8 @@ public:
/** Writes the phrases to a file. Returns true if successful. */
bool save (const KURL &url, bool asPhrasebook);
- /** Writes the phrases to a QTextStream. */
- void save (QTextStream &stream, bool asPhrasebook);
+ /** Writes the phrases to a TQTextStream. */
+ void save (TQTextStream &stream, bool asPhrasebook);
/** Prints the phrases. */
void print (KPrinter *pPrinter);
@@ -118,63 +118,63 @@ public:
* 0, if the user canceled the operation,
* -1, if there was an error when saving the file.
*/
- int save (QWidget *parent, const QString &title, KURL &url, bool phrasebookFirst = true);
+ int save (TQWidget *parent, const TQString &title, KURL &url, bool phrasebookFirst = true);
/** encodes the phrase book. Returns the encoded xml code. */
- QString encode ();
+ TQString encode ();
- /** Stores all entries in a QStringList. All hierarchy information and all
+ /** Stores all entries in a TQStringList. All hierarchy information and all
* shortcuts are ignored during this operation.
*/
- QStringList toStringList();
+ TQStringList toStringList();
/** Adds the entries of the book to both the given popup menu and the given
* toolbar. The corresponding actions will be inserted into phrases.
*/
- void addToGUI (QPopupMenu *popup, KToolBar *toolbar,
+ void addToGUI (TQPopupMenu *popup, KToolBar *toolbar,
KActionCollection *phrases,
- QObject *receiver, const char *slot) const;
+ TQObject *receiver, const char *slot) const;
/** Inserts book into a new sub phrase book.
* @param name the name of the new sub phrase book.
* @param book the phrase book to insert.
*/
- void insert (const QString &name, const PhraseBook &book);
+ void insert (const TQString &name, const PhraseBook &book);
};
/**
* The class PhraseBookDrag implements drag and drop support for phrase books.
* @author Gunnar Schmi Dt
*/
-class PhraseBookDrag: public QDragObject {
+class PhraseBookDrag: public TQDragObject {
Q_OBJECT
public:
- PhraseBookDrag (PhraseBook *book, QWidget *dragSource = 0, const char *name = 0);
- PhraseBookDrag (QWidget *dragSource = 0, const char *name = 0);
+ PhraseBookDrag (PhraseBook *book, TQWidget *dragSource = 0, const char *name = 0);
+ PhraseBookDrag (TQWidget *dragSource = 0, const char *name = 0);
~PhraseBookDrag ();
virtual void setBook (PhraseBook *book);
const char *format (int i) const;
- virtual QByteArray encodedData (const char *) const;
+ virtual TQByteArray encodedData (const char *) const;
- static bool canDecode (const QMimeSource *e);
- static bool decode (const QMimeSource *e, PhraseBook *book);
+ static bool canDecode (const TQMimeSource *e);
+ static bool decode (const TQMimeSource *e, PhraseBook *book);
private:
bool isEmpty;
- QTextDrag xmlphrasebook;
- QTextDrag xml;
- QTextDrag plain;
+ TQTextDrag xmlphrasebook;
+ TQTextDrag xml;
+ TQTextDrag plain;
};
class PhraseAction : public KAction {
Q_OBJECT
public:
- PhraseAction (const QString& phrase, const QString& cut, const QObject* receiver, const char* slot, KActionCollection* parent)
+ PhraseAction (const TQString& phrase, const TQString& cut, const TQObject* receiver, const char* slot, KActionCollection* parent)
: KAction (phrase, "phrase", KShortcut(cut), 0, 0, parent, phrase.latin1()) {
this->phrase = phrase;
- connect (this, SIGNAL(slotActivated (const QString &)), receiver, slot);
+ connect (this, TQT_SIGNAL(slotActivated (const TQString &)), receiver, slot);
};
~PhraseAction () {
}
@@ -186,10 +186,10 @@ public slots:
}
signals:
- void slotActivated (const QString &phrase);
+ void slotActivated (const TQString &phrase);
private:
- QString phrase;
+ TQString phrase;
};
#endif
diff --git a/kmouth/phrasebook/phrasebookdialog.cpp b/kmouth/phrasebook/phrasebookdialog.cpp
index cc79d2f..2abe3d0 100644
--- a/kmouth/phrasebook/phrasebookdialog.cpp
+++ b/kmouth/phrasebook/phrasebookdialog.cpp
@@ -16,18 +16,18 @@
***************************************************************************/
// include files for QT
-#include <qapplication.h>
-#include <qlayout.h>
-#include <qclipboard.h>
-#include <qradiobutton.h>
-#include <qevent.h>
-#include <qpainter.h>
-#include <qstyle.h>
-#include <qgroupbox.h>
-#include <qpopupmenu.h>
-#include <qvaluestack.h>
-#include <qptrstack.h>
-#include <qwhatsthis.h>
+#include <tqapplication.h>
+#include <tqlayout.h>
+#include <tqclipboard.h>
+#include <tqradiobutton.h>
+#include <tqevent.h>
+#include <tqpainter.h>
+#include <tqstyle.h>
+#include <tqgroupbox.h>
+#include <tqpopupmenu.h>
+#include <tqvaluestack.h>
+#include <tqptrstack.h>
+#include <tqwhatsthis.h>
// include files for KDE
#include <kpopupmenu.h>
@@ -53,9 +53,9 @@ namespace PhraseBookPrivate {
};
}
-CheckBookItem::CheckBookItem (QListViewItem *parent, QListViewItem *last,
- const QString &text, const QString &name, const QString &filename)
- : QCheckListItem (parent, text, QCheckListItem::CheckBox)
+CheckBookItem::CheckBookItem (TQListViewItem *parent, TQListViewItem *last,
+ const TQString &text, const TQString &name, const TQString &filename)
+ : TQCheckListItem (parent, text, TQCheckListItem::CheckBox)
{
moveItem (last);
setText(PhraseBookPrivate::name, name);
@@ -70,9 +70,9 @@ CheckBookItem::CheckBookItem (QListViewItem *parent, QListViewItem *last,
((CheckBookItem*)parent)->childChange (numberOfBooks, selectedBooks);
}
-CheckBookItem::CheckBookItem (QListView *parent, QListViewItem *last,
- const QString &text, const QString &name, const QString &filename)
- : QCheckListItem (parent, text, QCheckListItem::CheckBox)
+CheckBookItem::CheckBookItem (TQListView *parent, TQListViewItem *last,
+ const TQString &text, const TQString &name, const TQString &filename)
+ : TQCheckListItem (parent, text, TQCheckListItem::CheckBox)
{
moveItem (last);
setText(PhraseBookPrivate::name, name);
@@ -90,7 +90,7 @@ CheckBookItem::~CheckBookItem () {
}
void CheckBookItem::activate() {
- QListView *lv = listView();
+ TQListView *lv = listView();
if ((lv != 0) && (!lv->isEnabled()) || (!isEnabled()))
return;
@@ -100,9 +100,9 @@ void CheckBookItem::activate() {
}
void CheckBookItem::stateChange (bool on) {
- QListViewItem *item = firstChild();
+ TQListViewItem *item = firstChild();
if (item == 0) {
- QListViewItem *parent = this->parent();
+ TQListViewItem *parent = this->parent();
if (parent != 0) {
if (on)
((CheckBookItem*)parent)->childChange (0, 1);
@@ -114,10 +114,10 @@ void CheckBookItem::stateChange (bool on) {
}
void CheckBookItem::propagateStateChange () {
- QListViewItem *item = firstChild();
+ TQListViewItem *item = firstChild();
while (item != 0) {
- if (isOn() != ((QCheckListItem*)item)->isOn())
- ((QCheckListItem*)item)->setOn (isOn());
+ if (isOn() != ((TQCheckListItem*)item)->isOn())
+ ((TQCheckListItem*)item)->setOn (isOn());
else
((CheckBookItem*)item)->propagateStateChange ();
item = item->nextSibling();
@@ -127,22 +127,22 @@ void CheckBookItem::propagateStateChange () {
void CheckBookItem::childChange (int numberDiff, int selDiff) {
numberOfBooks += numberDiff;
selectedBooks += selDiff;
- QListViewItem *parent = this->parent();
+ TQListViewItem *parent = this->parent();
if (parent != 0)
((CheckBookItem*)parent)->childChange (numberDiff, selDiff);
- QString text = i18n(" (%1 of %2 books selected)");
+ TQString text = i18n(" (%1 of %2 books selected)");
text = text.arg(selectedBooks).arg(numberOfBooks);
setText(0, this->text(PhraseBookPrivate::name)+text);
}
/***************************************************************************/
-InitialPhraseBookWidget::InitialPhraseBookWidget (QWidget *parent, const char *name)
- : QWidget(parent, name)
+InitialPhraseBookWidget::InitialPhraseBookWidget (TQWidget *parent, const char *name)
+ : TQWidget(parent, name)
{
- QVBoxLayout *mainLayout = new QVBoxLayout (this, 0, KDialog::spacingHint());
- QLabel *label = new QLabel (i18n("Please decide which phrase books you need:"), this, "booksTitle");
+ TQVBoxLayout *mainLayout = new TQVBoxLayout (this, 0, KDialog::spacingHint());
+ TQLabel *label = new TQLabel (i18n("Please decide which phrase books you need:"), this, "booksTitle");
mainLayout->add (label);
books = new KListView (this, "books");
@@ -153,7 +153,7 @@ InitialPhraseBookWidget::InitialPhraseBookWidget (QWidget *parent, const char *n
books->addColumn (i18n("Book"));
books->setRootIsDecorated (true);
books->setAllColumnsShowFocus (true);
- books->setSelectionMode (QListView::Multi);
+ books->setSelectionMode (TQListView::Multi);
mainLayout->add (books);
initStandardPhraseBooks();
@@ -165,17 +165,17 @@ InitialPhraseBookWidget::~InitialPhraseBookWidget () {
void InitialPhraseBookWidget::initStandardPhraseBooks() {
StandardBookList bookPaths = PhraseBookDialog::standardPhraseBooks();
- QListViewItem *parent = 0;
- QListViewItem *last = 0;
- QStringList currentNamePath = "";
- QPtrStack<QListViewItem> stack;
+ TQListViewItem *parent = 0;
+ TQListViewItem *last = 0;
+ TQStringList currentNamePath = "";
+ TQPtrStack<TQListViewItem> stack;
StandardBookList::iterator it;
for (it = bookPaths.begin(); it != bookPaths.end(); ++it) {
- QString namePath = (*it).path;
- QStringList dirs = QStringList::split("/", namePath);
+ TQString namePath = (*it).path;
+ TQStringList dirs = TQStringList::split("/", namePath);
- QStringList::iterator it1=currentNamePath.begin();
- QStringList::iterator it2=dirs.begin();
+ TQStringList::iterator it1=currentNamePath.begin();
+ TQStringList::iterator it2=dirs.begin();
for (; (it1 != currentNamePath.end())
&& (it1 != dirs.end()) && (*it1 == *it2); ++it1, ++it2);
for (; it1 != currentNamePath.end(); ++it1) {
@@ -184,17 +184,17 @@ void InitialPhraseBookWidget::initStandardPhraseBooks() {
}
for (; it2 != dirs.end(); ++it2) {
stack.push (parent);
- QListViewItem *newParent;
+ TQListViewItem *newParent;
if (parent == 0)
- newParent = new CheckBookItem (books, last, *it2, *it2, QString::null);
+ newParent = new CheckBookItem (books, last, *it2, *it2, TQString::null);
else
- newParent = new CheckBookItem (parent, last, *it2, *it2, QString::null);
+ newParent = new CheckBookItem (parent, last, *it2, *it2, TQString::null);
parent = newParent;
last = 0;
}
currentNamePath = dirs;
- QListViewItem *book;
+ TQListViewItem *book;
if (parent == 0)
book = new CheckBookItem (books, last, (*it).name, (*it).name, (*it).filename);
else
@@ -205,13 +205,13 @@ void InitialPhraseBookWidget::initStandardPhraseBooks() {
void InitialPhraseBookWidget::createBook () {
PhraseBook book;
- QListViewItem *item = books->firstChild();
+ TQListViewItem *item = books->firstChild();
while (item != 0) {
if (item->firstChild() != 0) {
item = item->firstChild();
}
else {
- if (((QCheckListItem*)item)->isOn()) {
+ if (((TQCheckListItem*)item)->isOn()) {
PhraseBook localBook;
localBook.open(KURL( item->text(PhraseBookPrivate::filename )));
book += localBook;
@@ -225,7 +225,7 @@ void InitialPhraseBookWidget::createBook () {
}
}
- QString bookLocation = KApplication::kApplication()->dirs()->saveLocation ("appdata", "/");
+ TQString bookLocation = KApplication::kApplication()->dirs()->saveLocation ("appdata", "/");
if (!bookLocation.isNull() && !bookLocation.isEmpty()) {
book.save (KURL( bookLocation + "standard.phrasebook" ));
}
@@ -233,15 +233,15 @@ void InitialPhraseBookWidget::createBook () {
/***************************************************************************/
-ButtonBoxWidget::ButtonBoxWidget (QWidget *parent, const char *name)
+ButtonBoxWidget::ButtonBoxWidget (TQWidget *parent, const char *name)
: ButtonBoxUI (parent, name) {
- keyButtonPlaceLayout = new QGridLayout (keyButtonPlace, 1, 1, 0, 0, "keyButtonPlaceLayout");
+ keyButtonPlaceLayout = new TQGridLayout (keyButtonPlace, 1, 1, 0, 0, "keyButtonPlaceLayout");
keyButton = new KKeyButton (keyButtonPlace, "key");
keyButtonPlaceLayout->addWidget (keyButton, 1,1);
- QWhatsThis::add (keyButton, i18n("By clicking on this button you can select the keyboard shortcut associated with the selected phrase."));
+ TQWhatsThis::add (keyButton, i18n("By clicking on this button you can select the keyboard shortcut associated with the selected phrase."));
- group = new QButtonGroup (phrasebox);
+ group = new TQButtonGroup (phrasebox);
group->hide();
group->setExclusive (true);
group->insert (noKey);
@@ -264,7 +264,7 @@ PhraseBookDialog::PhraseBookDialog ()
initGUI();
initActions();
initStandardPhraseBooks();
- QString standardBook = KApplication::kApplication()->dirs()->findResource("appdata", "standard.phrasebook");
+ TQString standardBook = KApplication::kApplication()->dirs()->findResource("appdata", "standard.phrasebook");
if (!standardBook.isNull() && !standardBook.isEmpty()) {
PhraseBook book;
book.open(KURL( standardBook ));
@@ -288,9 +288,9 @@ PhraseBookDialog::~PhraseBookDialog() {
}
void PhraseBookDialog::initGUI () {
- QWidget *page = new QWidget( this );
+ TQWidget *page = new TQWidget( this );
setCentralWidget(page);
- QVBoxLayout *mainLayout = new QVBoxLayout (page, 0);
+ TQVBoxLayout *mainLayout = new TQVBoxLayout (page, 0);
treeView = new PhraseTree (page, "phrasetree");
treeView->setSorting (-1);
@@ -301,19 +301,19 @@ void PhraseBookDialog::initGUI () {
treeView->addColumn (i18n("Shortcut"));
treeView->setRootIsDecorated (true);
treeView->setAllColumnsShowFocus (true);
- treeView->setSelectionMode (QListView::Extended);
- QWhatsThis::add (treeView, i18n("This list contains the current phrase book in a tree structure. You can select and modify individual phrases and sub phrase books"));
- connect (treeView, SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));
- connect (treeView, SIGNAL(contextMenuRequested (QListViewItem *, const QPoint &, int)), this, SLOT(contextMenuRequested (QListViewItem *, const QPoint &, int)));
- connect (treeView, SIGNAL(dropped (QDropEvent *, QListViewItem *, QListViewItem *)), this, SLOT(slotDropped (QDropEvent *, QListViewItem *, QListViewItem *)));
- connect (treeView, SIGNAL(moved (QListViewItem *, QListViewItem *, QListViewItem *)), this, SLOT(slotMoved (QListViewItem *, QListViewItem *, QListViewItem *)));
+ treeView->setSelectionMode (TQListView::Extended);
+ TQWhatsThis::add (treeView, i18n("This list contains the current phrase book in a tree structure. You can select and modify individual phrases and sub phrase books"));
+ connect (treeView, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(selectionChanged()));
+ connect (treeView, TQT_SIGNAL(contextMenuRequested (TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT(contextMenuRequested (TQListViewItem *, const TQPoint &, int)));
+ connect (treeView, TQT_SIGNAL(dropped (TQDropEvent *, TQListViewItem *, TQListViewItem *)), this, TQT_SLOT(slotDropped (TQDropEvent *, TQListViewItem *, TQListViewItem *)));
+ connect (treeView, TQT_SIGNAL(moved (TQListViewItem *, TQListViewItem *, TQListViewItem *)), this, TQT_SLOT(slotMoved (TQListViewItem *, TQListViewItem *, TQListViewItem *)));
mainLayout->addWidget (treeView);
buttonBox = new ButtonBoxWidget (page, "buttonbox");
- connect (buttonBox->lineEdit, SIGNAL(textChanged(const QString &)), SLOT(slotTextChanged(const QString &)));
- connect (buttonBox->noKey, SIGNAL(clicked()), SLOT(slotNoKey()));
- connect (buttonBox->customKey, SIGNAL(clicked()), SLOT(slotCustomKey()));
- connect (buttonBox->keyButton, SIGNAL(capturedShortcut(const KShortcut&)), SLOT(capturedShortcut(const KShortcut&)));
+ connect (buttonBox->lineEdit, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(slotTextChanged(const TQString &)));
+ connect (buttonBox->noKey, TQT_SIGNAL(clicked()), TQT_SLOT(slotNoKey()));
+ connect (buttonBox->customKey, TQT_SIGNAL(clicked()), TQT_SLOT(slotCustomKey()));
+ connect (buttonBox->keyButton, TQT_SIGNAL(capturedShortcut(const KShortcut&)), TQT_SLOT(capturedShortcut(const KShortcut&)));
mainLayout->addWidget (buttonBox);
treeView->setFocus();
@@ -322,23 +322,23 @@ void PhraseBookDialog::initGUI () {
void PhraseBookDialog::initActions() {
// The file menu
- fileNewPhrase = new KAction (i18n("&New Phrase"), "phrase_new", 0, this, SLOT(slotAddPhrase()), actionCollection(),"file_new_phrase");
+ fileNewPhrase = new KAction (i18n("&New Phrase"), "phrase_new", 0, this, TQT_SLOT(slotAddPhrase()), actionCollection(),"file_new_phrase");
fileNewPhrase->setStatusText(i18n("Adds a new phrase"));
fileNewPhrase->setWhatsThis (i18n("Adds a new phrase"));
- fileNewBook = new KAction (i18n("New Phrase &Book"), "phrasebook_new", 0, this, SLOT(slotAddPhrasebook()), actionCollection(),"file_new_book");
+ fileNewBook = new KAction (i18n("New Phrase &Book"), "phrasebook_new", 0, this, TQT_SLOT(slotAddPhrasebook()), actionCollection(),"file_new_book");
fileNewBook->setStatusText(i18n("Adds a new phrase book into which other books and phrases can be placed"));
fileNewBook->setWhatsThis (i18n("Adds a new phrase book into which other books and phrases can be placed"));
- fileSave = KStdAction::save(this, SLOT(slotSave()), actionCollection());
+ fileSave = KStdAction::save(this, TQT_SLOT(slotSave()), actionCollection());
fileSave->setStatusText(i18n("Saves the phrase book onto the hard disk"));
fileSave->setWhatsThis (i18n("Saves the phrase book onto the hard disk"));
- fileImport = new KAction (i18n("&Import..."), "phrasebook_open", 0, this, SLOT(slotImportPhrasebook()), actionCollection(),"file_import");
+ fileImport = new KAction (i18n("&Import..."), "phrasebook_open", 0, this, TQT_SLOT(slotImportPhrasebook()), actionCollection(),"file_import");
fileImport->setStatusText(i18n("Imports a file and adds its contents to the phrase book"));
fileImport->setWhatsThis (i18n("Imports a file and adds its contents to the phrase book"));
- toolbarImport = new KToolBarPopupAction (i18n("&Import..."), "phrasebook_open", 0, this, SLOT(slotImportPhrasebook()), actionCollection(),"toolbar_import");
+ toolbarImport = new KToolBarPopupAction (i18n("&Import..."), "phrasebook_open", 0, this, TQT_SLOT(slotImportPhrasebook()), actionCollection(),"toolbar_import");
toolbarImport->setStatusText(i18n("Imports a file and adds its contents to the phrase book"));
toolbarImport->setWhatsThis (i18n("Imports a file and adds its contents to the phrase book"));
@@ -346,32 +346,32 @@ void PhraseBookDialog::initActions() {
fileImportStandardBook->setStatusText(i18n("Imports a standard phrase book and adds its contents to the phrase book"));
fileImportStandardBook->setWhatsThis (i18n("Imports a standard phrase book and adds its contents to the phrase book"));
- fileExport = new KAction (i18n("&Export..."), "phrasebook_save", 0, this, SLOT(slotExportPhrasebook()), actionCollection(),"file_export");
+ fileExport = new KAction (i18n("&Export..."), "phrasebook_save", 0, this, TQT_SLOT(slotExportPhrasebook()), actionCollection(),"file_export");
fileExport->setStatusText(i18n("Exports the currently selected phrase(s) or phrase book(s) into a file"));
fileExport->setWhatsThis (i18n("Exports the currently selected phrase(s) or phrase book(s) into a file"));
- filePrint = KStdAction::print(this, SLOT(slotPrint()), actionCollection());
+ filePrint = KStdAction::print(this, TQT_SLOT(slotPrint()), actionCollection());
filePrint->setStatusText(i18n("Prints the currently selected phrase(s) or phrase book(s)"));
filePrint->setWhatsThis (i18n("Prints the currently selected phrase(s) or phrase book(s)"));
- fileClose = KStdAction::close(this, SLOT(close()), actionCollection());
+ fileClose = KStdAction::close(this, TQT_SLOT(close()), actionCollection());
fileClose->setStatusText(i18n("Closes the window"));
fileClose->setWhatsThis (i18n("Closes the window"));
// The edit menu
- editCut = KStdAction::cut(this, SLOT(slotCut()), actionCollection());
+ editCut = KStdAction::cut(this, TQT_SLOT(slotCut()), actionCollection());
editCut->setStatusText(i18n("Cuts the currently selected entries from the phrase book and puts it to the clipboard"));
editCut->setWhatsThis (i18n("Cuts the currently selected entries from the phrase book and puts it to the clipboard"));
- editCopy = KStdAction::copy(this, SLOT(slotCopy()), actionCollection());
+ editCopy = KStdAction::copy(this, TQT_SLOT(slotCopy()), actionCollection());
editCopy->setStatusText(i18n("Copies the currently selected entry from the phrase book to the clipboard"));
editCopy->setWhatsThis (i18n("Copies the currently selected entry from the phrase book to the clipboard"));
- editPaste = KStdAction::paste(this, SLOT(slotPaste()), actionCollection());
+ editPaste = KStdAction::paste(this, TQT_SLOT(slotPaste()), actionCollection());
editPaste->setStatusText(i18n("Pastes the clipboard contents to actual position"));
editPaste->setWhatsThis (i18n("Pastes the clipboard contents to actual position"));
- editDelete = new KAction (i18n("&Delete"), "editdelete", 0, this, SLOT(slotRemove()), actionCollection(),"edit_delete");
+ editDelete = new KAction (i18n("&Delete"), "editdelete", 0, this, TQT_SLOT(slotRemove()), actionCollection(),"edit_delete");
editDelete->setStatusText(i18n("Deletes the selected entries from the phrase book"));
editDelete->setWhatsThis (i18n("Deletes the selected entries from the phrase book"));
@@ -379,17 +379,17 @@ void PhraseBookDialog::initActions() {
createGUI("phrasebookdialogui.rc");
}
-QString PhraseBookDialog::displayPath (QString filename) {
- QFileInfo file(filename);
- QString path = file.dirPath();
- QString dispPath = "";
- uint position = path.find("/kmouth/books/")+QString("/kmouth/books/").length();
+TQString PhraseBookDialog::displayPath (TQString filename) {
+ TQFileInfo file(filename);
+ TQString path = file.dirPath();
+ TQString dispPath = "";
+ uint position = path.find("/kmouth/books/")+TQString("/kmouth/books/").length();
while (path.length() > position) {
file.setFile(path);
KDesktopFile *dirDesc = new KDesktopFile(path+"/.directory", true, "data");
- QString name = dirDesc->readName();
+ TQString name = dirDesc->readName();
delete dirDesc;
if (name.isNull() || name.isEmpty())
@@ -403,11 +403,11 @@ QString PhraseBookDialog::displayPath (QString filename) {
}
StandardBookList PhraseBookDialog::standardPhraseBooks() {
- QStringList bookPaths = KGlobal::instance()->dirs()->findAllResources (
+ TQStringList bookPaths = KGlobal::instance()->dirs()->findAllResources (
"data", "kmouth/books/*.phrasebook", true, true);
- QStringList bookNames;
- QMap<QString,StandardBook> bookMap;
- QStringList::iterator it;
+ TQStringList bookNames;
+ TQMap<TQString,StandardBook> bookMap;
+ TQStringList::iterator it;
for (it = bookPaths.begin(); it != bookPaths.end(); ++it) {
PhraseBook pbook;
if (pbook.open (KURL( *it ))) {
@@ -435,18 +435,18 @@ void PhraseBookDialog::initStandardPhraseBooks () {
StandardBookList bookPaths = standardPhraseBooks();
KActionMenu *parent = fileImportStandardBook;
- QStringList currentNamePath = "x";
- QPtrStack<KActionMenu> stack;
+ TQStringList currentNamePath = "x";
+ TQPtrStack<KActionMenu> stack;
StandardBookList::iterator it;
for (it = bookPaths.begin(); it != bookPaths.end(); ++it) {
KURL url;
url.setPath((*it).filename);
- QString namePath = "x/"+(*it).path;
- QStringList dirs = QStringList::split("/", namePath);
+ TQString namePath = "x/"+(*it).path;
+ TQStringList dirs = TQStringList::split("/", namePath);
- QStringList::iterator it1=currentNamePath.begin();
- QStringList::iterator it2=dirs.begin();
+ TQStringList::iterator it1=currentNamePath.begin();
+ TQStringList::iterator it2=dirs.begin();
for (; (it1 != currentNamePath.end())
&& (it1 != dirs.end()) && (*it1 == *it2); ++it1, ++it2);
for (; it1 != currentNamePath.end(); ++it1)
@@ -462,21 +462,21 @@ void PhraseBookDialog::initStandardPhraseBooks () {
currentNamePath = dirs;
KAction *book = new StandardPhraseBookInsertAction (
- url, (*it).name, this, SLOT(slotImportPhrasebook (const KURL &)), actionCollection());
+ url, (*it).name, this, TQT_SLOT(slotImportPhrasebook (const KURL &)), actionCollection());
parent->insert(book);
if (parent == fileImportStandardBook)
book->plug(toolbarImport->popupMenu());
}
}
-PhraseTreeItem *selectedItem (QListView *treeView) {
+PhraseTreeItem *selectedItem (TQListView *treeView) {
PhraseTreeItem *currentItem = (PhraseTreeItem *)treeView->currentItem();
if ((currentItem == 0) || (!currentItem->isSelected()))
return 0;
- QListViewItemIterator it(treeView);
+ TQListViewItemIterator it(treeView);
while (it.current()) {
- QListViewItem *item = it.current();
+ TQListViewItem *item = it.current();
if (item->isSelected() && (item != currentItem))
return 0;
++it;
@@ -508,7 +508,7 @@ void PhraseBookDialog::selectionChanged () {
buttonBox->lineEdit->setText(currentItem->text(0));
buttonBox->lineEdit->setEnabled(true);
buttonBox->shortcutLabel->setEnabled(true);
- QString shortcut = currentItem->text(1);
+ TQString shortcut = currentItem->text(1);
buttonBox->keyButton->setShortcut(currentItem->cut(), false);
if (shortcut.isEmpty() || shortcut.isNull()) {
buttonBox->noKey->setChecked (true);
@@ -554,7 +554,7 @@ bool PhraseBookDialog::queryClose() {
return true;
}
-void PhraseBookDialog::slotTextChanged (const QString &s) {
+void PhraseBookDialog::slotTextChanged (const TQString &s) {
PhraseTreeItem *currentItem = selectedItem (treeView);
if (currentItem != 0)
currentItem->setText(0, s);
@@ -567,7 +567,7 @@ void PhraseBookDialog::slotNoKey() {
PhraseTreeItem *currentItem = selectedItem (treeView);
if (currentItem != 0) {
- currentItem->setCut (KShortcut(QString::null));
+ currentItem->setCut (KShortcut(TQString::null));
buttonBox->keyButton->setShortcut(currentItem->cut(), false);
}
phrasebookChanged = true;
@@ -593,11 +593,11 @@ void PhraseBookDialog::setShortcut( const KShortcut& cut ) {
const KKey& key = seq.key(0);
if (key.modFlags() == 0 && key.sym() < 0x3000
- && QChar(key.sym()).isLetterOrNumber())
+ && TQChar(key.sym()).isLetterOrNumber())
{
- QString s = i18n("In order to use the '%1' key as a shortcut, "
+ TQString s = i18n("In order to use the '%1' key as a shortcut, "
"it must be combined with the "
- "Win, Alt, Ctrl, and/or Shift keys.").arg(QChar(key.sym()));
+ "Win, Alt, Ctrl, and/or Shift keys.").arg(TQChar(key.sym()));
KMessageBox::sorry( this, s, i18n("Invalid Shortcut Key") );
return;
}
@@ -615,8 +615,8 @@ void PhraseBookDialog::setShortcut( const KShortcut& cut ) {
}
}
-QListViewItem *PhraseBookDialog::addBook (QListViewItem *parent, QListViewItem *after, PhraseBook *book) {
- QListViewItem *newItem = treeView->addBook(parent, after, book);
+TQListViewItem *PhraseBookDialog::addBook (TQListViewItem *parent, TQListViewItem *after, PhraseBook *book) {
+ TQListViewItem *newItem = treeView->addBook(parent, after, book);
if (newItem != 0) {
treeView->clearSelection();
treeView->ensureItemVisible(newItem);
@@ -627,7 +627,7 @@ QListViewItem *PhraseBookDialog::addBook (QListViewItem *parent, QListViewItem *
return newItem;
}
-QListViewItem *PhraseBookDialog::addBook (QListViewItem *item, PhraseBook *book) {
+TQListViewItem *PhraseBookDialog::addBook (TQListViewItem *item, PhraseBook *book) {
if (item == 0)
return addBook(0, 0, book);
else if (((PhraseTreeItem *)item)->isPhrase() || !item->isOpen())
@@ -639,14 +639,14 @@ QListViewItem *PhraseBookDialog::addBook (QListViewItem *item, PhraseBook *book)
return addBook(item, 0, book);
}
-void PhraseBookDialog::contextMenuRequested(QListViewItem *, const QPoint &pos, int) {
- QString name;
+void PhraseBookDialog::contextMenuRequested(TQListViewItem *, const TQPoint &pos, int) {
+ TQString name;
if (treeView->hasSelectedItems())
name = "phrasebook_popup_sel";
else
name = "phrasebook_popup_nosel";
- QPopupMenu *popup = (QPopupMenu *)factory()->container(name,this);
+ TQPopupMenu *popup = (TQPopupMenu *)factory()->container(name,this);
if (popup != 0) {
popup->popup(pos, 0);
}
@@ -667,24 +667,24 @@ void PhraseBookDialog::slotCut () {
void PhraseBookDialog::slotCopy () {
PhraseBook book;
treeView->fillBook (&book, true);
- QApplication::clipboard()->setData(new PhraseBookDrag(&book));
+ TQApplication::clipboard()->setData(new PhraseBookDrag(&book));
}
void PhraseBookDialog::slotPaste () {
PhraseBook book;
- if (PhraseBookDrag::decode(QApplication::clipboard()->data(), &book)) {
+ if (PhraseBookDrag::decode(TQApplication::clipboard()->data(), &book)) {
addBook (treeView->currentItem(), &book);
}
}
-void PhraseBookDialog::slotDropped (QDropEvent *e, QListViewItem *parent, QListViewItem *after) {
+void PhraseBookDialog::slotDropped (TQDropEvent *e, TQListViewItem *parent, TQListViewItem *after) {
PhraseBook book;
if (PhraseBookDrag::decode(e, &book)) {
addBook(parent, after, &book);
}
}
-void PhraseBookDialog::slotMoved (QListViewItem *item, QListViewItem *, QListViewItem *) {
+void PhraseBookDialog::slotMoved (TQListViewItem *item, TQListViewItem *, TQListViewItem *) {
treeView->ensureItemVisible(item);
treeView->setSelected (item, true);
phrasebookChanged = true;
@@ -695,7 +695,7 @@ void PhraseBookDialog::slotAddPhrasebook () {
Phrase phrase(i18n("(New Phrase Book)"), "");
book += PhraseBookEntry(phrase, 0, false);
- QListViewItem *item = addBook (treeView->currentItem(), &book);
+ TQListViewItem *item = addBook (treeView->currentItem(), &book);
item->setOpen (true);
buttonBox->lineEdit->selectAll();
buttonBox->lineEdit->setFocus();
@@ -719,7 +719,7 @@ void PhraseBookDialog::slotSave () {
}
void PhraseBookDialog::slotImportPhrasebook () {
- KURL url=KFileDialog::getOpenURL(QString::null,
+ KURL url=KFileDialog::getOpenURL(TQString::null,
i18n("*.phrasebook|Phrase Books (*.phrasebook)\n*.txt|Plain Text Files (*.txt)\n*|All Files"), this, i18n("Import Phrasebook"));
slotImportPhrasebook (url);
diff --git a/kmouth/phrasebook/phrasebookdialog.h b/kmouth/phrasebook/phrasebookdialog.h
index 774387f..d086299 100644
--- a/kmouth/phrasebook/phrasebookdialog.h
+++ b/kmouth/phrasebook/phrasebookdialog.h
@@ -18,11 +18,11 @@
#ifndef PHRASEBOOKDIALOG_H
#define PHRASEBOOKDIALOG_H
-#include <qbutton.h>
-#include <qradiobutton.h>
-#include <qbuttongroup.h>
-#include <qlabel.h>
-#include <qlistview.h>
+#include <tqbutton.h>
+#include <tqradiobutton.h>
+#include <tqbuttongroup.h>
+#include <tqlabel.h>
+#include <tqlistview.h>
#include <kmainwindow.h>
#include <klineedit.h>
#include <kkeybutton.h>
@@ -38,22 +38,22 @@ class QString;
class KListView;
struct StandardBook {
- QString name;
- QString path;
- QString filename;
+ TQString name;
+ TQString path;
+ TQString filename;
};
-typedef QValueList<StandardBook> StandardBookList;
+typedef TQValueList<StandardBook> StandardBookList;
/**The class PhraseTreeItem is an ListViewItem for either a phrase or a phrase book.
*@author Gunnar Schmi Dt
*/
-class CheckBookItem : public QCheckListItem {
+class CheckBookItem : public TQCheckListItem {
public:
- CheckBookItem (QListViewItem *parent, QListViewItem *last,
- const QString &text, const QString &name, const QString &filename);
- CheckBookItem (QListView *parent, QListViewItem *last,
- const QString &text, const QString &name, const QString &filename);
+ CheckBookItem (TQListViewItem *parent, TQListViewItem *last,
+ const TQString &text, const TQString &name, const TQString &filename);
+ CheckBookItem (TQListView *parent, TQListViewItem *last,
+ const TQString &text, const TQString &name, const TQString &filename);
~CheckBookItem();
protected:
@@ -72,10 +72,10 @@ private:
* @author Gunnar Schmi Dt
*/
-class InitialPhraseBookWidget : public QWidget {
+class InitialPhraseBookWidget : public TQWidget {
Q_OBJECT
public:
- InitialPhraseBookWidget(QWidget *parent, const char *name);
+ InitialPhraseBookWidget(TQWidget *parent, const char *name);
~InitialPhraseBookWidget();
void createBook();
@@ -95,10 +95,10 @@ private:
class StandardPhraseBookInsertAction : public KAction {
Q_OBJECT
public:
- StandardPhraseBookInsertAction (const KURL &url, const QString& name, const QObject* receiver, const char* slot, KActionCollection* parent)
+ StandardPhraseBookInsertAction (const KURL &url, const TQString& name, const TQObject* receiver, const char* slot, KActionCollection* parent)
: KAction (name, "phrasebook", 0, 0, 0, parent, 0) {
this->url = url;
- connect (this, SIGNAL(slotActivated (const KURL &)), receiver, slot);
+ connect (this, TQT_SIGNAL(slotActivated (const KURL &)), receiver, slot);
};
~StandardPhraseBookInsertAction () {
};
@@ -123,14 +123,14 @@ private:
*/
class ButtonBoxWidget : public ButtonBoxUI {
public:
- ButtonBoxWidget (QWidget *parent = 0, const char *name = 0);
+ ButtonBoxWidget (TQWidget *parent = 0, const char *name = 0);
~ButtonBoxWidget ();
KKeyButton *keyButton;
- QButtonGroup *group;
+ TQButtonGroup *group;
protected:
- QGridLayout *keyButtonPlaceLayout;
+ TQGridLayout *keyButtonPlaceLayout;
};
/**
@@ -147,7 +147,7 @@ private:
*/
PhraseBookDialog ();
- static QString displayPath (QString path);
+ static TQString displayPath (TQString path);
public:
/** Returns a pointer to the instance of this dialog. As a part off the
@@ -162,13 +162,13 @@ public:
bool queryClose ();
public slots:
- void slotTextChanged (const QString &s);
+ void slotTextChanged (const TQString &s);
void slotNoKey();
void slotCustomKey();
void capturedShortcut (const KShortcut& cut);
void selectionChanged ();
- void contextMenuRequested(QListViewItem *, const QPoint &pos, int);
+ void contextMenuRequested(TQListViewItem *, const TQPoint &pos, int);
void slotRemove ();
void slotCut ();
@@ -184,8 +184,8 @@ public slots:
void slotExportPhrasebook ();
void slotPrint ();
- void slotDropped (QDropEvent *e, QListViewItem *parent, QListViewItem *after);
- void slotMoved (QListViewItem *item, QListViewItem *, QListViewItem *);
+ void slotDropped (TQDropEvent *e, TQListViewItem *parent, TQListViewItem *after);
+ void slotMoved (TQListViewItem *item, TQListViewItem *, TQListViewItem *);
signals:
void phrasebookConfirmed (PhraseBook &book);
@@ -199,12 +199,12 @@ private:
/** initializes the list of standard phrase books */
void initStandardPhraseBooks ();
- QListViewItem *addBook (QListViewItem *parent, QListViewItem *after, PhraseBook *book);
- QListViewItem *addBook (QListViewItem *item, PhraseBook *book);
+ TQListViewItem *addBook (TQListViewItem *parent, TQListViewItem *after, PhraseBook *book);
+ TQListViewItem *addBook (TQListViewItem *item, PhraseBook *book);
void setShortcut (const KShortcut &cut);
- void _warning (const KKeySequence &cut, QString sAction, QString sTitle);
+ void _warning (const KKeySequence &cut, TQString sAction, TQString sTitle);
bool isGlobalKeyPresent (const KShortcut& cut, bool warnUser);
bool isPhraseKeyPresent (const KShortcut& cut, bool warnUser);
diff --git a/kmouth/phrasebook/phrasebookparser.cpp b/kmouth/phrasebook/phrasebookparser.cpp
index 9883e49..441ab55 100644
--- a/kmouth/phrasebook/phrasebookparser.cpp
+++ b/kmouth/phrasebook/phrasebookparser.cpp
@@ -23,19 +23,19 @@ PhraseBookParser::PhraseBookParser() {
PhraseBookParser::~PhraseBookParser() {
}
-bool PhraseBookParser::warning (const QXmlParseException &) {
+bool PhraseBookParser::warning (const TQXmlParseException &) {
return false;
}
-bool PhraseBookParser::error (const QXmlParseException &) {
+bool PhraseBookParser::error (const TQXmlParseException &) {
return false;
}
-bool PhraseBookParser::fatalError (const QXmlParseException &) {
+bool PhraseBookParser::fatalError (const TQXmlParseException &) {
return false;
}
-QString PhraseBookParser::errorString() {
+TQString PhraseBookParser::errorString() {
return "";
}
@@ -48,9 +48,9 @@ bool PhraseBookParser::startDocument() {
return true;
}
-bool PhraseBookParser::startElement (const QString &, const QString &,
- const QString &name,
- const QXmlAttributes &attributes)
+bool PhraseBookParser::startElement (const TQString &, const TQString &,
+ const TQString &name,
+ const TQXmlAttributes &attributes)
{
if (name == "phrase") {
if (isInPhrase)
@@ -77,18 +77,18 @@ bool PhraseBookParser::startElement (const QString &, const QString &,
return true;
}
-bool PhraseBookParser::characters (const QString &ch) {
+bool PhraseBookParser::characters (const TQString &ch) {
phrase.phrase += ch;
return true;
}
-bool PhraseBookParser::ignorableWhitespace (const QString &ch) {
+bool PhraseBookParser::ignorableWhitespace (const TQString &ch) {
phrase.phrase += ch;
return true;
}
-bool PhraseBookParser::endElement (const QString &, const QString &,
- const QString &name)
+bool PhraseBookParser::endElement (const TQString &, const TQString &,
+ const TQString &name)
{
if (name == "phrase") {
list += PhraseBookEntry (phrase, level, true);
diff --git a/kmouth/phrasebook/phrasebookparser.h b/kmouth/phrasebook/phrasebookparser.h
index a6e436a..a858b4f 100644
--- a/kmouth/phrasebook/phrasebookparser.h
+++ b/kmouth/phrasebook/phrasebookparser.h
@@ -18,8 +18,8 @@
#ifndef PHRASEBOOKPARSER_H
#define PHRASEBOOKPARSER_H
-#include <qxml.h>
-#include <qvaluestack.h>
+#include <tqxml.h>
+#include <tqvaluestack.h>
#include "phrasebook.h"
/**
@@ -28,31 +28,31 @@
* @author Gunnar Schmi Dt
*/
-class PhraseBookParser : public QXmlDefaultHandler {
+class PhraseBookParser : public TQXmlDefaultHandler {
public:
PhraseBookParser();
~PhraseBookParser();
- 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();
diff --git a/kmouth/phrasebook/phrasetree.cpp b/kmouth/phrasebook/phrasetree.cpp
index 57d4f5e..6ffbaee 100644
--- a/kmouth/phrasebook/phrasetree.cpp
+++ b/kmouth/phrasebook/phrasetree.cpp
@@ -28,7 +28,7 @@
#include "phrasebookdialog.h"
#include "phrasebook.h"
-PhraseTreeItem::PhraseTreeItem (QListView *parent, QListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon)
+PhraseTreeItem::PhraseTreeItem (TQListView *parent, TQListViewItem *after, TQString phrase, KShortcut shortcut, TQPixmap icon)
: KListViewItem (parent, after, phrase)
{
isPhraseValue = true;
@@ -38,7 +38,7 @@ PhraseTreeItem::PhraseTreeItem (QListView *parent, QListViewItem *after, QString
setExpandable (false);
}
-PhraseTreeItem::PhraseTreeItem (QListViewItem *parent, QListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon)
+PhraseTreeItem::PhraseTreeItem (TQListViewItem *parent, TQListViewItem *after, TQString phrase, KShortcut shortcut, TQPixmap icon)
: KListViewItem (parent, after, phrase)
{
isPhraseValue = true;
@@ -47,14 +47,14 @@ PhraseTreeItem::PhraseTreeItem (QListViewItem *parent, QListViewItem *after, QSt
setPixmap(0, icon);
setExpandable (false);
}
-PhraseTreeItem::PhraseTreeItem (QListView *parent, QListViewItem *after, QString name, QPixmap icon)
+PhraseTreeItem::PhraseTreeItem (TQListView *parent, TQListViewItem *after, TQString name, TQPixmap icon)
: KListViewItem (parent, after, name)
{
isPhraseValue = false;
setPixmap(0, icon);
setExpandable (true);
}
-PhraseTreeItem::PhraseTreeItem (QListViewItem *parent, QListViewItem *after, QString name, QPixmap icon)
+PhraseTreeItem::PhraseTreeItem (TQListViewItem *parent, TQListViewItem *after, TQString name, TQPixmap icon)
: KListViewItem (parent, after, name)
{
isPhraseValue = false;
@@ -74,24 +74,24 @@ void PhraseTreeItem::setCut (KShortcut cut) {
// ***************************************************************************
-PhraseTree::PhraseTree (QWidget *parent, const char *name)
+PhraseTree::PhraseTree (TQWidget *parent, const char *name)
: KListView (parent, name)
{
phrasebook_open = KGlobal::iconLoader()->loadIcon("phrasebook", KIcon::Small);
phrasebook_closed = KGlobal::iconLoader()->loadIcon("phrasebook_closed", KIcon::Small);
phrase = KGlobal::iconLoader()->loadIcon("phrase", KIcon::Small);
- connect (this, SIGNAL(expanded (QListViewItem *)), this, SLOT(itemExpanded (QListViewItem *)));
- connect (this, SIGNAL(collapsed (QListViewItem *)), this, SLOT(itemCollapsed (QListViewItem *)));
+ connect (this, TQT_SIGNAL(expanded (TQListViewItem *)), this, TQT_SLOT(itemExpanded (TQListViewItem *)));
+ connect (this, TQT_SIGNAL(collapsed (TQListViewItem *)), this, TQT_SLOT(itemCollapsed (TQListViewItem *)));
}
PhraseTree::~PhraseTree (){
}
namespace PhraseTreePrivate {
- QListViewItem *prevSibling (QListViewItem *item) {
- QListViewItem *parent = item->parent();
- QListViewItem *above = item->itemAbove();
+ TQListViewItem *prevSibling (TQListViewItem *item) {
+ TQListViewItem *parent = item->parent();
+ TQListViewItem *above = item->itemAbove();
if (above == parent)
return 0;
@@ -102,15 +102,15 @@ namespace PhraseTreePrivate {
return above;
}
- bool findAbovePosition (QListViewItem *item,
- QListViewItem **newParent,
- QListViewItem **newAbove)
+ bool findAbovePosition (TQListViewItem *item,
+ TQListViewItem **newParent,
+ TQListViewItem **newAbove)
{
if (item == 0)
return false;
- QListViewItem *parent = item->parent();
- QListViewItem *above = item->itemAbove();
+ TQListViewItem *parent = item->parent();
+ TQListViewItem *above = item->itemAbove();
if (above == 0)
return false;
@@ -133,15 +133,15 @@ namespace PhraseTreePrivate {
}
}
- bool findBelowPosition (QListViewItem *item,
- QListViewItem **newParent,
- QListViewItem **newAbove)
+ bool findBelowPosition (TQListViewItem *item,
+ TQListViewItem **newParent,
+ TQListViewItem **newAbove)
{
if (item == 0)
return false;
- QListViewItem *parent = item->parent();
- QListViewItem *below = item->nextSibling();
+ TQListViewItem *parent = item->parent();
+ TQListViewItem *below = item->nextSibling();
if (parent == 0 && below == 0)
return false;
@@ -162,14 +162,14 @@ namespace PhraseTreePrivate {
}
}
- bool findRightPosition (QListViewItem *item,
- QListViewItem **newParent,
- QListViewItem **newAbove)
+ bool findRightPosition (TQListViewItem *item,
+ TQListViewItem **newParent,
+ TQListViewItem **newAbove)
{
if (item == 0)
return false;
- QListViewItem *above = prevSibling (item);
+ TQListViewItem *above = prevSibling (item);
if (above == 0)
return false;
@@ -188,14 +188,14 @@ namespace PhraseTreePrivate {
}
}
- bool findLeftPosition (QListViewItem *item,
- QListViewItem **newParent,
- QListViewItem **newAbove)
+ bool findLeftPosition (TQListViewItem *item,
+ TQListViewItem **newParent,
+ TQListViewItem **newAbove)
{
if (item == 0)
return false;
- QListViewItem *parent = item->parent();
+ TQListViewItem *parent = item->parent();
if (parent == 0)
return false;
@@ -207,9 +207,9 @@ namespace PhraseTreePrivate {
}
}
-void PhraseTree::moveItem (QListViewItem *item,
- QListViewItem *parent,
- QListViewItem *above)
+void PhraseTree::moveItem (TQListViewItem *item,
+ TQListViewItem *parent,
+ TQListViewItem *above)
{
if (item != 0) {
if (item->parent() == 0)
@@ -227,7 +227,7 @@ void PhraseTree::moveItem (QListViewItem *item,
}
bool PhraseTree::hasSelectedItems() {
- QListViewItem *i = firstChild();
+ TQListViewItem *i = firstChild();
if ( !i )
return false;
int level = 0;
@@ -254,10 +254,10 @@ bool PhraseTree::hasSelectedItems() {
}
void PhraseTree::deleteSelectedItems() {
- QListViewItem *i = firstChild();
+ TQListViewItem *i = firstChild();
if ( !i )
return;
- QListViewItem *deleteItem = 0;
+ TQListViewItem *deleteItem = 0;
do {
if (i->isSelected())
deleteItem = i;
@@ -280,13 +280,13 @@ void PhraseTree::deleteSelectedItems() {
while (i != 0);
}
-void PhraseTree::keyPressEvent (QKeyEvent *e) {
+void PhraseTree::keyPressEvent (TQKeyEvent *e) {
if ((e->state() & Qt::KeyButtonMask) == Qt::AltButton) {
if (e->key() == Qt::Key_Up) {
- QListViewItem *item = currentItem();
+ TQListViewItem *item = currentItem();
if ((item != 0) && (item->isSelected())) {
- QListViewItem *parent;
- QListViewItem *above;
+ TQListViewItem *parent;
+ TQListViewItem *above;
if (PhraseTreePrivate::findAbovePosition (item, &parent, &above)) {
moveItem(item, parent, above);
@@ -298,10 +298,10 @@ void PhraseTree::keyPressEvent (QKeyEvent *e) {
return;
}
else if (e->key() == Qt::Key_Down) {
- QListViewItem *item = currentItem();
+ TQListViewItem *item = currentItem();
if ((item != 0) && (item->isSelected())) {
- QListViewItem *parent;
- QListViewItem *above;
+ TQListViewItem *parent;
+ TQListViewItem *above;
if (PhraseTreePrivate::findBelowPosition (item, &parent, &above)) {
moveItem(item, parent, above);
@@ -313,10 +313,10 @@ void PhraseTree::keyPressEvent (QKeyEvent *e) {
return;
}
else if (e->key() == Qt::Key_Left) {
- QListViewItem *item = currentItem();
+ TQListViewItem *item = currentItem();
if ((item != 0) && (item->isSelected())) {
- QListViewItem *parent;
- QListViewItem *above;
+ TQListViewItem *parent;
+ TQListViewItem *above;
if (PhraseTreePrivate::findLeftPosition (item, &parent, &above)) {
moveItem(item, parent, above);
@@ -328,10 +328,10 @@ void PhraseTree::keyPressEvent (QKeyEvent *e) {
return;
}
else if (e->key() == Qt::Key_Right) {
- QListViewItem *item = currentItem();
+ TQListViewItem *item = currentItem();
if ((item != 0) && (item->isSelected())) {
- QListViewItem *parent;
- QListViewItem *above;
+ TQListViewItem *parent;
+ TQListViewItem *above;
if (PhraseTreePrivate::findRightPosition (item, &parent, &above)) {
moveItem(item, parent, above);
@@ -346,10 +346,10 @@ void PhraseTree::keyPressEvent (QKeyEvent *e) {
KListView::keyPressEvent(e);
}
-PhraseTreeItem *PhraseTree::insertPhrase (QListViewItem *parent, QListViewItem *after, QString phrase, QString shortcut) {
+PhraseTreeItem *PhraseTree::insertPhrase (TQListViewItem *parent, TQListViewItem *after, TQString phrase, TQString shortcut) {
KShortcut cut = KShortcut(shortcut);
if (isKeyPresent (cut, 0, false))
- cut = KShortcut(QString::null);
+ cut = KShortcut(TQString::null);
if (parent == 0)
return new PhraseTreeItem (this, after, phrase, cut, this->phrase);
@@ -357,15 +357,15 @@ PhraseTreeItem *PhraseTree::insertPhrase (QListViewItem *parent, QListViewItem *
return new PhraseTreeItem (parent, after, phrase, cut, this->phrase);
}
-PhraseTreeItem *PhraseTree::insertBook (QListViewItem *parent, QListViewItem *after, QString name) {
+PhraseTreeItem *PhraseTree::insertBook (TQListViewItem *parent, TQListViewItem *after, TQString name) {
if (parent == 0)
return new PhraseTreeItem (this, after, name, phrasebook_closed);
else
return new PhraseTreeItem (parent, after, name, phrasebook_closed);
}
-QListViewItem *PhraseTree::addBook (QListViewItem *parent, QListViewItem *after, PhraseBook *book) {
- QListViewItem *last = after;
+TQListViewItem *PhraseTree::addBook (TQListViewItem *parent, TQListViewItem *after, PhraseBook *book) {
+ TQListViewItem *last = after;
int level = 0;
PhraseBookEntryList::iterator it;
for (it = book->begin(); it != book->end(); ++it) {
@@ -403,7 +403,7 @@ QListViewItem *PhraseTree::addBook (QListViewItem *parent, QListViewItem *after,
}
void PhraseTree::fillBook (PhraseBook *book, bool respectSelection) {
- QListViewItem *i = firstChild();
+ TQListViewItem *i = firstChild();
int level = 0;
if ( !i )
return;
@@ -432,11 +432,11 @@ void PhraseTree::fillBook (PhraseBook *book, bool respectSelection) {
while (i != 0);
}
-QDragObject *PhraseTree::dragObject () {
+TQDragObject *PhraseTree::dragObject () {
return dragObject (true);
}
-QDragObject *PhraseTree::dragObject (bool isDependent) {
+TQDragObject *PhraseTree::dragObject (bool isDependent) {
PhraseBook book;
fillBook (&book, true);
if (isDependent)
@@ -444,7 +444,7 @@ QDragObject *PhraseTree::dragObject (bool isDependent) {
return new PhraseBookDrag(&book);
}
-bool PhraseTree::acceptDrag (QDropEvent* event) const {
+bool PhraseTree::acceptDrag (TQDropEvent* event) const {
if (KListView::acceptDrag (event))
return true;
else
@@ -463,10 +463,10 @@ static int keyConflict (const KShortcut& cut, const KShortcut& cut2) {
return -1;
}
-void PhraseTree::_warning (const KKeySequence& cut, QString sAction, QString sTitle) {
+void PhraseTree::_warning (const KKeySequence& cut, TQString sAction, TQString sTitle) {
sAction = sAction.stripWhiteSpace();
- QString s =
+ TQString s =
i18n("The '%1' key combination has already been allocated "
"to %2.\n"
"Please choose a unique key combination.").
@@ -494,8 +494,8 @@ bool PhraseTree::isStdAccelPresent (const KShortcut& cut, bool warnUser) {
}
bool PhraseTree::isGlobalKeyPresent (const KShortcut& cut, bool warnUser) {
- QMap<QString, QString> mapEntry = KGlobal::config()->entryMap ("Global Shortcuts");
- QMap<QString, QString>::Iterator it;
+ TQMap<TQString, TQString> mapEntry = KGlobal::config()->entryMap ("Global Shortcuts");
+ TQMap<TQString, TQString>::Iterator it;
for (it = mapEntry.begin(); it != mapEntry.end(); ++it) {
int iSeq = keyConflict (cut, KShortcut(*it));
if (iSeq > -1) {
@@ -510,7 +510,7 @@ bool PhraseTree::isGlobalKeyPresent (const KShortcut& cut, bool warnUser) {
}
bool PhraseTree::isPhraseKeyPresent (const KShortcut& cut, PhraseTreeItem* cutItem, bool warnUser) {
- for (QListViewItemIterator it(this); it.current(); ++it) {
+ for (TQListViewItemIterator it(this); it.current(); ++it) {
PhraseTreeItem* item = dynamic_cast<PhraseTreeItem*>(it.current());
if ((item != 0) && (item != cutItem)) {
int iSeq = keyConflict (cut, item->cut());
@@ -539,13 +539,13 @@ bool PhraseTree::isKeyPresent (const KShortcut& cut, PhraseTreeItem* cutItem, bo
return false;
}
-void PhraseTree::itemExpanded (QListViewItem *item) {
+void PhraseTree::itemExpanded (TQListViewItem *item) {
PhraseTreeItem *i = (PhraseTreeItem *)item;
if (!i->isPhrase())
i->setPixmap(0, phrasebook_open);
}
-void PhraseTree::itemCollapsed (QListViewItem *item) {
+void PhraseTree::itemCollapsed (TQListViewItem *item) {
PhraseTreeItem *i = (PhraseTreeItem *)item;
if (!i->isPhrase())
i->setPixmap(0, phrasebook_closed);
diff --git a/kmouth/phrasebook/phrasetree.h b/kmouth/phrasebook/phrasetree.h
index bd0e1f5..45ae26c 100644
--- a/kmouth/phrasebook/phrasetree.h
+++ b/kmouth/phrasebook/phrasetree.h
@@ -18,7 +18,7 @@
#ifndef PHRASETREE_H
#define PHRASETREE_H
-#include <qpixmap.h>
+#include <tqpixmap.h>
#include <kshortcut.h>
#include <klistview.h>
@@ -33,13 +33,13 @@ class PhraseTreeItem : public KListViewItem {
friend class PhraseTree;
private:
/** Creates a phrase item within a sub phrase book */
- PhraseTreeItem (QListView *parent, QListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon);
+ PhraseTreeItem (TQListView *parent, TQListViewItem *after, TQString phrase, KShortcut shortcut, TQPixmap icon);
/** Creates a phrase item at the top level */
- PhraseTreeItem (QListViewItem *parent, QListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon);
+ PhraseTreeItem (TQListViewItem *parent, TQListViewItem *after, TQString phrase, KShortcut shortcut, TQPixmap icon);
/** Creates a phrase book item within a sub phrase book */
- PhraseTreeItem (QListView *parent, QListViewItem *after, QString name, QPixmap icon);
+ PhraseTreeItem (TQListView *parent, TQListViewItem *after, TQString name, TQPixmap icon);
/** Creates a phrase book item at the top level */
- PhraseTreeItem (QListViewItem *parent, QListViewItem *after, QString name, QPixmap icon);
+ PhraseTreeItem (TQListViewItem *parent, TQListViewItem *after, TQString name, TQPixmap icon);
public:
bool isPhrase();
@@ -61,30 +61,30 @@ class PhraseTree : public KListView {
friend class PhraseTreeItem;
Q_OBJECT
public:
- PhraseTree (QWidget *parent = 0, const char *name = 0);
+ PhraseTree (TQWidget *parent = 0, const char *name = 0);
~PhraseTree ();
- void keyPressEvent (QKeyEvent *e);
+ void keyPressEvent (TQKeyEvent *e);
- PhraseTreeItem *insertPhrase (QListViewItem *parent, QListViewItem *after, QString phrase, QString shortcut);
- PhraseTreeItem *insertBook (QListViewItem *parent, QListViewItem *after, QString name);
+ PhraseTreeItem *insertPhrase (TQListViewItem *parent, TQListViewItem *after, TQString phrase, TQString shortcut);
+ PhraseTreeItem *insertBook (TQListViewItem *parent, TQListViewItem *after, TQString name);
- QListViewItem *addBook (QListViewItem *parent, QListViewItem *after, PhraseBook *book);
+ TQListViewItem *addBook (TQListViewItem *parent, TQListViewItem *after, PhraseBook *book);
void fillBook (PhraseBook *book, bool respectSelection);
- QDragObject *dragObject ();
- QDragObject *dragObject (bool isDependent);
+ TQDragObject *dragObject ();
+ TQDragObject *dragObject (bool isDependent);
- void moveItem (QListViewItem *item, QListViewItem *parent, QListViewItem *above);
+ void moveItem (TQListViewItem *item, TQListViewItem *parent, TQListViewItem *above);
bool hasSelectedItems();
void deleteSelectedItems();
protected:
- bool acceptDrag (QDropEvent* event) const;
+ bool acceptDrag (TQDropEvent* event) const;
private:
- void _warning (const KKeySequence& cut, QString sAction, QString sTitle);
+ void _warning (const KKeySequence& cut, TQString sAction, TQString sTitle);
bool isStdAccelPresent (const KShortcut& cut, bool warnUser);
bool isGlobalKeyPresent (const KShortcut& cut, bool warnUser);
bool isApplicationKeyPresent (const KShortcut& cut, bool warnUser);
@@ -93,16 +93,16 @@ public:
bool isKeyPresent (const KShortcut& cut, PhraseTreeItem* cutItem, bool warnUser);
public slots:
- void itemExpanded (QListViewItem *item);
- void itemCollapsed (QListViewItem *item);
+ void itemExpanded (TQListViewItem *item);
+ void itemCollapsed (TQListViewItem *item);
signals:
void shortcutRequest (PhraseShortcutRequest *request);
private:
- QPixmap phrasebook_open;
- QPixmap phrasebook_closed;
- QPixmap phrase;
+ TQPixmap phrasebook_open;
+ TQPixmap phrasebook_closed;
+ TQPixmap phrase;
};
#endif
diff --git a/kmouth/phraseedit.cpp b/kmouth/phraseedit.cpp
index 0f2e319..000a1f5 100644
--- a/kmouth/phraseedit.cpp
+++ b/kmouth/phraseedit.cpp
@@ -17,14 +17,14 @@
#include "phraseedit.h"
-PhraseEdit::PhraseEdit(const QString &string, QWidget *parent)
+PhraseEdit::PhraseEdit(const TQString &string, TQWidget *parent)
: KLineEdit (string, parent) {
}
PhraseEdit::~PhraseEdit() {
}
-void PhraseEdit::keyPressEvent (QKeyEvent *e) {
+void PhraseEdit::keyPressEvent (TQKeyEvent *e) {
if ((e->state() & Qt::KeyButtonMask) == Qt::ControlButton) {
if (e->key() == Qt::Key_C) {
if (!this->hasSelectedText()) {
diff --git a/kmouth/phraseedit.h b/kmouth/phraseedit.h
index a7a065e..0ebd132 100644
--- a/kmouth/phraseedit.h
+++ b/kmouth/phraseedit.h
@@ -27,10 +27,10 @@
class PhraseEdit : public KLineEdit {
public:
- PhraseEdit(const QString &string, QWidget *parent);
+ PhraseEdit(const TQString &string, TQWidget *parent);
virtual ~PhraseEdit();
- void keyPressEvent (QKeyEvent *e);
+ void keyPressEvent (TQKeyEvent *e);
};
#endif
diff --git a/kmouth/phraselist.cpp b/kmouth/phraselist.cpp
index d57682a..48148c3 100644
--- a/kmouth/phraselist.cpp
+++ b/kmouth/phraselist.cpp
@@ -16,12 +16,12 @@
***************************************************************************/
// include files for Qt
-#include <qprinter.h>
-#include <qpainter.h>
-#include <qlayout.h>
-#include <qwhatsthis.h>
-#include <qpopupmenu.h>
-#include <qclipboard.h>
+#include <tqprinter.h>
+#include <tqpainter.h>
+#include <tqlayout.h>
+#include <tqwhatsthis.h>
+#include <tqpopupmenu.h>
+#include <tqclipboard.h>
// include files for KDE
#include <klistbox.h>
@@ -45,18 +45,18 @@
#include "phrasebook/phrasebook.h"
#include "wordcompletion/wordcompletion.h"
-PhraseList::PhraseList(QWidget *parent, const char *name) : QWidget(parent,name) {
+PhraseList::PhraseList(TQWidget *parent, const char *name) : TQWidget(parent,name) {
isInSlot = false;
setBackgroundMode(PaletteBase);
- QVBoxLayout *layout = new QVBoxLayout (this);
+ TQVBoxLayout *layout = new TQVBoxLayout (this);
listBox = new KListBox (this);
- listBox->setFocusPolicy(QWidget::NoFocus);
- listBox->setSelectionMode (QListBox::Extended);
- QWhatsThis::add (listBox, i18n("This list contains the history of spoken sentences. You can select sentences and press the speak button for re-speaking."));
+ listBox->setFocusPolicy(TQWidget::NoFocus);
+ listBox->setSelectionMode (TQListBox::Extended);
+ TQWhatsThis::add (listBox, i18n("This list contains the history of spoken sentences. You can select sentences and press the speak button for re-speaking."));
layout->addWidget(listBox);
- QHBoxLayout *rowLayout = new QHBoxLayout ();
+ TQHBoxLayout *rowLayout = new TQHBoxLayout ();
layout->addLayout(rowLayout);
completion = new WordCompletion();
@@ -66,29 +66,29 @@ PhraseList::PhraseList(QWidget *parent, const char *name) : QWidget(parent,name)
rowLayout->addWidget(dictionaryCombo);
lineEdit = new PhraseEdit ("", this);
- lineEdit->setFocusPolicy(QWidget::StrongFocus);
+ lineEdit->setFocusPolicy(TQWidget::StrongFocus);
lineEdit->setFrame(true);
- lineEdit->setEchoMode(QLineEdit::Normal);
+ lineEdit->setEchoMode(TQLineEdit::Normal);
lineEdit->setCompletionObject (completion);
lineEdit->setAutoDeleteCompletionObject(true);
- QWhatsThis::add (lineEdit, i18n("Into this edit field you can type a phrase. Click on the speak button in order to speak the entered phrase."));
+ TQWhatsThis::add (lineEdit, i18n("Into this edit field you can type a phrase. Click on the speak button in order to speak the entered phrase."));
rowLayout->addWidget(lineEdit);
lineEdit->setFocus();
- QIconSet icon = KGlobal::iconLoader()->loadIconSet("speak", KIcon::Small);
- speakButton = new QPushButton (icon, i18n("&Speak"), this);
- speakButton->setFocusPolicy(QWidget::NoFocus);
+ TQIconSet icon = KGlobal::iconLoader()->loadIconSet("speak", KIcon::Small);
+ speakButton = new TQPushButton (icon, i18n("&Speak"), this);
+ speakButton->setFocusPolicy(TQWidget::NoFocus);
speakButton->setAutoDefault(false);
- QWhatsThis::add (speakButton, i18n("Speaks the currently active sentence(s). If there is some text in the edit field it is spoken. Otherwise the selected sentences in the history (if any) are spoken."));
+ TQWhatsThis::add (speakButton, i18n("Speaks the currently active sentence(s). If there is some text in the edit field it is spoken. Otherwise the selected sentences in the history (if any) are spoken."));
rowLayout->addWidget(speakButton);
- connect(dictionaryCombo, SIGNAL (activated (const QString &)), completion, SLOT (setWordList(const QString &)));
- connect(completion, SIGNAL (wordListsChanged (const QStringList &)), this, SLOT (configureCompletionCombo (const QStringList &)));
- connect(listBox, SIGNAL(selectionChanged()), SLOT(selectionChanged()));
- connect(listBox, SIGNAL(contextMenuRequested (QListBoxItem *, const QPoint &)), SLOT(contextMenuRequested (QListBoxItem *, const QPoint &)));
- connect(lineEdit, SIGNAL(returnPressed(const QString &)), SLOT(lineEntered(const QString &)));
- connect(lineEdit, SIGNAL(textChanged (const QString &)), SLOT(textChanged(const QString &)));
- connect(speakButton, SIGNAL( clicked ()), SLOT(speak()));
+ connect(dictionaryCombo, TQT_SIGNAL (activated (const TQString &)), completion, TQT_SLOT (setWordList(const TQString &)));
+ connect(completion, TQT_SIGNAL (wordListsChanged (const TQStringList &)), this, TQT_SLOT (configureCompletionCombo (const TQStringList &)));
+ connect(listBox, TQT_SIGNAL(selectionChanged()), TQT_SLOT(selectionChanged()));
+ connect(listBox, TQT_SIGNAL(contextMenuRequested (TQListBoxItem *, const TQPoint &)), TQT_SLOT(contextMenuRequested (TQListBoxItem *, const TQPoint &)));
+ connect(lineEdit, TQT_SIGNAL(returnPressed(const TQString &)), TQT_SLOT(lineEntered(const TQString &)));
+ connect(lineEdit, TQT_SIGNAL(textChanged (const TQString &)), TQT_SLOT(textChanged(const TQString &)));
+ connect(speakButton, TQT_SIGNAL( clicked ()), TQT_SLOT(speak()));
}
PhraseList::~PhraseList() {
@@ -99,17 +99,17 @@ PhraseList::~PhraseList() {
void PhraseList::print(KPrinter *pPrinter) {
PhraseBook book;
- for (QListBoxItem *item = listBox->firstItem(); item != 0; item = item->next()) {
+ for (TQListBoxItem *item = listBox->firstItem(); item != 0; item = item->next()) {
book += PhraseBookEntry(Phrase(item->text()));
}
book.print (pPrinter);
}
-QStringList PhraseList::getListSelection() {
- QStringList res = QStringList();
+TQStringList PhraseList::getListSelection() {
+ TQStringList res = TQStringList();
- for (QListBoxItem *item = listBox->firstItem(); item != 0; item = item->next()) {
+ for (TQListBoxItem *item = listBox->firstItem(); item != 0; item = item->next()) {
if (item->isSelected())
res += item->text();
}
@@ -118,7 +118,7 @@ QStringList PhraseList::getListSelection() {
}
bool PhraseList::existListSelection() {
- for (QListBoxItem *item = listBox->firstItem(); item != 0; item = item->next()) {
+ for (TQListBoxItem *item = listBox->firstItem(); item != 0; item = item->next()) {
if (item->isSelected())
return true;
}
@@ -133,7 +133,7 @@ bool PhraseList::existEditSelection() {
void PhraseList::enableMenuEntries() {
bool deselected = false;
bool selected = false;
- for (QListBoxItem *item = listBox->firstItem(); item != 0; item = item->next()) {
+ for (TQListBoxItem *item = listBox->firstItem(); item != 0; item = item->next()) {
if (item->isSelected())
selected = true;
else
@@ -147,8 +147,8 @@ void PhraseList::configureCompletion() {
completion->configure();
}
-void PhraseList::configureCompletionCombo(const QStringList &list) {
- QString current = completion->currentWordList();
+void PhraseList::configureCompletionCombo(const TQStringList &list) {
+ TQString current = completion->currentWordList();
dictionaryCombo->clear();
if (list.isEmpty())
dictionaryCombo->hide();
@@ -161,7 +161,7 @@ void PhraseList::configureCompletionCombo(const QStringList &list) {
dictionaryCombo->insertStringList (list);
dictionaryCombo->show();
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
int i = 0;
for (it = list.begin(), i = 0; it != list.end(); ++it, ++i) {
if (current == *it) {
@@ -191,9 +191,9 @@ void PhraseList::readCompletionOptions(KConfig *config) {
int mode = config->readNumEntry ("Mode", KGlobalSettings::completionMode());
lineEdit->setCompletionMode (static_cast<KGlobalSettings::Completion>(mode));
- QString current = config->readEntry ("List", QString::null);
- QStringList list = completion->wordLists();
- QStringList::ConstIterator it;
+ TQString current = config->readEntry ("List", TQString::null);
+ TQStringList list = completion->wordLists();
+ TQStringList::ConstIterator it;
int i = 0;
for (it = list.begin(), i = 0; it != list.end(); ++it, ++i) {
if (current == *it) {
@@ -218,7 +218,7 @@ void PhraseList::deselectAllEntries () {
}
void PhraseList::speak () {
- QString phrase = lineEdit->text();
+ TQString phrase = lineEdit->text();
if (phrase.isNull() || phrase.isEmpty())
speakListSelection();
else {
@@ -245,7 +245,7 @@ void PhraseList::paste() {
lineEdit->paste();
}
-void PhraseList::insert (const QString &s) {
+void PhraseList::insert (const TQString &s) {
setEditLineText(s);
}
@@ -254,8 +254,8 @@ void PhraseList::speakListSelection () {
}
void PhraseList::removeListSelection () {
- QListBoxItem *next;
- for (QListBoxItem *item = listBox->firstItem(); item != 0; item = next) {
+ TQListBoxItem *next;
+ for (TQListBoxItem *item = listBox->firstItem(); item != 0; item = next) {
next = item->next();
if (item->isSelected()) {
@@ -271,10 +271,10 @@ void PhraseList::cutListSelection () {
}
void PhraseList::copyListSelection () {
- QApplication::clipboard()->setText (getListSelection().join ("\n"));
+ TQApplication::clipboard()->setText (getListSelection().join ("\n"));
}
-void PhraseList::lineEntered (const QString &phrase) {
+void PhraseList::lineEntered (const TQString &phrase) {
if (phrase.isNull() || phrase.isEmpty())
speakListSelection();
else {
@@ -283,15 +283,15 @@ void PhraseList::lineEntered (const QString &phrase) {
}
}
-void PhraseList::speakPhrase (const QString &phrase) {
- QApplication::setOverrideCursor (KCursor::WaitCursor, false);
+void PhraseList::speakPhrase (const TQString &phrase) {
+ TQApplication::setOverrideCursor (KCursor::WaitCursor, false);
KMouthApp *theApp=(KMouthApp *) parentWidget();
- QString language = completion->languageOfWordList (completion->currentWordList());
+ TQString language = completion->languageOfWordList (completion->currentWordList());
theApp->getTTSSystem()->speak(phrase, language);
- QApplication::restoreOverrideCursor ();
+ TQApplication::restoreOverrideCursor ();
}
-void PhraseList::insertIntoPhraseList (const QString &phrase, bool clearEditLine) {
+void PhraseList::insertIntoPhraseList (const TQString &phrase, bool clearEditLine) {
int lastLine = listBox->count() - 1;
if ((lastLine == -1) || (phrase != listBox->text(lastLine))) {
listBox->insertItem(new PhraseListItem(phrase));
@@ -306,8 +306,8 @@ void PhraseList::insertIntoPhraseList (const QString &phrase, bool clearEditLine
enableMenuEntries ();
}
-void PhraseList::contextMenuRequested (QListBoxItem *, const QPoint &pos) {
- QString name;
+void PhraseList::contextMenuRequested (TQListBoxItem *, const TQPoint &pos) {
+ TQString name;
if (existListSelection())
name = "phraselist_selection_popup";
else
@@ -315,13 +315,13 @@ void PhraseList::contextMenuRequested (QListBoxItem *, const QPoint &pos) {
KMouthApp *theApp=(KMouthApp *) parentWidget();
KXMLGUIFactory *factory = theApp->factory();
- QPopupMenu *popup = (QPopupMenu *)factory->container(name,theApp);
+ TQPopupMenu *popup = (TQPopupMenu *)factory->container(name,theApp);
if (popup != 0) {
popup->popup(pos, 0);
}
}
-void PhraseList::textChanged (const QString &s) {
+void PhraseList::textChanged (const TQString &s) {
if (!isInSlot) {
isInSlot = true;
line = s;
@@ -335,7 +335,7 @@ void PhraseList::selectionChanged () {
if (!isInSlot) {
isInSlot = true;
- QStringList sel = getListSelection();
+ TQStringList sel = getListSelection();
if (sel.empty())
setEditLineText(line);
@@ -349,17 +349,17 @@ void PhraseList::selectionChanged () {
enableMenuEntries ();
}
-void PhraseList::setEditLineText(const QString &s) {
+void PhraseList::setEditLineText(const TQString &s) {
lineEdit->end(false);
while (!(lineEdit->text().isNull() || lineEdit->text().isEmpty()))
lineEdit->backspace();
lineEdit->insert(s);
}
-void PhraseList::keyPressEvent (QKeyEvent *e) {
+void PhraseList::keyPressEvent (TQKeyEvent *e) {
if (e->key() == Qt::Key_Up) {
bool selected = false;
- for (QListBoxItem *item = listBox->firstItem(); item != 0; item = item->next()) {
+ for (TQListBoxItem *item = listBox->firstItem(); item != 0; item = item->next()) {
if (item->isSelected()) {
selected = true;
}
@@ -396,7 +396,7 @@ void PhraseList::keyPressEvent (QKeyEvent *e) {
}
else if (e->key() == Qt::Key_Down) {
bool selected = false;
- for (QListBoxItem *item = listBox->firstItem(); item != 0; item = item->next()) {
+ for (TQListBoxItem *item = listBox->firstItem(); item != 0; item = item->next()) {
if (item->isSelected()) {
selected = true;
}
@@ -440,7 +440,7 @@ void PhraseList::save () {
// format we use that method here.
PhraseBook book;
- for (QListBoxItem *item = listBox->firstItem(); item != 0; item = item->next()) {
+ for (TQListBoxItem *item = listBox->firstItem(); item != 0; item = item->next()) {
book += PhraseBookEntry(Phrase(item->text()));
}
@@ -450,7 +450,7 @@ void PhraseList::save () {
}
void PhraseList::open () {
- KURL url=KFileDialog::getOpenURL(QString::null,
+ KURL url=KFileDialog::getOpenURL(TQString::null,
i18n("*|All Files\n*.phrasebook|Phrase Books (*.phrasebook)\n*.txt|Plain Text Files (*.txt)"), this, i18n("Open File as History"));
if(!url.isEmpty())
@@ -465,9 +465,9 @@ void PhraseList::open (KURL url) {
PhraseBook book;
if (book.open (url)) {
// convert PhraseBookEntryList -> QStringList
- QStringList list = book.toStringList();
+ TQStringList list = book.toStringList();
listBox->clear();
- QStringList::iterator it;
+ TQStringList::iterator it;
for (it = list.begin(); it != list.end(); ++it)
insertIntoPhraseList (*it, false);
}
diff --git a/kmouth/phraselist.h b/kmouth/phraselist.h
index 7f56306..702e135 100644
--- a/kmouth/phraselist.h
+++ b/kmouth/phraselist.h
@@ -24,8 +24,8 @@
#include <kprinter.h>
// include files for Qt
-#include <qwidget.h>
-#include <qpushbutton.h>
+#include <tqwidget.h>
+#include <tqpushbutton.h>
class WordCompletion;
@@ -38,16 +38,16 @@ class WordCompletion;
* @author Gunnar Schmi Dt
*/
-class PhraseList : public QWidget {
+class PhraseList : public TQWidget {
Q_OBJECT
public:
- PhraseList(QWidget *parent=0, const char *name=0);
+ PhraseList(TQWidget *parent=0, const char *name=0);
~PhraseList();
/** contains the implementation for printing functionality */
void print(KPrinter *pPrinter);
- QStringList getListSelection();
+ TQStringList getListSelection();
bool existListSelection();
bool existEditSelection();
@@ -61,7 +61,7 @@ public slots:
void paste();
/** Insert s into the edit field. */
- void insert (const QString &s);
+ void insert (const TQString &s);
/** Called whenever the user wants the selected list entries to be spoken. */
void speakListSelection ();
@@ -83,26 +83,26 @@ public slots:
void readCompletionOptions(KConfig *config);
protected slots:
- void lineEntered (const QString &phrase);
- void contextMenuRequested (QListBoxItem *, const QPoint &pos);
- void textChanged (const QString &s);
+ void lineEntered (const TQString &phrase);
+ void contextMenuRequested (TQListBoxItem *, const TQPoint &pos);
+ void textChanged (const TQString &s);
void selectionChanged ();
- void keyPressEvent (QKeyEvent *e);
- void configureCompletionCombo(const QStringList &list);
+ void keyPressEvent (TQKeyEvent *e);
+ void configureCompletionCombo(const TQStringList &list);
private:
KListBox *listBox;
KComboBox *dictionaryCombo;
KLineEdit *lineEdit;
- QPushButton *speakButton;
- QString line;
+ TQPushButton *speakButton;
+ TQString line;
WordCompletion *completion;
bool isInSlot;
- void speakPhrase (const QString &phrase);
- void setEditLineText(const QString &s);
- void insertIntoPhraseList (const QString &phrase, bool clearEditLine);
+ void speakPhrase (const TQString &phrase);
+ void setEditLineText(const TQString &s);
+ void insertIntoPhraseList (const TQString &phrase, bool clearEditLine);
void enableMenuEntries ();
};
diff --git a/kmouth/phraselistitem.cpp b/kmouth/phraselistitem.cpp
index 6156054..721e893 100644
--- a/kmouth/phraselistitem.cpp
+++ b/kmouth/phraselistitem.cpp
@@ -16,21 +16,21 @@
***************************************************************************/
#include "phraselistitem.h"
-#include <qstyle.h>
-#include <qpainter.h>
+#include <tqstyle.h>
+#include <tqpainter.h>
-PhraseListItem::PhraseListItem (const QString & text)
- : QListBoxText::QListBoxText(text) {
+PhraseListItem::PhraseListItem (const TQString & text)
+ : TQListBoxText::TQListBoxText(text) {
}
PhraseListItem::~PhraseListItem() {
}
bool PhraseListItem::drawCursor() const {
- if ((QListBoxItem *)this != listBox()->item (listBox()->currentItem()))
+ if ((TQListBoxItem *)this != listBox()->item (listBox()->currentItem()))
return false;
- for (QListBoxItem *item = listBox()->firstItem(); item != 0; item = item->next() ) {
+ for (TQListBoxItem *item = listBox()->firstItem(); item != 0; item = item->next() ) {
if (item->isSelected())
return true;
}
@@ -41,12 +41,12 @@ int PhraseListItem::rtti() const {
return RTTI;
}
-void PhraseListItem::paint (QPainter *p) {
- QListBoxText::paint (p);
+void PhraseListItem::paint (TQPainter *p) {
+ TQListBoxText::paint (p);
if (drawCursor()) {
- QRect r (0, 0, listBox()->maxItemWidth(), height (listBox()));
- listBox()->style().drawPrimitive (QStyle::PE_FocusRect, p, r,
+ TQRect r (0, 0, listBox()->maxItemWidth(), height (listBox()));
+ listBox()->style().drawPrimitive (TQStyle::PE_FocusRect, p, r,
listBox()->colorGroup());
}
}
diff --git a/kmouth/phraselistitem.h b/kmouth/phraselistitem.h
index 24d5e49..3afc85b 100644
--- a/kmouth/phraselistitem.h
+++ b/kmouth/phraselistitem.h
@@ -18,17 +18,17 @@
#ifndef PHRASELISTITEM_H
#define PHRASELISTITEM_H
-#include <qlistbox.h>
+#include <tqlistbox.h>
/**
* This class represents a phrase in the list of spoken phrases. It extends
- * QListBoxText for providing support for a visible list cursor.
+ * TQListBoxText for providing support for a visible list cursor.
* @author Gunnar Schmi Dt
*/
-class PhraseListItem : public QListBoxText {
+class PhraseListItem : public TQListBoxText {
public:
- PhraseListItem (const QString & text);
+ PhraseListItem (const TQString & text);
~PhraseListItem();
bool drawCursor() const;
@@ -37,7 +37,7 @@ public:
static const int RTTI = 982734;
protected:
- void paint( QPainter * );
+ void paint( TQPainter * );
};
#endif
diff --git a/kmouth/speech.cpp b/kmouth/speech.cpp
index d2f7db8..8fc8f19 100644
--- a/kmouth/speech.cpp
+++ b/kmouth/speech.cpp
@@ -16,13 +16,13 @@
***************************************************************************/
#include "speech.h"
-#include <qstring.h>
-#include <qvaluelist.h>
-#include <qvaluestack.h>
-#include <qstringlist.h>
-#include <qregexp.h>
-#include <qtextcodec.h>
-#include <qfile.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
+#include <tqvaluestack.h>
+#include <tqstringlist.h>
+#include <tqregexp.h>
+#include <tqtextcodec.h>
+#include <tqfile.h>
#include <kdebug.h>
#include <kdeversion.h>
@@ -39,25 +39,25 @@ Speech::Speech() {
Speech::~Speech() {
}
-QString Speech::prepareCommand (QString command, const QString &text,
- const QString &filename, const QString &language) {
+TQString Speech::prepareCommand (TQString command, const TQString &text,
+ const TQString &filename, const TQString &language) {
#ifdef macroExpander
- QMap<QChar,QString> map;
+ TQMap<TQChar,TQString> map;
map['t'] = text;
map['f'] = filename;
map['l'] = language;
return KMacroExpander::expandMacrosShellQuote (command, map);
#else
- QValueStack<bool> stack; // saved isdoublequote values during parsing of braces
+ TQValueStack<bool> stack; // saved isdoublequote values during parsing of braces
bool issinglequote=false; // inside '...' ?
bool isdoublequote=false; // inside "..." ?
int noreplace=0; // nested braces when within ${...}
- QString escText = KShellProcess::quote(text);
+ TQString escText = KShellProcess::quote(text);
// character sequences that change the state or need to be otherwise processed
- QRegExp re_singlequote("('|%%|%t|%f|%l)");
- QRegExp re_doublequote("(\"|\\\\|`|\\$\\(|\\$\\{|%%|%t|%f|%l)");
- QRegExp re_noquote ("('|\"|\\\\|`|\\$\\(|\\$\\{|\\(|\\{|\\)|\\}|%%|%t|%f|%l)");
+ TQRegExp re_singlequote("('|%%|%t|%f|%l)");
+ TQRegExp re_doublequote("(\"|\\\\|`|\\$\\(|\\$\\{|%%|%t|%f|%l)");
+ TQRegExp re_noquote ("('|\"|\\\\|`|\\$\\(|\\$\\{|\\(|\\{|\\)|\\}|%%|%t|%f|%l)");
// parse the command:
for (int i = re_noquote.search(command);
@@ -108,7 +108,7 @@ QString Speech::prepareCommand (QString command, const QString &text,
else if (command[i]=='`') {
// Replace all `...` with safer $(...)
command.replace (i, 1, "$(");
- QRegExp re_backticks("(`|\\\\`|\\\\\\\\|\\\\\\$)");
+ TQRegExp re_backticks("(`|\\\\`|\\\\\\\\|\\\\\\$)");
for (int i2=re_backticks.search(command,i+2);
i2!=-1;
i2=re_backticks.search(command,i2)
@@ -135,7 +135,7 @@ QString Speech::prepareCommand (QString command, const QString &text,
i+=re_noquote.matchedLength();
}
else { // replace macro
- QString match, v;
+ TQString match, v;
// get match
if (issinglequote)
@@ -169,35 +169,35 @@ QString Speech::prepareCommand (QString command, const QString &text,
#endif
}
-void Speech::speak(QString command, bool stdIn, const QString &text, const QString &language, int encoding, QTextCodec *codec) {
+void Speech::speak(TQString command, bool stdIn, const TQString &text, const TQString &language, int encoding, TQTextCodec *codec) {
if (text.length () > 0) {
// 1. prepare the text:
// 1.a) encode the text
- QTextStream ts (encText, IO_WriteOnly);
+ TQTextStream ts (encText, IO_WriteOnly);
if (encoding == Local)
- ts.setEncoding (QTextStream::Locale);
+ ts.setEncoding (TQTextStream::Locale);
else if (encoding == Latin1)
- ts.setEncoding (QTextStream::Latin1);
+ ts.setEncoding (TQTextStream::Latin1);
else if (encoding == Unicode)
- ts.setEncoding (QTextStream::Unicode);
+ ts.setEncoding (TQTextStream::Unicode);
else
ts.setCodec (codec);
ts << text;
// 1.b) create a temporary file for the text
tempFile.setAutoDelete(true);
- QTextStream* fs = tempFile.textStream();
+ TQTextStream* fs = tempFile.textStream();
if (encoding == Local)
- fs->setEncoding (QTextStream::Locale);
+ fs->setEncoding (TQTextStream::Locale);
else if (encoding == Latin1)
- fs->setEncoding (QTextStream::Latin1);
+ fs->setEncoding (TQTextStream::Latin1);
else if (encoding == Unicode)
- fs->setEncoding (QTextStream::Unicode);
+ fs->setEncoding (TQTextStream::Unicode);
else
fs->setCodec (codec);
*fs << text;
*fs << endl;
- QString filename = tempFile.file()->name();
+ TQString filename = tempFile.file()->name();
tempFile.close();
// 2. prepare the command:
@@ -206,10 +206,10 @@ void Speech::speak(QString command, bool stdIn, const QString &text, const QStri
// 3. create a new process
process << command;
- connect(&process, SIGNAL(processExited(KProcess *)), this, SLOT(processExited(KProcess *)));
- connect(&process, SIGNAL(wroteStdin(KProcess *)), this, SLOT(wroteStdin(KProcess *)));
- connect(&process, SIGNAL(receivedStdout(KProcess *, char *, int)), this, SLOT(receivedStdout(KProcess *, char *, int)));
- connect(&process, SIGNAL(receivedStderr(KProcess *, char *, int)), this, SLOT(receivedStderr(KProcess *, char *, int)));
+ connect(&process, TQT_SIGNAL(processExited(KProcess *)), this, TQT_SLOT(processExited(KProcess *)));
+ connect(&process, TQT_SIGNAL(wroteStdin(KProcess *)), this, TQT_SLOT(wroteStdin(KProcess *)));
+ connect(&process, TQT_SIGNAL(receivedStdout(KProcess *, char *, int)), this, TQT_SLOT(receivedStdout(KProcess *, char *, int)));
+ connect(&process, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), this, TQT_SLOT(receivedStderr(KProcess *, char *, int)));
// 4. start the process
if (stdIn) {
@@ -225,10 +225,10 @@ void Speech::speak(QString command, bool stdIn, const QString &text, const QStri
}
void Speech::receivedStdout (KProcess *, char *buffer, int buflen) {
- kdDebug() << QString::fromLatin1(buffer, buflen) + "\n";
+ kdDebug() << TQString::fromLatin1(buffer, buflen) + "\n";
}
void Speech::receivedStderr (KProcess *, char *buffer, int buflen) {
- kdDebug() << QString::fromLatin1(buffer, buflen) + "\n";
+ kdDebug() << TQString::fromLatin1(buffer, buflen) + "\n";
}
void Speech::wroteStdin(KProcess *) {
diff --git a/kmouth/speech.h b/kmouth/speech.h
index 83c728c..11331cf 100644
--- a/kmouth/speech.h
+++ b/kmouth/speech.h
@@ -18,8 +18,8 @@
#ifndef SPEECH_H
#define SPEECH_H
-#include <qobject.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqstring.h>
#include <kprocess.h>
#include <ktempfile.h>
@@ -27,7 +27,7 @@
*@author Gunnar Schmi Dt
*/
-class Speech : public QObject {
+class Speech : public TQObject {
Q_OBJECT
public:
enum CharacterCodec {
@@ -46,7 +46,7 @@ public:
* @param stdin true if the program shall receive its data via standard input
* @param text The text that shall be spoken
*/
- void speak(QString command, bool use_stdin, const QString &text, const QString &language, int encoding, QTextCodec *codec);
+ void speak(TQString command, bool use_stdin, const TQString &text, const TQString &language, int encoding, TQTextCodec *codec);
/**
* Prepares a command for being executed. During the preparation the
@@ -54,8 +54,8 @@ public:
* @param command the command that shall be executed for speaking
* @param text the quoted text that can be inserted into the command
*/
- QString prepareCommand (QString command, const QString &text,
- const QString &filename, const QString &language);
+ TQString prepareCommand (TQString command, const TQString &text,
+ const TQString &filename, const TQString &language);
public slots:
void wroteStdin (KProcess *p);
@@ -65,7 +65,7 @@ public slots:
private:
KShellProcess process;
- QByteArray encText;
+ TQByteArray encText;
KTempFile tempFile;
};
diff --git a/kmouth/texttospeechconfigurationwidget.cpp b/kmouth/texttospeechconfigurationwidget.cpp
index f697061..f7fe16a 100644
--- a/kmouth/texttospeechconfigurationwidget.cpp
+++ b/kmouth/texttospeechconfigurationwidget.cpp
@@ -18,20 +18,20 @@
#include "texttospeechconfigurationwidget.h"
#include <kconfig.h>
-#include <qtextcodec.h>
-#include <qptrlist.h>
-#include <qlayout.h>
-#include <qwhatsthis.h>
+#include <tqtextcodec.h>
+#include <tqptrlist.h>
+#include <tqlayout.h>
+#include <tqwhatsthis.h>
#include <kcombobox.h>
#include <klocale.h>
-#include <qlabel.h>
+#include <tqlabel.h>
#include "speech.h"
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qcheckbox.h>
+#include <tqlineedit.h>
+#include <tqpushbutton.h>
+#include <tqcheckbox.h>
#include <kurlrequester.h>
-TextToSpeechConfigurationWidget::TextToSpeechConfigurationWidget (QWidget *parent, const char *name)
+TextToSpeechConfigurationWidget::TextToSpeechConfigurationWidget (TQWidget *parent, const char *name)
: texttospeechconfigurationui (parent, name)
{
ttsSystem = new TextToSpeechSystem();
@@ -44,8 +44,8 @@ TextToSpeechConfigurationWidget::~TextToSpeechConfigurationWidget() {
}
void TextToSpeechConfigurationWidget::buildCodecList () {
- QString local = i18n("Local")+" (";
- local += QTextCodec::codecForLocale()->name();
+ TQString local = i18n("Local")+" (";
+ local += TQTextCodec::codecForLocale()->name();
local += ")";
characterCodingBox->insertItem (local, Speech::Local);
characterCodingBox->insertItem (i18n("Latin1"), Speech::Latin1);
@@ -72,7 +72,7 @@ TextToSpeechSystem *TextToSpeechConfigurationWidget::getTTSSystem() const {
return ttsSystem;
}
-void TextToSpeechConfigurationWidget::readOptions (KConfig *config, const QString &langGroup) {
+void TextToSpeechConfigurationWidget::readOptions (KConfig *config, const TQString &langGroup) {
ttsSystem->readOptions (config, langGroup);
urlReq->setURL (ttsSystem->ttsCommand);
stdInButton->setChecked (ttsSystem->stdIn);
@@ -80,7 +80,7 @@ void TextToSpeechConfigurationWidget::readOptions (KConfig *config, const QStrin
useKttsd->setChecked (ttsSystem->useKttsd);
}
-void TextToSpeechConfigurationWidget::saveOptions (KConfig *config, const QString &langGroup) {
+void TextToSpeechConfigurationWidget::saveOptions (KConfig *config, const TQString &langGroup) {
ttsSystem->saveOptions (config, langGroup);
}
diff --git a/kmouth/texttospeechconfigurationwidget.h b/kmouth/texttospeechconfigurationwidget.h
index 439ae4f..a5ef3ba 100644
--- a/kmouth/texttospeechconfigurationwidget.h
+++ b/kmouth/texttospeechconfigurationwidget.h
@@ -30,13 +30,13 @@
class TextToSpeechConfigurationWidget : public texttospeechconfigurationui {
friend class TextToSpeechConfigurationDialog;
public:
- TextToSpeechConfigurationWidget(QWidget *parent, const char *name);
+ TextToSpeechConfigurationWidget(TQWidget *parent, const char *name);
~TextToSpeechConfigurationWidget();
TextToSpeechSystem *getTTSSystem() const;
- void readOptions (KConfig *config, const QString &langGroup);
- void saveOptions (KConfig *config, const QString &langGroup);
+ void readOptions (KConfig *config, const TQString &langGroup);
+ void saveOptions (KConfig *config, const TQString &langGroup);
void ok();
void cancel();
diff --git a/kmouth/texttospeechsystem.cpp b/kmouth/texttospeechsystem.cpp
index 4aeb0f9..f7f9515 100644
--- a/kmouth/texttospeechsystem.cpp
+++ b/kmouth/texttospeechsystem.cpp
@@ -17,9 +17,9 @@
#include "texttospeechsystem.h"
-#include <qregexp.h>
-#include <qtextcodec.h>
-#include <qptrlist.h>
+#include <tqregexp.h>
+#include <tqtextcodec.h>
+#include <tqptrlist.h>
#include <stdlib.h>
#include <kapplication.h>
@@ -40,18 +40,18 @@ TextToSpeechSystem::~TextToSpeechSystem() {
delete codecList;
}
-bool kttsdSay (const QString &text, const QString &language) {
+bool kttsdSay (const TQString &text, const TQString &language) {
DCOPClient *client = kapp->dcopClient();
- QByteArray data;
- QCString replyType;
- QByteArray replyData;
- QDataStream arg(data, IO_WriteOnly);
+ TQByteArray data;
+ TQCString replyType;
+ TQByteArray replyData;
+ TQDataStream arg(data, IO_WriteOnly);
arg << text << language;
- return client->call("kttsd", "KSpeech", "sayWarning(QString,QString)",
+ return client->call("kttsd", "KSpeech", "sayWarning(TQString,TQString)",
data, replyType, replyData, true);
}
-void TextToSpeechSystem::speak (const QString &text, const QString &language) {
+void TextToSpeechSystem::speak (const TQString &text, const TQString &language) {
if (text.length() > 0) {
if (useKttsd) {
if (kttsdSay(text, language))
@@ -66,13 +66,13 @@ void TextToSpeechSystem::speak (const QString &text, const QString &language) {
}
}
-void TextToSpeechSystem::readOptions (KConfig *config, const QString &langGroup) {
+void TextToSpeechSystem::readOptions (KConfig *config, const TQString &langGroup) {
config->setGroup(langGroup);
ttsCommand = config->readPathEntry("Command");
stdIn = config->readBoolEntry("StdIn", true);
useKttsd = config->readBoolEntry("useKttsd", true);
- QString codecString = config->readEntry("Codec", "Local");
+ TQString codecString = config->readEntry("Codec", "Local");
if (codecString == "Local")
codec = Speech::Local;
else if (codecString == "Latin1")
@@ -87,7 +87,7 @@ void TextToSpeechSystem::readOptions (KConfig *config, const QString &langGroup)
}
}
-void TextToSpeechSystem::saveOptions (KConfig *config, const QString &langGroup) {
+void TextToSpeechSystem::saveOptions (KConfig *config, const TQString &langGroup) {
config->setGroup(langGroup);
config->writePathEntry("Command", ttsCommand);
config->writeEntry("StdIn", stdIn);
@@ -104,10 +104,10 @@ void TextToSpeechSystem::saveOptions (KConfig *config, const QString &langGroup)
}
void TextToSpeechSystem::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);
}
diff --git a/kmouth/texttospeechsystem.h b/kmouth/texttospeechsystem.h
index fc9b018..f435585 100644
--- a/kmouth/texttospeechsystem.h
+++ b/kmouth/texttospeechsystem.h
@@ -19,9 +19,9 @@
#ifndef TEXTTOSPEECHSYSTEM_H
#define TEXTTOSPEECHSYSTEM_H
-#include <qstring.h>
-#include <qobject.h>
-#include <qptrlist.h>
+#include <tqstring.h>
+#include <tqobject.h>
+#include <tqptrlist.h>
class KConfig;
@@ -36,18 +36,18 @@ public:
TextToSpeechSystem();
~TextToSpeechSystem();
- void readOptions (KConfig *config, const QString &langGroup);
- void saveOptions (KConfig *config, const QString &langGroup);
+ void readOptions (KConfig *config, const TQString &langGroup);
+ void saveOptions (KConfig *config, const TQString &langGroup);
public slots:
- void speak (const QString &text, const QString &language);
+ void speak (const TQString &text, const TQString &language);
private:
void buildCodecList ();
- QPtrList<QTextCodec> *codecList;
+ TQPtrList<TQTextCodec> *codecList;
int codec;
- QString ttsCommand;
+ TQString ttsCommand;
bool stdIn;
bool useKttsd;
};
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;
};
}