summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/odict/dingwidget.cpp28
-rw-r--r--noncore/apps/odict/dingwidget.h2
-rw-r--r--noncore/apps/odict/odict.cpp6
3 files changed, 13 insertions, 23 deletions
diff --git a/noncore/apps/odict/dingwidget.cpp b/noncore/apps/odict/dingwidget.cpp
index 5b5d731..cfef84d 100644
--- a/noncore/apps/odict/dingwidget.cpp
+++ b/noncore/apps/odict/dingwidget.cpp
@@ -33,19 +33,10 @@
DingWidget::DingWidget( )
{
methodname = QString::null;
- trenner = "::";//QString::null;
+ trenner = QString::null;
lines = 0L;
- loadValues();
-
-//X qDebug( topbrowser );
-//X qDebug( top );
-//X
-//X topbrowser = "blahbalh";
-//X
-//X qDebug( topbrowser );
-//X qDebug( top );
}
void DingWidget::loadDict( QString name )
{
@@ -67,8 +58,9 @@ void DingWidget::loadDict( QString name )
}
file.close();
}
qDebug( "loadedDict(...) ist beended" );
+ loadValues();
}
QString DingWidget::loadedDict()
{
@@ -107,24 +99,20 @@ BroswerContent DingWidget::setText( QString word )
void DingWidget::loadValues()
{
Config cfg( "odict" );
- cfg.setGroup( "Method_"+methodname );
- //trenner = cfg.readEntry( "Seperator" );
+ cfg.setGroup( "Method_" + methodname );
+ trenner = cfg.readEntry( "Seperator" );
}
BroswerContent DingWidget::parseInfo()
{
+ if ( isCompleteWord ) queryword = " " + queryword + " ";
QStringList search = lines.grep( queryword , isCaseSensitive );
QString current;
QString left;
QString right;
- QString html_header = "<html><table>";
- QString html_footer = "</table></html>";
- QString html_table_left = "<tr><td width='50'>";
- QString html_table_sep = "</td><td>";
- QString html_table_right = "</td></tr>";
QRegExp reg_div( trenner );
QRegExp reg_word( queryword );
reg_word.setCaseSensitive( isCaseSensitive );
QStringList toplist, bottomlist;
@@ -133,8 +121,14 @@ BroswerContent DingWidget::parseInfo()
/* Dieser Block ist von Patrik. Ich versuche einen neuen
* Ansatz. Zum einen ist HTML scheiße an dieser Stelle und
* zum andern funktioniert der Code nicht so wie er sollte.
QString substitute = "<a href=''>"+queryword+"</a>";
+
+ QString html_header = "<html><table>";
+ QString html_footer = "</table></html>";
+ QString html_table_left = "<tr><td width='50'>";
+ QString html_table_sep = "</td><td>";
+ QString html_table_right = "</td></tr>";
for( QStringList::Iterator it = search.begin() ; it != search.end() ; ++it )
{
current = *it;
diff --git a/noncore/apps/odict/dingwidget.h b/noncore/apps/odict/dingwidget.h
index ba37009..74f40c9 100644
--- a/noncore/apps/odict/dingwidget.h
+++ b/noncore/apps/odict/dingwidget.h
@@ -28,8 +28,9 @@ class DingWidget
void loadDict( QString );
QString loadedDict();
void setQueryWord( QString );
void setDict( QString );
+ void loadValues();
private:
BroswerContent parseInfo();
@@ -39,9 +40,8 @@ class DingWidget
QString dictName;
QString search_word;
- void loadValues();
QString queryword;
QString methodname;
QString trenner;
};
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp
index 42604ee..78c3f90 100644
--- a/noncore/apps/odict/odict.cpp
+++ b/noncore/apps/odict/odict.cpp
@@ -56,8 +56,9 @@ ODict::ODict() : QMainWindow()
browser_top = new QTextBrowser( vbox );
browser_bottom = new QTextBrowser( vbox );
ding = new DingWidget();
+ ding->loadValues();
loadConfig();
setCentralWidget( vbox );
}
@@ -109,21 +110,16 @@ void ODict::slotStartQuery()
//X QMessageBox::warning(this,tr("No Dictionary"),tr("Please choose a dictonary") );
//X else
//X {
- if ( casesens ) qDebug( "casesens = TRUE" );
- else qDebug( "casesens = FALSE" );
-
ding->setCaseSensitive( casesens );
ding->setCompleteWord( completewords );
ding->setDict( activated_name );
if ( activated_name != ding->loadedDict() )
{
- qDebug( "ComboBox geändert" );
ding->loadDict(activated_name);
}
- else qDebug( "ComboBox war GLEICH" );
BroswerContent test = ding->setText( querystring );
browser_top->setText( test.top );