diff options
Diffstat (limited to 'src/gatscon/filewidget.cpp')
-rw-r--r-- | src/gatscon/filewidget.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/gatscon/filewidget.cpp b/src/gatscon/filewidget.cpp new file mode 100644 index 0000000..b2dd09e --- /dev/null +++ b/src/gatscon/filewidget.cpp | |||
@@ -0,0 +1,39 @@ | |||
1 | #include "filewidget.h" | ||
2 | |||
3 | #include "gatstotree.h" | ||
4 | |||
5 | #include <gats/types.h> | ||
6 | #include <gats/gatsstream.h> | ||
7 | #include <bu/file.h> | ||
8 | |||
9 | using namespace Bu; | ||
10 | |||
11 | FileWidget::FileWidget( QWidget *pParent ) : | ||
12 | QWidget( pParent ) | ||
13 | { | ||
14 | setupUi( this ); | ||
15 | } | ||
16 | |||
17 | FileWidget::FileWidget( QWidget *pParent, QString sFile ) : | ||
18 | QWidget( pParent ) | ||
19 | { | ||
20 | setupUi( this ); | ||
21 | |||
22 | File fIn( sFile.toAscii().constData(), File::Read ); | ||
23 | Gats::GatsStream gsIn( fIn ); | ||
24 | Gats::Object *pObj; | ||
25 | while( (pObj = gsIn.readObject()) ) | ||
26 | { | ||
27 | QTreeWidgetItem *pNew = new QTreeWidgetItem( | ||
28 | twGats->invisibleRootItem() | ||
29 | ); | ||
30 | pNew->setText( 0, "<root>" ); | ||
31 | gatsToTree( pNew, pObj ); | ||
32 | delete pObj; | ||
33 | } | ||
34 | } | ||
35 | |||
36 | FileWidget::~FileWidget() | ||
37 | { | ||
38 | } | ||
39 | |||