From 74dd68ad611d15abf16a65c36a7cfd3f4492930a Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 9 Nov 2012 16:25:22 +0000 Subject: Made the repo less libbu++-centric. --- src/gatscon/gatstotree.cpp | 91 ---------------------------------------------- 1 file changed, 91 deletions(-) delete mode 100644 src/gatscon/gatstotree.cpp (limited to 'src/gatscon/gatstotree.cpp') diff --git a/src/gatscon/gatstotree.cpp b/src/gatscon/gatstotree.cpp deleted file mode 100644 index e388d5e..0000000 --- a/src/gatscon/gatstotree.cpp +++ /dev/null @@ -1,91 +0,0 @@ -#include "gatstotree.h" - -#include - -#include - -void gatsToTree( QTreeWidgetItem *p, Gats::Object *pObj ) -{ - switch( pObj->getType() ) - { - case Gats::typeInteger: - gatsToTree( p, dynamic_cast( pObj ) ); - break; - - case Gats::typeString: - gatsToTree( p, dynamic_cast( pObj ) ); - break; - - case Gats::typeFloat: - gatsToTree( p, dynamic_cast( pObj ) ); - break; - - case Gats::typeBoolean: - gatsToTree( p, dynamic_cast( pObj ) ); - break; - - case Gats::typeList: - gatsToTree( p, dynamic_cast( pObj ) ); - break; - - case Gats::typeDictionary: - gatsToTree( p, dynamic_cast( pObj ) ); - break; - - case Gats::typeNull: - gatsToTree( p, dynamic_cast( pObj ) ); - break; - } -} - -void gatsToTree( QTreeWidgetItem *p, Gats::Integer *pObj ) -{ - p->setText( 1, "int"); - p->setText( 2, QString("%1").arg( pObj->getValue() ) ); -} - -void gatsToTree( QTreeWidgetItem *p, Gats::String *pObj ) -{ - p->setText( 1, "str"); - p->setText( 2, QString("%1").arg( pObj->getStr() ) ); -} - -void gatsToTree( QTreeWidgetItem *p, Gats::Float *pObj ) -{ - p->setText( 1, "float"); - p->setText( 2, QString("%1").arg( pObj->getValue() ) ); -} - -void gatsToTree( QTreeWidgetItem *p, Gats::Boolean *pObj ) -{ - p->setText( 1, "bool"); - p->setText( 2, pObj->getValue()?"true":"false" ); -} - -void gatsToTree( QTreeWidgetItem *p, Gats::List *pObj ) -{ - p->setText( 1, "list"); - int j = 0; - for( Gats::List::iterator i = pObj->begin(); i; i++ ) - { - QTreeWidgetItem *pIt = new QTreeWidgetItem( p ); - pIt->setText( 0, QString("%1").arg( j++ ) ); - gatsToTree( pIt, *i ); - } -} - -void gatsToTree( QTreeWidgetItem *p, Gats::Dictionary *pObj ) -{ - p->setText( 1, "dict"); - for( Gats::Dictionary::iterator i = pObj->begin(); i; i++ ) - { - QTreeWidgetItem *pIt = new QTreeWidgetItem( p ); - pIt->setText( 0, QString( i.getKey().getStr() ) ); - gatsToTree( pIt, *i ); - } -} - -void gatsToTree( QTreeWidgetItem *p, Gats::Null *pObj ) -{ - p->setText( 1, "null"); -} -- cgit v1.2.3