Diffstat (limited to 'noncore/apps/odict/dingwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/odict/dingwidget.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/apps/odict/dingwidget.cpp b/noncore/apps/odict/dingwidget.cpp index 5c4b13b..abb5e75 100644 --- a/noncore/apps/odict/dingwidget.cpp +++ b/noncore/apps/odict/dingwidget.cpp | |||
@@ -19,39 +19,38 @@ | |||
19 | #include <qfile.h> | 19 | #include <qfile.h> |
20 | #include <qpe/config.h> | 20 | #include <qpe/config.h> |
21 | #include <qhbox.h> | 21 | #include <qhbox.h> |
22 | #include <qlabel.h> | 22 | #include <qlabel.h> |
23 | #include <qpushbutton.h> | 23 | #include <qpushbutton.h> |
24 | #include <qlineedit.h> | 24 | #include <qlineedit.h> |
25 | #include <qmainwindow.h> | 25 | #include <qmainwindow.h> |
26 | #include <qstring.h> | 26 | #include <qstring.h> |
27 | #include <qtextstream.h> | 27 | #include <qtextstream.h> |
28 | #include <qstringlist.h> | 28 | #include <qstringlist.h> |
29 | #include <qregexp.h> | 29 | #include <qregexp.h> |
30 | #include <qtextbrowser.h> | 30 | #include <qtextbrowser.h> |
31 | #include <stdlib.h> // for getenv | 31 | //#include <stdlib.h> // for getenv |
32 | 32 | ||
33 | DingWidget::DingWidget( ) | 33 | DingWidget::DingWidget( ) |
34 | { | 34 | { |
35 | methodname = QString::null; | 35 | methodname = QString::null; |
36 | trenner = QString::null; | 36 | trenner = QString::null; |
37 | lines = 0L; | 37 | lines = 0L; |
38 | } | 38 | } |
39 | 39 | ||
40 | void DingWidget::loadDict( QString name ) | 40 | void DingWidget::loadDict( QString name ) |
41 | { | 41 | { |
42 | dictName = name; | 42 | dictName = name; |
43 | QString opie_dir = getenv("OPIEDIR"); | ||
44 | |||
45 | Config cfg( "odict" ); | 43 | Config cfg( "odict" ); |
44 | if ( !methodname ) return; | ||
46 | cfg.setGroup( "Method_" + methodname ); | 45 | cfg.setGroup( "Method_" + methodname ); |
47 | QFile file( cfg.readEntry( "file" ) ); | 46 | QFile file( cfg.readEntry( "file" ) ); |
48 | 47 | ||
49 | if( file.open( IO_ReadOnly ) ) | 48 | if( file.open( IO_ReadOnly ) ) |
50 | { | 49 | { |
51 | QTextStream stream( &file ); | 50 | QTextStream stream( &file ); |
52 | while ( !stream.eof() ) | 51 | while ( !stream.eof() ) |
53 | { | 52 | { |
54 | lines.append( stream.readLine() ); | 53 | lines.append( stream.readLine() ); |
55 | } | 54 | } |
56 | file.close(); | 55 | file.close(); |
57 | } | 56 | } |
@@ -77,24 +76,25 @@ void DingWidget::setCompleteWord( bool cword ) | |||
77 | { | 76 | { |
78 | isCompleteWord = cword; | 77 | isCompleteWord = cword; |
79 | } | 78 | } |
80 | 79 | ||
81 | void DingWidget::setQueryWord( QString qword ) | 80 | void DingWidget::setQueryWord( QString qword ) |
82 | { | 81 | { |
83 | queryword = qword; | 82 | queryword = qword; |
84 | } | 83 | } |
85 | 84 | ||
86 | 85 | ||
87 | void DingWidget::loadValues() | 86 | void DingWidget::loadValues() |
88 | { | 87 | { |
88 | if ( !methodname ) return; | ||
89 | Config cfg( "odict" ); | 89 | Config cfg( "odict" ); |
90 | cfg.setGroup( "Method_" + methodname ); | 90 | cfg.setGroup( "Method_" + methodname ); |
91 | trenner = cfg.readEntry( "Seperator" ); | 91 | trenner = cfg.readEntry( "Seperator" ); |
92 | } | 92 | } |
93 | 93 | ||
94 | BroswerContent DingWidget::setText( QString word ) | 94 | BroswerContent DingWidget::setText( QString word ) |
95 | { | 95 | { |
96 | queryword = word; | 96 | queryword = word; |
97 | return parseInfo(); | 97 | return parseInfo(); |
98 | } | 98 | } |
99 | 99 | ||
100 | 100 | ||