summaryrefslogtreecommitdiff
path: root/noncore/apps/odict/dingwidget.cpp
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 /noncore/apps/odict/dingwidget.cpp
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 (limited to 'noncore/apps/odict/dingwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/odict/dingwidget.cpp28
1 files changed, 11 insertions, 17 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
@@ -34,17 +34,8 @@
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 )
@@ -68,6 +59,7 @@ void DingWidget::loadDict( QString name )
file.close();
}
qDebug( "loadedDict(...) ist beended" );
+ loadValues();
}
QString DingWidget::loadedDict()
@@ -108,22 +100,18 @@ 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 );
@@ -134,6 +122,12 @@ BroswerContent DingWidget::parseInfo()
* 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 )
{