summaryrefslogtreecommitdiff
authorcniehaus <cniehaus>2003-01-12 16:16:13 (UTC)
committer cniehaus <cniehaus>2003-01-12 16:16:13 (UTC)
commitaa4f80fdc2d78bfe1c1d4cb8ec1d852115d00fc7 (patch) (side-by-side diff)
treed102e440196aea471b3ed8d0357934a1a9f2e385
parent6e7d82135cdab0190739d2ddf84cd2211d18d00b (diff)
downloadopie-aa4f80fdc2d78bfe1c1d4cb8ec1d852115d00fc7.zip
opie-aa4f80fdc2d78bfe1c1d4cb8ec1d852115d00fc7.tar.gz
opie-aa4f80fdc2d78bfe1c1d4cb8ec1d852115d00fc7.tar.bz2
Make search for only complete words working. Removing qDebug-lines. Fix a
bug (the seperator has not been loaded).
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/odict/dingwidget.cpp26
-rw-r--r--noncore/apps/odict/dingwidget.h2
-rw-r--r--noncore/apps/odict/odict.cpp6
3 files changed, 12 insertions, 22 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
@@ -35,15 +35,6 @@ 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 );
}
@@ -69,4 +60,5 @@ void DingWidget::loadDict( QString name )
}
qDebug( "loadedDict(...) ist beended" );
+ loadValues();
}
@@ -110,9 +102,10 @@ void DingWidget::loadValues()
Config cfg( "odict" );
cfg.setGroup( "Method_"+methodname );
- //trenner = cfg.readEntry( "Seperator" );
+ trenner = cfg.readEntry( "Seperator" );
}
BroswerContent DingWidget::parseInfo()
{
+ if ( isCompleteWord ) queryword = " " + queryword + " ";
QStringList search = lines.grep( queryword , isCaseSensitive );
@@ -120,9 +113,4 @@ BroswerContent DingWidget::parseInfo()
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 );
@@ -136,4 +124,10 @@ BroswerContent DingWidget::parseInfo()
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 )
{
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
@@ -30,4 +30,5 @@ class DingWidget
void setQueryWord( QString );
void setDict( QString );
+ void loadValues();
private:
@@ -41,5 +42,4 @@ class DingWidget
QString search_word;
- void loadValues();
QString queryword;
QString methodname;
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
@@ -58,4 +58,5 @@ ODict::ODict() : QMainWindow()
ding = new DingWidget();
+ ding->loadValues();
loadConfig();
@@ -111,7 +112,4 @@ void ODict::slotStartQuery()
//X {
- if ( casesens ) qDebug( "casesens = TRUE" );
- else qDebug( "casesens = FALSE" );
-
ding->setCaseSensitive( casesens );
ding->setCompleteWord( completewords );
@@ -120,8 +118,6 @@ void ODict::slotStartQuery()
if ( activated_name != ding->loadedDict() )
{
- qDebug( "ComboBox geändert" );
ding->loadDict(activated_name);
}
- else qDebug( "ComboBox war GLEICH" );
BroswerContent test = ding->setText( querystring );