X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSALOME_XmlHandler.cxx;h=1372b7e77efeecaebd6ca9daeaddb94b14aa77e8;hb=240603adb1c5f6a48ced8147d88af547fecaa5c8;hp=9ea21ed587a86b8bf25a2035426881bb8aa79325;hpb=e655b8190e138ccdcfce1b722fb061cea68d6a60;p=tools%2Finstall.git diff --git a/src/SALOME_XmlHandler.cxx b/src/SALOME_XmlHandler.cxx index 9ea21ed..1372b7e 100644 --- a/src/SALOME_XmlHandler.cxx +++ b/src/SALOME_XmlHandler.cxx @@ -1,10 +1,11 @@ // File : SALOME_XmlHandler.cxx // Created : Thu Dec 18 12:01:00 2002 // Author : Vadim SANDLER -// Project : PAL/SALOME -// Module : InstallWizard -// Copyright : 2004 CEA -// $Header$ +// Project : SALOME +// Module : Installation Wizard +// Copyright : 2004-2005 CEA + +#include "globals.h" #include "SALOME_XmlHandler.hxx" #include "SALOME_ProductsView.hxx" @@ -12,6 +13,10 @@ #include +bool isBoolAttributeSet( const QString& attr ) { + return ( attr == "true" || attr == "yes" || attr == "ok" || ( !attr.stripWhiteSpace().isEmpty() && attr.toInt() != 0 ) ); +} + // ================================================================ /*! * StructureParser::StructureParser @@ -67,10 +72,8 @@ bool StructureParser::startElement( const QString& /*namespaceURI*/, const QString& qName, const QXmlAttributes& attributes) { -#ifdef DEBUG - cout << qName << endl; - cout << attributes.length() << endl; -#endif + ___MESSAGE___( qName ); + ___MESSAGE___( attributes.length() ); QCheckListItem* element; if (( qName == "config" ) && ( attributes.length() > 0 ) ) { QString myVersion, myCaption, myCopyright, myLicense, myOS; @@ -101,7 +104,7 @@ bool StructureParser::startElement( const QString& /*namespaceURI*/, } } else if (( qName == "product" ) && ( attributes.length() > 0 ) && myTree && myWizard ) { - if (attributes.value( "disable" ) == "true" ) + if ( isBoolAttributeSet( attributes.value( "disable" ) ) ) return true; QString install = attributes.value( "install" ); @@ -115,6 +118,7 @@ bool StructureParser::startElement( const QString& /*namespaceURI*/, QString descr = QString::null; if ( attributes.value( "description" ) != "" ) descr = attributes.value( "description" ).stripWhiteSpace(); + bool pickUp = isBoolAttributeSet( attributes.value( "pickupenv" ) ); myWizard->setDependancies( element, Dependancies( attributes.value( "name" ), deps, @@ -122,7 +126,8 @@ bool StructureParser::startElement( const QString& /*namespaceURI*/, ( diskspace.count() > 1 ? diskspace[1].toInt() : ( diskspace.count() > 0 ? diskspace[0].toInt() : 0 ) ), attributes.value( "temporarydiskspace" ).toInt(), install, - descr ) ); + descr, + pickUp ) ); } else if (( qName == "path" ) && ( attributes.length() > 0 ) && myWizard ) { if ( myTargetDir )