Diffstat (limited to 'noncore/apps/odict/dingwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/odict/dingwidget.cpp | 28 |
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 @@ | |||
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() |
@@ -108,22 +100,18 @@ BroswerContent DingWidget::setText( QString word ) | |||
108 | void DingWidget::loadValues() | 100 | 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 ); |
@@ -134,6 +122,12 @@ BroswerContent DingWidget::parseInfo() | |||
134 | * Ansatz. Zum einen ist HTML scheiße an dieser Stelle und | 122 | * Ansatz. Zum einen ist HTML scheiße an dieser Stelle und |
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>"; |
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>"; | ||
137 | 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 | { |