Diffstat (limited to 'noncore/apps/odict/dingwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/odict/dingwidget.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/noncore/apps/odict/dingwidget.cpp b/noncore/apps/odict/dingwidget.cpp index 0707bfb..ed67abf 100644 --- a/noncore/apps/odict/dingwidget.cpp +++ b/noncore/apps/odict/dingwidget.cpp | |||
@@ -15,52 +15,51 @@ | |||
15 | * * | 15 | * * |
16 | **************************************************************************/ | 16 | **************************************************************************/ |
17 | #include "dingwidget.h" | 17 | #include "dingwidget.h" |
18 | 18 | ||
19 | #include <qfile.h> | 19 | #include <qfile.h> |
20 | #include <qpe/config.h> | 20 | #include <qpe/config.h> |
21 | #include <qhbox.h> | ||
22 | #include <qlabel.h> | ||
23 | #include <qpushbutton.h> | ||
24 | #include <qlineedit.h> | ||
25 | #include <qmainwindow.h> | ||
26 | #include <qstring.h> | 21 | #include <qstring.h> |
27 | #include <qtextstream.h> | 22 | #include <qtextstream.h> |
28 | #include <qstringlist.h> | 23 | #include <qstringlist.h> |
29 | #include <qregexp.h> | 24 | #include <qregexp.h> |
30 | #include <qtextbrowser.h> | ||
31 | //#include <stdlib.h> // for getenv | ||
32 | 25 | ||
33 | DingWidget::DingWidget( ) | 26 | DingWidget::DingWidget( ) |
34 | { | 27 | { |
35 | methodname = QString::null; | 28 | methodname = QString::null; |
36 | trenner = QString::null; | 29 | trenner = QString::null; |
37 | lines = 0L; | 30 | lines = 0L; |
38 | } | 31 | } |
39 | 32 | ||
40 | void DingWidget::loadDict( QString name ) | 33 | void DingWidget::loadDict( QString name ) |
41 | { | 34 | { |
35 | qDebug( "bin in DingWidget::loadDict(). name ist:" ); | ||
36 | qDebug( name ); | ||
37 | |||
42 | dictName = name; | 38 | dictName = name; |
43 | Config cfg( "odict" ); | 39 | Config cfg( "odict" ); |
44 | if ( !methodname ) return; | 40 | if ( !methodname ) { return; } |
45 | cfg.setGroup( "Method_" + methodname ); | 41 | cfg.setGroup( "Method_" + methodname ); |
46 | QFile file( cfg.readEntry( "file" ) ); | 42 | QFile file( cfg.readEntry( "file" ) ); |
43 | |||
44 | qDebug( cfg.readEntry( "file" ) ); | ||
47 | 45 | ||
48 | if( file.open( IO_ReadOnly ) ) | 46 | if( file.open( IO_ReadOnly ) ) |
49 | { | 47 | { |
50 | QTextStream stream( &file ); | 48 | QTextStream stream( &file ); |
51 | while ( !stream.eof() ) | 49 | while ( !stream.eof() ) |
52 | { | 50 | { |
53 | lines.append( stream.readLine() ); | 51 | lines.append( stream.readLine() ); |
54 | } | 52 | } |
55 | file.close(); | 53 | file.close(); |
56 | } | 54 | } |
57 | loadValues(); | 55 | loadValues(); |
56 | |||
58 | } | 57 | } |
59 | 58 | ||
60 | QString DingWidget::loadedDict() | 59 | QString DingWidget::loadedDict() const |
61 | { | 60 | { |
62 | return dictName; | 61 | return dictName; |
63 | } | 62 | } |
64 | 63 | ||
65 | void DingWidget::setCaseSensitive( bool caseS ) | 64 | void DingWidget::setCaseSensitive( bool caseS ) |
66 | { | 65 | { |
@@ -99,12 +98,14 @@ BroswerContent DingWidget::setText( QString word ) | |||
99 | return parseInfo(); | 98 | return parseInfo(); |
100 | } | 99 | } |
101 | 100 | ||
102 | 101 | ||
103 | BroswerContent DingWidget::parseInfo() | 102 | BroswerContent DingWidget::parseInfo() |
104 | { | 103 | { |
104 | qDebug( "bin in DingWidget::parseInfo()" ); | ||
105 | |||
105 | if ( isCompleteWord ) | 106 | if ( isCompleteWord ) |
106 | queryword = " " + queryword + " "; | 107 | queryword = " " + queryword + " "; |
107 | QStringList search = lines.grep( queryword , isCaseSensitive ); | 108 | QStringList search = lines.grep( queryword , isCaseSensitive ); |
108 | 109 | ||
109 | QString current; | 110 | QString current; |
110 | QString left; | 111 | QString left; |