summaryrefslogtreecommitdiffstats
path: root/kiten/kiten.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kiten/kiten.cpp')
-rw-r--r--kiten/kiten.cpp242
1 files changed, 121 insertions, 121 deletions
diff --git a/kiten/kiten.cpp b/kiten/kiten.cpp
index 434f02e1..5e54a9af 100644
--- a/kiten/kiten.cpp
+++ b/kiten/kiten.cpp
@@ -34,10 +34,10 @@
#include <kstandarddirs.h>
#include <kstatusbar.h>
-#include <qclipboard.h>
-#include <qregexp.h>
-#include <qtextcodec.h>
-#include <qtimer.h>
+#include <tqclipboard.h>
+#include <tqregexp.h>
+#include <tqtextcodec.h>
+#include <tqtimer.h>
#include "kiten.h"
#include "learn.h"
@@ -46,7 +46,7 @@
#include <cassert>
-TopLevel::TopLevel(QWidget *parent, const char *name) : KMainWindow(parent, name)
+TopLevel::TopLevel(TQWidget *parent, const char *name) : KMainWindow(parent, name)
{
#if KDE_VERSION > 305
setStandardToolBarMenuEnabled(true);
@@ -55,42 +55,42 @@ TopLevel::TopLevel(QWidget *parent, const char *name) : KMainWindow(parent, name
config = Config::self();
config->readConfig();
Accel = new KGlobalAccel(this);
- (void) Accel->insert("Lookup Kanji (Kanjidic)", i18n("Lookup Kanji (Kanjidic)"), i18n("Gives detailed information about Kanji currently on clipboard."), CTRL + ALT + Key_K, CTRL + ALT + Key_K, this, SLOT(kanjiSearchAccel()));
- (void) Accel->insert("Lookup English/Japanese word", i18n("Lookup English/Japanese Word"), i18n("Looks up current text on clipboard in the same way as if you used Kiten's regular search."), CTRL + ALT + Key_S, CTRL + ALT + Key_S, this, SLOT(searchAccel()));
+ (void) Accel->insert("Lookup Kanji (Kanjidic)", i18n("Lookup Kanji (Kanjidic)"), i18n("Gives detailed information about Kanji currently on clipboard."), CTRL + ALT + Key_K, CTRL + ALT + Key_K, this, TQT_SLOT(kanjiSearchAccel()));
+ (void) Accel->insert("Lookup English/Japanese word", i18n("Lookup English/Japanese Word"), i18n("Looks up current text on clipboard in the same way as if you used Kiten's regular search."), CTRL + ALT + Key_S, CTRL + ALT + Key_S, this, TQT_SLOT(searchAccel()));
Accel->readSettings(KGlobal::config());
Accel->updateConnections();
_ResultView = new ResultView(true, this, "_ResultView");
setCentralWidget(_ResultView);
- (void) KStdAction::quit(this, SLOT(close()), actionCollection());
- (void) KStdAction::print(this, SLOT(print()), actionCollection());
- (void) KStdAction::preferences(this, SLOT(slotConfigure()), actionCollection());
- KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()), actionCollection());
- (void) new KAction(i18n("&Learn"), "pencil", CTRL+Key_L, this, SLOT(createLearn()), actionCollection(), "file_learn");
- (void) new KAction(i18n("&Dictionary Editor..."), "edit", 0, this, SLOT(createEEdit()), actionCollection(), "dict_editor");
- (void) new KAction(i18n("Ra&dical Search..."), "gear", CTRL+Key_R, this, SLOT(radicalSearch()), actionCollection(), "search_radical");
- Edit = new EditAction(i18n("Search Edit"), 0, this, SLOT(search()), actionCollection(), "search_edit");
- (void) new KAction(i18n("&Clear Search Bar"), BarIcon("locationbar_erase", 16), CTRL+Key_N, Edit, SLOT(clear()), actionCollection(), "clear_search");
- (void) new KAction(i18n("S&earch"), "key_enter", 0, this, SLOT(search()), actionCollection(), "search");
- (void) new KAction(i18n("Search with &Beginning of Word"), 0, this, SLOT(searchBeginning()), actionCollection(), "search_beginning");
- (void) new KAction(i18n("Search &Anywhere"), 0, this, SLOT(searchAnywhere()), actionCollection(), "search_anywhere");
- (void) new KAction(i18n("Stro&kes"), "paintbrush", CTRL+Key_S, this, SLOT(strokeSearch()), actionCollection(), "search_stroke");
- (void) new KAction(i18n("&Grade"), "leftjust", CTRL+Key_G, this, SLOT(gradeSearch()), actionCollection(), "search_grade");
- kanjiCB = new KToggleAction(i18n("&Kanjidic"), "kanjidic", CTRL+Key_K, this, SLOT(kanjiDictChange()), actionCollection(), "kanji_toggle");
- deinfCB = new KToggleAction(i18n("&Deinflect Verbs in Regular Search"), 0, this, SLOT(kanjiDictChange()), actionCollection(), "deinf_toggle");
- comCB = new KToggleAction(i18n("&Filter Rare"), "filter", CTRL+Key_F, this, SLOT(toggleCom()), actionCollection(), "common");
- autoSearchToggle = new KToggleAction(i18n("&Automatically Search Clipboard Selections"), "find", 0, this, SLOT(kanjiDictChange()), actionCollection(), "autosearch_toggle");
- irAction = new KAction(i18n("Search &in Results"), "find", CTRL+Key_I, this, SLOT(resultSearch()), actionCollection(), "search_in_results");
- (void) KStdAction::configureToolbars(this, SLOT(configureToolBars()), actionCollection());
- addAction = new KAction(i18n("Add &Kanji to Learning List"), 0, this, SLOT(addToList()), actionCollection(), "add");
+ (void) KStdAction::quit(this, TQT_SLOT(close()), actionCollection());
+ (void) KStdAction::print(this, TQT_SLOT(print()), actionCollection());
+ (void) KStdAction::preferences(this, TQT_SLOT(slotConfigure()), actionCollection());
+ KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()), actionCollection());
+ (void) new KAction(i18n("&Learn"), "pencil", CTRL+Key_L, this, TQT_SLOT(createLearn()), actionCollection(), "file_learn");
+ (void) new KAction(i18n("&Dictionary Editor..."), "edit", 0, this, TQT_SLOT(createEEdit()), actionCollection(), "dict_editor");
+ (void) new KAction(i18n("Ra&dical Search..."), "gear", CTRL+Key_R, this, TQT_SLOT(radicalSearch()), actionCollection(), "search_radical");
+ Edit = new EditAction(i18n("Search Edit"), 0, this, TQT_SLOT(search()), actionCollection(), "search_edit");
+ (void) new KAction(i18n("&Clear Search Bar"), BarIcon("locationbar_erase", 16), CTRL+Key_N, Edit, TQT_SLOT(clear()), actionCollection(), "clear_search");
+ (void) new KAction(i18n("S&earch"), "key_enter", 0, this, TQT_SLOT(search()), actionCollection(), "search");
+ (void) new KAction(i18n("Search with &Beginning of Word"), 0, this, TQT_SLOT(searchBeginning()), actionCollection(), "search_beginning");
+ (void) new KAction(i18n("Search &Anywhere"), 0, this, TQT_SLOT(searchAnywhere()), actionCollection(), "search_anywhere");
+ (void) new KAction(i18n("Stro&kes"), "paintbrush", CTRL+Key_S, this, TQT_SLOT(strokeSearch()), actionCollection(), "search_stroke");
+ (void) new KAction(i18n("&Grade"), "leftjust", CTRL+Key_G, this, TQT_SLOT(gradeSearch()), actionCollection(), "search_grade");
+ kanjiCB = new KToggleAction(i18n("&Kanjidic"), "kanjidic", CTRL+Key_K, this, TQT_SLOT(kanjiDictChange()), actionCollection(), "kanji_toggle");
+ deinfCB = new KToggleAction(i18n("&Deinflect Verbs in Regular Search"), 0, this, TQT_SLOT(kanjiDictChange()), actionCollection(), "deinf_toggle");
+ comCB = new KToggleAction(i18n("&Filter Rare"), "filter", CTRL+Key_F, this, TQT_SLOT(toggleCom()), actionCollection(), "common");
+ autoSearchToggle = new KToggleAction(i18n("&Automatically Search Clipboard Selections"), "find", 0, this, TQT_SLOT(kanjiDictChange()), actionCollection(), "autosearch_toggle");
+ irAction = new KAction(i18n("Search &in Results"), "find", CTRL+Key_I, this, TQT_SLOT(resultSearch()), actionCollection(), "search_in_results");
+ (void) KStdAction::configureToolbars(this, TQT_SLOT(configureToolBars()), actionCollection());
+ addAction = new KAction(i18n("Add &Kanji to Learning List"), 0, this, TQT_SLOT(addToList()), actionCollection(), "add");
addAction->setEnabled(false);
- (void) new KAction(i18n("Configure &Global Shortcuts..."), "configure_shortcuts", 0, this, SLOT(configureGlobalKeys()), actionCollection(), "options_configure_keybinding");
+ (void) new KAction(i18n("Configure &Global Shortcuts..."), "configure_shortcuts", 0, this, TQT_SLOT(configureGlobalKeys()), actionCollection(), "options_configure_keybinding");
historyAction = new KListAction(i18n("&History"), 0, 0, 0, actionCollection(), "history");
- connect(historyAction, SIGNAL(activated(int)), this, SLOT(goInHistory(int)));
- backAction = KStdAction::back(this, SLOT(back()), actionCollection());
- forwardAction = KStdAction::forward(this, SLOT(forward()), actionCollection());
+ connect(historyAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(goInHistory(int)));
+ backAction = KStdAction::back(this, TQT_SLOT(back()), actionCollection());
+ forwardAction = KStdAction::forward(this, TQT_SLOT(forward()), actionCollection());
backAction->setEnabled(false);
forwardAction->setEnabled(false);
currentResult = resultHistory.end();
@@ -114,10 +114,10 @@ TopLevel::TopLevel(QWidget *parent, const char *name) : KMainWindow(parent, name
resize(600, 400);
applyMainWindowSettings(KGlobal::config(), "TopLevelWindow");
- connect(_ResultView, SIGNAL(linkClicked(const QString &)), SLOT(ressearch(const QString &)));
- connect(kapp->clipboard(), SIGNAL(selectionChanged()), this, SLOT(autoSearch()));
+ connect(_ResultView, TQT_SIGNAL(linkClicked(const TQString &)), TQT_SLOT(ressearch(const TQString &)));
+ connect(kapp->clipboard(), TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(autoSearch()));
- QTimer::singleShot(10, this, SLOT(finishInit()));
+ TQTimer::singleShot(10, this, TQT_SLOT(finishInit()));
}
TopLevel::~TopLevel()
@@ -133,21 +133,21 @@ void TopLevel::finishInit()
if (!kapp->config()->hasGroup("app"))
{
if (kanjiCB->isChecked())
- Edit->setText(QString::fromUtf8("辞"));
+ Edit->setText(TQString::fromUtf8("辞"));
else
- Edit->setText(QString::fromUtf8("辞書"));
+ Edit->setText(TQString::fromUtf8("辞書"));
search();
}
Edit->clear(); // make sure the edit is focused initially
StatusBar->message(i18n("Welcome to Kiten"));
- setCaption(QString::null);
+ setCaption(TQString::null);
}
bool TopLevel::queryClose()
{
- for (QPtrListIterator<Learn> i(learnList); *i;)
+ for (TQPtrListIterator<Learn> i(learnList); *i;)
{
(*i)->show();
if (!(*i)->closeWindow())
@@ -177,7 +177,7 @@ void TopLevel::addToList()
emit add(toAddKanji);
}
-void TopLevel::doSearch(const QString &text, QRegExp regexp)
+void TopLevel::doSearch(const TQString &text, TQRegExp regexp)
{
if (text.isEmpty())
{
@@ -215,7 +215,7 @@ void TopLevel::doSearch(const QString &text, QRegExp regexp)
readingSearch = false;
}
-void TopLevel::doSearchInResults(const QString &text, QRegExp regexp)
+void TopLevel::doSearchInResults(const TQString &text, TQRegExp regexp)
{
if (text.isEmpty())
{
@@ -257,23 +257,23 @@ void TopLevel::handleSearchResult(Dict::SearchResult results)
addAction->setEnabled(true);
- _ResultView->append(QString("<p>%1</p>").arg(i18n("HTML Entity: %1").arg(QString("&amp;#x%1;").arg(QString::number(toAddKanji.kanji().at(0).unicode(), 16))))); // show html entity
+ _ResultView->append(TQString("<p>%1</p>").arg(i18n("HTML Entity: %1").arg(TQString("&amp;#x%1;").arg(TQString::number(toAddKanji.kanji().at(0).unicode(), 16))))); // show html entity
// now show some compounds in which this kanji appears
- QString kanji = toAddKanji.kanji();
+ TQString kanji = toAddKanji.kanji();
_ResultView->addHeader(i18n("%1 in compounds").arg(kanji));
- Dict::SearchResult compounds = _Asyndeta.retrieveIndex()->search(QRegExp(kanji), kanji, true);
+ Dict::SearchResult compounds = _Asyndeta.retrieveIndex()->search(TQRegExp(kanji), kanji, true);
bool common = true;
if (compounds.count <= 0)
{
- compounds = _Asyndeta.retrieveIndex()->search(QRegExp(kanji), kanji, false);
+ compounds = _Asyndeta.retrieveIndex()->search(TQRegExp(kanji), kanji, false);
_ResultView->addHeader(i18n("(No common compounds)"), 4);
common = false;
}
- for (QValueListIterator<Dict::Entry> it = compounds.list.begin(); it != compounds.list.end(); ++it)
+ for (TQValueListIterator<Dict::Entry> it = compounds.list.begin(); it != compounds.list.end(); ++it)
{
//kdDebug() << "adding " << (*it).kanji() << endl;
_ResultView->addResult(*it, common);
@@ -282,7 +282,7 @@ void TopLevel::handleSearchResult(Dict::SearchResult results)
}
else
{
- for (QValueListIterator<Dict::Entry> it = results.list.begin(); it != results.list.end(); ++it)
+ for (TQValueListIterator<Dict::Entry> it = results.list.begin(); it != results.list.end(); ++it)
{
kapp->processEvents();
_ResultView->addKanjiResult(*it, results.common);
@@ -291,7 +291,7 @@ void TopLevel::handleSearchResult(Dict::SearchResult results)
}
else
{
- for (QValueListIterator<Dict::Entry> it = results.list.begin(); it != results.list.end(); ++it)
+ for (TQValueListIterator<Dict::Entry> it = results.list.begin(); it != results.list.end(); ++it)
{
kapp->processEvents();
_ResultView->addResult(*it, comCB->isChecked());
@@ -303,29 +303,29 @@ void TopLevel::handleSearchResult(Dict::SearchResult results)
void TopLevel::searchBeginning()
{
- QString text = Edit->text();
- QRegExp regexp;
+ TQString text = Edit->text();
+ TQRegExp regexp;
switch (Dict::textType(text))
{
case Dict::Text_Latin:
- regexp = QRegExp(QString("\\W").append(text));
+ regexp = TQRegExp(TQString("\\W").append(text));
break;
case Dict::Text_Kana:
if (kanjiCB->isChecked())
{
- regexp = QRegExp(QString("\\W").append(text));
+ regexp = TQRegExp(TQString("\\W").append(text));
}
else
{
beginningReadingSearch = true;
- regexp = QRegExp(QString("\\[").append(text));
+ regexp = TQRegExp(TQString("\\[").append(text));
}
break;
case Dict::Text_Kanji:
- regexp = QRegExp(QString("^").append(text));
+ regexp = TQRegExp(TQString("^").append(text));
}
doSearch(text, regexp);
@@ -333,7 +333,7 @@ void TopLevel::searchBeginning()
void TopLevel::searchAnywhere()
{
- doSearch(Edit->text(), QRegExp(Edit->text()));
+ doSearch(Edit->text(), TQRegExp(Edit->text()));
}
void TopLevel::resultSearch()
@@ -342,12 +342,12 @@ void TopLevel::resultSearch()
}
// called when a kanji is clicked on in result view
-void TopLevel::ressearch(const QString &text)
+void TopLevel::ressearch(const TQString &text)
{
//kdDebug() << "ressearch(" << text << endl;
if (text.startsWith("__radical:"))
{
- QString radical = text.section(":", 1, 1).right(1);
+ TQString radical = text.section(":", 1, 1).right(1);
//kdDebug() << "radical is " << radical << endl;
radicalSearch()->addRadical(radical);
return;
@@ -359,8 +359,8 @@ void TopLevel::ressearch(const QString &text)
void TopLevel::search(bool inResults)
{
- QString text = Edit->text();
- QRegExp regexp;
+ TQString text = Edit->text();
+ TQRegExp regexp;
switch (Dict::textType(text))
{
@@ -377,8 +377,8 @@ void TopLevel::search(bool inResults)
if (deinfCB->isChecked()) // deinflect
{
bool common = comCB->isChecked();
- QStringList names;
- QStringList res(_DeinfIndex.deinflect(text, names));
+ TQStringList names;
+ TQStringList res(_DeinfIndex.deinflect(text, names));
if (res.size() > 0)
{
@@ -388,19 +388,19 @@ void TopLevel::search(bool inResults)
hist.common = common;
hist.text = text;
- QStringList done;
+ TQStringList done;
res.prepend(text);
names.prepend(i18n("No deinflection"));
- QStringList::Iterator nit = names.begin();
- for (QStringList::Iterator it = res.begin(); it != res.end(); ++it, ++nit)
+ TQStringList::Iterator nit = names.begin();
+ for (TQStringList::Iterator it = res.begin(); it != res.end(); ++it, ++nit)
{
if (done.contains(*it) > 0)
continue;
//kdDebug() << "currently on deinflection " << *it << endl;
- Dict::SearchResult results = _Asyndeta.retrieveIndex()->search(QRegExp(QString("^") + (*it) + "\\W"), *it, common);
+ Dict::SearchResult results = _Asyndeta.retrieveIndex()->search(TQRegExp(TQString("^") + (*it) + "\\W"), *it, common);
if (results.count < 1) // stop if it isn't in the dictionary
continue;
@@ -433,10 +433,10 @@ void TopLevel::search(bool inResults)
void TopLevel::strokeSearch()
{
- QString strokesString;
+ TQString strokesString;
bool ok = false;
- QString text = Edit->text().stripWhiteSpace();
+ TQString text = Edit->text().stripWhiteSpace();
unsigned int strokes = text.toUInt(&ok);
if (!ok)
@@ -470,7 +470,7 @@ void TopLevel::strokeSearch()
already = true;
- strokesString.append(QString::number(i));
+ strokesString.append(TQString::number(i));
}
strokesString.append(')');
@@ -489,21 +489,21 @@ void TopLevel::strokeSearch()
}
else
{
- strokesString = QString::number(strokes);
+ strokesString = TQString::number(strokes);
}
- QRegExp regexp = QRegExp(text);
+ TQRegExp regexp = TQRegExp(text);
// must be in kanjidic mode
kanjiCB->setChecked(true);
- doSearch(QString("S%1 ").arg(strokesString), regexp);
+ doSearch(TQString("S%1 ").arg(strokesString), regexp);
}
void TopLevel::gradeSearch()
{
- QString editText = Edit->text().stripWhiteSpace();
+ TQString editText = Edit->text().stripWhiteSpace();
unsigned int grade;
if (editText.lower() == "jouyou")
@@ -519,31 +519,31 @@ void TopLevel::gradeSearch()
return;
}
- QString text = QString("G%1 ").arg(grade);
- QRegExp regexp = QRegExp(text);
+ TQString text = TQString("G%1 ").arg(grade);
+ TQRegExp regexp = TQRegExp(text);
kanjiCB->setChecked(true);
doSearch(text, regexp);
}
-QString TopLevel::clipBoardText() // gets text from clipboard for globalaccels
+TQString TopLevel::clipBoardText() // gets text from clipboard for globalaccels
{
kapp->clipboard()->setSelectionMode(true);
- QString text = kapp->clipboard()->text().stripWhiteSpace();
+ TQString text = kapp->clipboard()->text().stripWhiteSpace();
kapp->clipboard()->setSelectionMode(false);
return text;
}
-QString TopLevel::filteredClipboardText()
+TQString TopLevel::filteredClipboardText()
{
- QString newText = clipBoardText();
- QString currentText = Edit->text();
+ TQString newText = clipBoardText();
+ TQString currentText = Edit->text();
if (newText.length() < 80 && newText.find(':') < 0 && newText.find('#') < 0 && newText.find("-") != 0 && newText.find("+") < 0 && currentText.find(newText) < 0)
return newText;
else
- return QString::null;
+ return TQString::null;
}
void TopLevel::autoSearch()
@@ -554,7 +554,7 @@ void TopLevel::autoSearch()
void TopLevel::searchAccel()
{
- QString newText = filteredClipboardText();
+ TQString newText = filteredClipboardText();
if (!newText.isNull())
{
kanjiCB->setChecked(false);
@@ -568,7 +568,7 @@ void TopLevel::searchAccel()
void TopLevel::kanjiSearchAccel()
{
- QString newText = filteredClipboardText();
+ TQString newText = filteredClipboardText();
if (!newText.isNull())
{
kanjiCB->setChecked(true);
@@ -582,7 +582,7 @@ void TopLevel::kanjiSearchAccel()
void TopLevel::setResults(unsigned int results, unsigned int fullNum)
{
- QString str = i18n("%n result","%n results",results);
+ TQString str = i18n("%n result","%n results",results);
if (results < fullNum)
str += i18n(" out of %1").arg(fullNum);
@@ -609,9 +609,9 @@ void TopLevel::slotConfigure()
//ConfigureDialog didn't find an instance of this dialog, so lets create it :
optionDialog = new ConfigureDialog(this, "settings");
- connect(optionDialog, SIGNAL(hidden()),this,SLOT(slotConfigureHide()));
- connect(optionDialog, SIGNAL(settingsChanged()), this, SLOT(slotConfigurationChanged()));
- connect(optionDialog, SIGNAL(valueChanged()), this, SIGNAL(quizConfChanged()));
+ connect(optionDialog, TQT_SIGNAL(hidden()),this,TQT_SLOT(slotConfigureHide()));
+ connect(optionDialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(slotConfigurationChanged()));
+ connect(optionDialog, TQT_SIGNAL(valueChanged()), this, TQT_SIGNAL(quizConfChanged()));
optionDialog->show();
return;
@@ -625,7 +625,7 @@ void TopLevel::slotLearnConfigure()
void TopLevel::slotConfigureHide()
{
- QTimer::singleShot(0, this, SLOT(slotConfigureDestroy()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotConfigureDestroy()));
}
void TopLevel::slotConfigureDestroy()
@@ -641,11 +641,11 @@ void TopLevel::createLearn()
{
Learn *_Learn = new Learn(_Asyndeta.retrieveIndex(), 0);
- connect(_Learn, SIGNAL(destroyed(Learn *)), this, SLOT(learnDestroyed(Learn *)));
- connect(_Learn, SIGNAL(linkClicked(const QString &)), this, SLOT(ressearch(const QString &)));
- connect(_Learn, SIGNAL(configureLearn()), this, SLOT(slotLearnConfigure()));
- connect(this, SIGNAL(quizConfChanged()), _Learn, SLOT(updateQuizConfiguration()));
- connect(this, SIGNAL(add(Dict::Entry)), _Learn, SLOT(add(Dict::Entry)));
+ connect(_Learn, TQT_SIGNAL(destroyed(Learn *)), this, TQT_SLOT(learnDestroyed(Learn *)));
+ connect(_Learn, TQT_SIGNAL(linkClicked(const TQString &)), this, TQT_SLOT(ressearch(const TQString &)));
+ connect(_Learn, TQT_SIGNAL(configureLearn()), this, TQT_SLOT(slotLearnConfigure()));
+ connect(this, TQT_SIGNAL(quizConfChanged()), _Learn, TQT_SLOT(updateQuizConfiguration()));
+ connect(this, TQT_SIGNAL(add(Dict::Entry)), _Learn, TQT_SLOT(add(Dict::Entry)));
learnList.append(_Learn);
@@ -668,14 +668,14 @@ void TopLevel::kanjiDictChange()
// Do we even *need* something here?
}
-QRegExp TopLevel::readingSearchItems(bool kanji)
+TQRegExp TopLevel::readingSearchItems(bool kanji)
{
- QString text = Edit->text();
+ TQString text = Edit->text();
if (text.isEmpty()) // abandon search
- return QRegExp(); //empty
+ return TQRegExp(); //empty
//CompletionObj->addItem(text);
- QString regexp;
+ TQString regexp;
if (kanji)
regexp = " %1 ";
else
@@ -683,17 +683,17 @@ QRegExp TopLevel::readingSearchItems(bool kanji)
regexp = regexp.arg(text);
- return QRegExp(regexp, Config::caseSensitive());
+ return TQRegExp(regexp, Config::caseSensitive());
}
-QRegExp TopLevel::kanjiSearchItems(bool beginning)
+TQRegExp TopLevel::kanjiSearchItems(bool beginning)
{
- QString text = Edit->text();
+ TQString text = Edit->text();
if (text.isEmpty())
- return QRegExp(); //empty
+ return TQRegExp(); //empty
- QString regexp;
+ TQString regexp;
if (beginning)
regexp = "^%1";
else
@@ -701,17 +701,17 @@ QRegExp TopLevel::kanjiSearchItems(bool beginning)
regexp = regexp.arg(text);
- return QRegExp(regexp, Config::caseSensitive());
+ return TQRegExp(regexp, Config::caseSensitive());
}
-QRegExp TopLevel::searchItems()
+TQRegExp TopLevel::searchItems()
{
- QString regexp;
- QString text = Edit->text();
+ TQString regexp;
+ TQString text = Edit->text();
if (text.isEmpty())
- return QRegExp(); //empty
+ return TQRegExp(); //empty
- unsigned int contains = text.contains(QRegExp("[A-Za-z0-9_:]"));
+ unsigned int contains = text.contains(TQRegExp("[A-Za-z0-9_:]"));
if (Config::wholeWord() && contains == text.length())
regexp = "\\W%1\\W";
else
@@ -719,7 +719,7 @@ QRegExp TopLevel::searchItems()
regexp = regexp.arg(text);
- return QRegExp(regexp, Config::caseSensitive());
+ return TQRegExp(regexp, Config::caseSensitive());
}
void TopLevel::toggleCom()
@@ -730,7 +730,7 @@ void TopLevel::configureToolBars()
{
saveMainWindowSettings(KGlobal::config(), "TopLevelWindow");
KEditToolbar dlg(actionCollection(), "kitenui.rc");
- connect(&dlg, SIGNAL(newToolbarConfig()), SLOT(newToolBarConfig()));
+ connect(&dlg, TQT_SIGNAL(newToolbarConfig()), TQT_SLOT(newToolBarConfig()));
dlg.exec();
}
@@ -743,27 +743,27 @@ void TopLevel::newToolBarConfig()
RadWidget *TopLevel::radicalSearch()
{
RadWidget *rw = new RadWidget(&_Rad, 0, "rw");
- connect(rw, SIGNAL(set(const QStringList &, unsigned int, unsigned int)), this, SLOT(radSearch(const QStringList &, unsigned int, unsigned int)));
+ connect(rw, TQT_SIGNAL(set(const TQStringList &, unsigned int, unsigned int)), this, TQT_SLOT(radSearch(const TQStringList &, unsigned int, unsigned int)));
rw->show();
return rw;
}
-void TopLevel::radSearch(const QStringList &_list, unsigned int strokes, unsigned int errorMargin)
+void TopLevel::radSearch(const TQStringList &_list, unsigned int strokes, unsigned int errorMargin)
{
//kdDebug() << "TopLevel::radSearch\n";
- QStringList list(_Rad.kanjiByRad(_list));
+ TQStringList list(_Rad.kanjiByRad(_list));
- QStringList::iterator it;
+ TQStringList::iterator it;
Dict::SearchResult hist;
hist.count = 0;
hist.outOf = 0;
hist.common = comCB->isChecked();
- QString prettyRadicalString;
+ TQString prettyRadicalString;
bool already = false;
- for (QStringList::ConstIterator it = _list.begin(); it != _list.end(); ++it)
+ for (TQStringList::ConstIterator it = _list.begin(); it != _list.end(); ++it)
{
if (already)
prettyRadicalString.append(", ");
@@ -779,16 +779,16 @@ void TopLevel::radSearch(const QStringList &_list, unsigned int strokes, unsigne
else
hist.list.append(Dict::Entry(i18n("Kanji with radical(s) %1").arg(prettyRadicalString), true));
- QString strokesString;
+ TQString strokesString;
if (strokes)
{
- strokesString = QString::number(strokes);
+ strokesString = TQString::number(strokes);
for (unsigned i = 1; i <= errorMargin; ++i)
{
strokesString.append('|');
strokesString.prepend('|');
- strokesString.append(QString::number(strokes + i));
- strokesString.prepend(QString::number(strokes - i));
+ strokesString.append(TQString::number(strokes + i));
+ strokesString.prepend(TQString::number(strokes - i));
}
strokesString.append(')');
@@ -800,7 +800,7 @@ void TopLevel::radSearch(const QStringList &_list, unsigned int strokes, unsigne
for (it = list.begin(); it != list.end(); ++it)
{
- Dict::SearchResult results = _Asyndeta.retrieveIndex()->searchKanji(QRegExp(strokes? (QString("S%1 ").arg(strokesString)) : (QString("^") + (*it)) ), (*it), comCB->isChecked());
+ Dict::SearchResult results = _Asyndeta.retrieveIndex()->searchKanji(TQRegExp(strokes? (TQString("S%1 ").arg(strokesString)) : (TQString("^") + (*it)) ), (*it), comCB->isChecked());
hist.outOf += results.outOf;
if (results.count < 1)
@@ -851,7 +851,7 @@ void TopLevel::historySpotChanged()
void TopLevel::addHistory(Dict::SearchResult result)
{
- QStringList newHistoryList = historyAction->items();
+ TQStringList newHistoryList = historyAction->items();
// remove from back till we hit currentResult
while (resultHistory.fromLast() != currentResult)