author | cniehaus <cniehaus> | 2003-01-12 16:16:13 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2003-01-12 16:16:13 (UTC) |
commit | aa4f80fdc2d78bfe1c1d4cb8ec1d852115d00fc7 (patch) (unidiff) | |
tree | d102e440196aea471b3ed8d0357934a1a9f2e385 /noncore/apps/odict/dingwidget.cpp | |
parent | 6e7d82135cdab0190739d2ddf84cd2211d18d00b (diff) | |
download | opie-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) (show whitespace changes)
-rw-r--r-- | noncore/apps/odict/dingwidget.cpp | 26 |
1 files changed, 10 insertions, 16 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 @@ | |||
34 | DingWidget::DingWidget( ) | 34 | DingWidget::DingWidget( ) |
35 | { | 35 | { |
36 | methodname = QString::null; | 36 | methodname = QString::null; |
37 | trenner = "::";//QString::null; | 37 | trenner = QString::null; |
38 | lines = 0L; | 38 | lines = 0L; |
39 | loadValues(); | ||
40 | |||
41 | //X qDebug( topbrowser ); | ||
42 | //X qDebug( top ); | ||
43 | //X | ||
44 | //X topbrowser = "blahbalh"; | ||
45 | //X | ||
46 | //X qDebug( topbrowser ); | ||
47 | //X qDebug( top ); | ||
48 | } | 39 | } |
49 | 40 | ||
50 | void DingWidget::loadDict( QString name ) | 41 | void DingWidget::loadDict( QString name ) |
@@ -68,6 +59,7 @@ void DingWidget::loadDict( QString name ) | |||
68 | file.close(); | 59 | file.close(); |
69 | } | 60 | } |
70 | qDebug( "loadedDict(...) ist beended" ); | 61 | qDebug( "loadedDict(...) ist beended" ); |
62 | loadValues(); | ||
71 | } | 63 | } |
72 | 64 | ||
73 | QString DingWidget::loadedDict() | 65 | QString DingWidget::loadedDict() |
@@ -109,21 +101,17 @@ void DingWidget::loadValues() | |||
109 | { | 101 | { |
110 | Config cfg( "odict" ); | 102 | Config cfg( "odict" ); |
111 | cfg.setGroup( "Method_"+methodname ); | 103 | cfg.setGroup( "Method_"+methodname ); |
112 | //trenner = cfg.readEntry( "Seperator" ); | 104 | trenner = cfg.readEntry( "Seperator" ); |
113 | } | 105 | } |
114 | 106 | ||
115 | BroswerContent DingWidget::parseInfo() | 107 | BroswerContent DingWidget::parseInfo() |
116 | { | 108 | { |
109 | if ( isCompleteWord ) queryword = " " + queryword + " "; | ||
117 | QStringList search = lines.grep( queryword , isCaseSensitive ); | 110 | QStringList search = lines.grep( queryword , isCaseSensitive ); |
118 | 111 | ||
119 | QString current; | 112 | QString current; |
120 | QString left; | 113 | QString left; |
121 | QString right; | 114 | QString right; |
122 | QString html_header = "<html><table>"; | ||
123 | QString html_footer = "</table></html>"; | ||
124 | QString html_table_left = "<tr><td width='50'>"; | ||
125 | QString html_table_sep = "</td><td>"; | ||
126 | QString html_table_right = "</td></tr>"; | ||
127 | QRegExp reg_div( trenner ); | 115 | QRegExp reg_div( trenner ); |
128 | QRegExp reg_word( queryword ); | 116 | QRegExp reg_word( queryword ); |
129 | reg_word.setCaseSensitive( isCaseSensitive ); | 117 | reg_word.setCaseSensitive( isCaseSensitive ); |
@@ -135,6 +123,12 @@ BroswerContent DingWidget::parseInfo() | |||
135 | * zum andern funktioniert der Code nicht so wie er sollte. | 123 | * zum andern funktioniert der Code nicht so wie er sollte. |
136 | QString substitute = "<a href=''>"+queryword+"</a>"; | 124 | QString substitute = "<a href=''>"+queryword+"</a>"; |
137 | 125 | ||
126 | QString html_header = "<html><table>"; | ||
127 | QString html_footer = "</table></html>"; | ||
128 | QString html_table_left = "<tr><td width='50'>"; | ||
129 | QString html_table_sep = "</td><td>"; | ||
130 | QString html_table_right = "</td></tr>"; | ||
131 | |||
138 | for( QStringList::Iterator it = search.begin() ; it != search.end() ; ++it ) | 132 | for( QStringList::Iterator it = search.begin() ; it != search.end() ; ++it ) |
139 | { | 133 | { |
140 | current = *it; | 134 | current = *it; |