author | cniehaus <cniehaus> | 2003-01-03 18:27:56 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2003-01-03 18:27:56 (UTC) |
commit | de71690306857498edcf1036123452c7321d1588 (patch) (unidiff) | |
tree | 86aa1bf0c375fbba7eca1173c904c726e31182e6 /noncore/apps/odict/dingwidget.cpp | |
parent | 7a97cd36cbc4c1a82043cdd44c82f931e2cdbb7f (diff) | |
download | opie-de71690306857498edcf1036123452c7321d1588.zip opie-de71690306857498edcf1036123452c7321d1588.tar.gz opie-de71690306857498edcf1036123452c7321d1588.tar.bz2 |
I won't get a nobelprize for this code but at least it works
Diffstat (limited to 'noncore/apps/odict/dingwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/odict/dingwidget.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/noncore/apps/odict/dingwidget.cpp b/noncore/apps/odict/dingwidget.cpp index ff83114..c54cf56 100644 --- a/noncore/apps/odict/dingwidget.cpp +++ b/noncore/apps/odict/dingwidget.cpp | |||
@@ -7,24 +7,56 @@ | |||
7 | **************************************************************************/ | 7 | **************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * ( at your option ) any later version. * | 14 | * ( at your option ) any later version. * |
15 | * * | 15 | * * |
16 | **************************************************************************/ | 16 | **************************************************************************/ |
17 | #include "dingwidget.h" | 17 | #include "dingwidget.h" |
18 | 18 | ||
19 | #include <qfile.h> | ||
19 | #include <qpe/config.h> | 20 | #include <qpe/config.h> |
20 | #include <qhbox.h> | 21 | #include <qhbox.h> |
21 | #include <qlabel.h> | 22 | #include <qlabel.h> |
22 | #include <qpushbutton.h> | 23 | #include <qpushbutton.h> |
23 | #include <qlineedit.h> | 24 | #include <qlineedit.h> |
24 | #include <qmainwindow.h> | 25 | #include <qmainwindow.h> |
25 | #include <qstring.h> | 26 | #include <qstring.h> |
27 | #include <qtextstream.h> | ||
28 | #include <qstringlist.h> | ||
29 | #include <qregexp.h> | ||
30 | #include <qtextbrowser.h> | ||
26 | 31 | ||
27 | DingWidget::DingWidget() : QWidget() | 32 | DingWidget::DingWidget(QWidget *parent, QString word, QTextBrowser *browser) : QWidget(parent) |
28 | { | 33 | { |
34 | QFile file( "/home/carsten/opie/opie/noncore/apps/odict/eng_ita.dic" ); | ||
35 | QStringList lines; | ||
36 | |||
37 | if( file.open( IO_ReadOnly ) ) | ||
38 | { | ||
39 | QTextStream stream( &file ); | ||
40 | while ( !stream.eof() ) | ||
41 | { | ||
42 | lines.append( stream.readLine() ); | ||
43 | } | ||
44 | file.close(); | ||
45 | } | ||
46 | |||
47 | lines = lines.grep( word ); | ||
48 | |||
49 | //X for( QStringList::Iterator it = lines.begin() ; it != lines.end() ; ++it ) | ||
50 | //X { | ||
51 | //X qDebug( *it ); | ||
52 | //X } | ||
53 | browser->setText( parseInfo( lines ) ); | ||
29 | } | 54 | } |
30 | 55 | ||
56 | QString DingWidget::parseInfo( QStringList &lines ) | ||
57 | { | ||
58 | QString parsed = 0; | ||
59 | QStringList temp = lines; | ||
60 | parsed = temp.first(); | ||
61 | return parsed; | ||
62 | } | ||