-rw-r--r-- | noncore/apps/odict/dingwidget.cpp | 30 | ||||
-rw-r--r-- | noncore/apps/odict/odict.cpp | 37 |
2 files changed, 15 insertions, 52 deletions
diff --git a/noncore/apps/odict/dingwidget.cpp b/noncore/apps/odict/dingwidget.cpp index ed67abf..55a716d 100644 --- a/noncore/apps/odict/dingwidget.cpp +++ b/noncore/apps/odict/dingwidget.cpp | |||
@@ -34,13 +34,10 @@ void DingWidget::loadDict( QString name ) | |||
34 | { | 34 | { |
35 | qDebug( "bin in DingWidget::loadDict(). name ist:" ); | 35 | lines.clear(); //as we will load a new list we have to |
36 | qDebug( name ); | 36 | //remove the old one |
37 | qDebug( "DingWidget::loadDict( ... )" ); | ||
37 | 38 | ||
38 | dictName = name; | ||
39 | Config cfg( "odict" ); | 39 | Config cfg( "odict" ); |
40 | if ( !methodname ) { return; } | 40 | cfg.setGroup( "Method_" + name ); |
41 | cfg.setGroup( "Method_" + methodname ); | ||
42 | QFile file( cfg.readEntry( "file" ) ); | 41 | QFile file( cfg.readEntry( "file" ) ); |
43 | 42 | ||
44 | qDebug( cfg.readEntry( "file" ) ); | ||
45 | |||
46 | if( file.open( IO_ReadOnly ) ) | 43 | if( file.open( IO_ReadOnly ) ) |
@@ -55,3 +52,2 @@ void DingWidget::loadDict( QString name ) | |||
55 | loadValues(); | 52 | loadValues(); |
56 | |||
57 | } | 53 | } |
@@ -73,7 +69,2 @@ void DingWidget::setDict( QString dict ) | |||
73 | 69 | ||
74 | void DingWidget::setCompleteWord( bool cword ) | ||
75 | { | ||
76 | isCompleteWord = cword; | ||
77 | } | ||
78 | |||
79 | void DingWidget::setQueryWord( QString qword ) | 70 | void DingWidget::setQueryWord( QString qword ) |
@@ -103,11 +94,7 @@ BroswerContent DingWidget::parseInfo() | |||
103 | { | 94 | { |
104 | qDebug( "bin in DingWidget::parseInfo()" ); | ||
105 | |||
106 | if ( isCompleteWord ) | ||
107 | queryword = " " + queryword + " "; | ||
108 | QStringList search = lines.grep( queryword , isCaseSensitive ); | 95 | QStringList search = lines.grep( queryword , isCaseSensitive ); |
109 | 96 | ||
110 | QString current; | 97 | QString current; |
111 | QString left; | 98 | QString left; |
112 | QString right; | 99 | QString right; |
113 | QRegExp reg_div( trenner ); | 100 | QRegExp reg_div( trenner ); |
@@ -141,4 +128,5 @@ BroswerContent DingWidget::parseInfo() | |||
141 | s_strings.bottom = bottomlist.join( "<br>" ); | 128 | s_strings.bottom = bottomlist.join( "<br>" ); |
142 | 129 | ||
143 | return s_strings; | 130 | return s_strings; |
144 | } | 131 | } |
132 | |||
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp index 0745f53..c1de6ac 100644 --- a/noncore/apps/odict/odict.cpp +++ b/noncore/apps/odict/odict.cpp | |||
@@ -24,3 +24,2 @@ | |||
24 | #include <qmessagebox.h> | 24 | #include <qmessagebox.h> |
25 | #include <qpe/config.h> | ||
26 | #include <qhbox.h> | 25 | #include <qhbox.h> |
@@ -37,3 +36,3 @@ | |||
37 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
38 | 37 | #include <qpe/config.h> | |
39 | 38 | ||
@@ -65,3 +64,3 @@ ODict::ODict() : QMainWindow() | |||
65 | ding->loadValues(); | 64 | ding->loadValues(); |
66 | 65 | ||
67 | loadConfig(); | 66 | loadConfig(); |
@@ -81,3 +80,2 @@ void ODict::loadConfig() | |||
81 | regexp = cfg.readEntry( "regexp" ).toInt(); | 80 | regexp = cfg.readEntry( "regexp" ).toInt(); |
82 | completewords = cfg.readEntry( "completewords" ).toInt(); | ||
83 | 81 | ||
@@ -111,2 +109,3 @@ void ODict::loadConfig() | |||
111 | lookupLanguageNames( lastname ); | 109 | lookupLanguageNames( lastname ); |
110 | ding->loadDict( lastname ); | ||
112 | 111 | ||
@@ -131,3 +130,2 @@ void ODict::saveConfig() | |||
131 | cfg.writeEntry( "regexp" , regexp ); | 130 | cfg.writeEntry( "regexp" , regexp ); |
132 | cfg.writeEntry( "completewords" , completewords ); | ||
133 | cfg.writeEntry( "lastdict" , query_co->currentText() ); | 131 | cfg.writeEntry( "lastdict" , query_co->currentText() ); |
@@ -137,4 +135,2 @@ void ODict::slotStartQuery() | |||
137 | { | 135 | { |
138 | qDebug( "bin in slotStartQuery()" ); | ||
139 | |||
140 | QString querystring = query_le->text(); | 136 | QString querystring = query_le->text(); |
@@ -151,3 +147,3 @@ void ODict::slotStartQuery() | |||
151 | tr( "&Cancel" ), | 147 | tr( "&Cancel" ), |
152 | 0, // Define a dict choosen | 148 | 0, // Define a dict |
153 | 1 ) ) // Cancel choosen | 149 | 1 ) ) // Cancel choosen |
@@ -166,11 +162,2 @@ void ODict::slotStartQuery() | |||
166 | ding->setCaseSensitive( casesens ); | 162 | ding->setCaseSensitive( casesens ); |
167 | ding->setCompleteWord( completewords ); | ||
168 | |||
169 | qDebug( "activated_name ist:" ); | ||
170 | qDebug( activated_name ); | ||
171 | |||
172 | ding->setDict( activated_name ); | ||
173 | |||
174 | //X if ( activated_name != ding->loadedDict() ) | ||
175 | ding->loadDict(activated_name); | ||
176 | 163 | ||
@@ -178,7 +165,2 @@ void ODict::slotStartQuery() | |||
178 | 165 | ||
179 | qDebug( querystring ); | ||
180 | if ( ding->isCaseSensitive ) | ||
181 | qDebug( "ist CS"); | ||
182 | else qDebug( "kein CS" ); | ||
183 | |||
184 | browser_top->setText( test.top ); | 166 | browser_top->setText( test.top ); |
@@ -207,9 +189,2 @@ void ODict::slotSetParameter( int count ) | |||
207 | { | 189 | { |
208 | if ( completewords ) | ||
209 | completewords = false; | ||
210 | else | ||
211 | completewords = true; | ||
212 | } | ||
213 | if ( count == 2 ) | ||
214 | { | ||
215 | if ( regexp ) | 190 | if ( regexp ) |
@@ -228,4 +203,5 @@ void ODict::slotMethodChanged( const QString& methodnumber ) | |||
228 | qDebug( activated_name ); | 203 | qDebug( activated_name ); |
204 | qDebug( ding->loadedDict() ); | ||
229 | 205 | ||
230 | //X if ( activated_name != ding->loadedDict() ) | 206 | if ( activated_name != ding->loadedDict() ) |
231 | { | 207 | { |
@@ -252,3 +228,2 @@ void ODict::setupMenus() | |||
252 | parameter->insertItem( tr( "C&ase sensitive" ), 0 ,0 ); | 228 | parameter->insertItem( tr( "C&ase sensitive" ), 0 ,0 ); |
253 | parameter->insertItem( tr( "Only &complete Words" ), 1 , 1) ; | ||
254 | parameter->insertItem( tr( "Allow ®. expressions" ), 2 ); | 229 | parameter->insertItem( tr( "Allow ®. expressions" ), 2 ); |