summaryrefslogtreecommitdiff
path: root/noncore/apps/odict/dingwidget.cpp
Unidiff
Diffstat (limited to 'noncore/apps/odict/dingwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/odict/dingwidget.cpp34
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
@@ -13,18 +13,50 @@
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
27DingWidget::DingWidget() : QWidget() 32DingWidget::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
56QString DingWidget::parseInfo( QStringList &lines )
57{
58 QString parsed = 0;
59 QStringList temp = lines;
60 parsed = temp.first();
61 return parsed;
62}