From aa4f80fdc2d78bfe1c1d4cb8ec1d852115d00fc7 Mon Sep 17 00:00:00 2001 From: cniehaus Date: Sun, 12 Jan 2003 16:16:13 +0000 Subject: Make search for only complete words working. Removing qDebug-lines. Fix a bug (the seperator has not been loaded). --- (limited to 'noncore/apps') 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 = ""; - QString html_footer = "
"; - QString html_table_left = ""; - QString html_table_sep = ""; - QString html_table_right = ""; 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 = ""+queryword+""; + + QString html_header = ""; + QString html_footer = "
"; + QString html_table_left = ""; + QString html_table_sep = ""; + QString html_table_right = ""; 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 @@ -29,6 +29,7 @@ class DingWidget QString loadedDict(); void setQueryWord( QString ); void setDict( QString ); + void loadValues(); private: BroswerContent parseInfo(); @@ -40,7 +41,6 @@ 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 @@ -57,6 +57,7 @@ ODict::ODict() : QMainWindow() browser_bottom = new QTextBrowser( vbox ); ding = new DingWidget(); + ding->loadValues(); loadConfig(); setCentralWidget( vbox ); @@ -110,19 +111,14 @@ void ODict::slotStartQuery() //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 ); -- cgit v0.9.0.2