X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSALOME_ProductsView.cxx;h=96c3734d7943868fa234c3e3407268af8041fc66;hb=3fc3493387b534f9e0c536de985ac0af3413ae7a;hp=adace540898fc2230493ae32191269de03b0e801;hpb=b2f455f9c32667f9adee3ae066a51d85fb94ea04;p=tools%2Finstall.git diff --git a/src/SALOME_ProductsView.cxx b/src/SALOME_ProductsView.cxx index adace54..96c3734 100644 --- a/src/SALOME_ProductsView.cxx +++ b/src/SALOME_ProductsView.cxx @@ -126,7 +126,7 @@ void ProductsView::itemActivated( QCheckListItem* item ) { * Returns true if "install binaries" is on for the item */ // ================================================================ -bool ProductsView::isBinaries( QCheckListItem* item ) +bool ProductsView::isBinaries( QCheckListItem* item ) const { if ( item->childCount() > 0 ) { QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() ); @@ -144,7 +144,7 @@ bool ProductsView::isBinaries( QCheckListItem* item ) * Returns true if "install sources" is on for the item */ // ================================================================ -bool ProductsView::isSources( QCheckListItem* item ) +bool ProductsView::isSources( QCheckListItem* item ) const { if ( item->childCount() > 0 ) { QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() ); @@ -165,7 +165,7 @@ bool ProductsView::isSources( QCheckListItem* item ) * Returns true if "use native" is on for the item */ // ================================================================ -bool ProductsView::isNative( QCheckListItem* item ) +bool ProductsView::isNative( QCheckListItem* item ) const { if ( item->childCount() > 0 ) { QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() ); @@ -183,7 +183,7 @@ bool ProductsView::isNative( QCheckListItem* item ) * Returns true if "not install" is on for the item */ // ================================================================ -bool ProductsView::isNone( QCheckListItem* item ) +bool ProductsView::isNone( QCheckListItem* item ) const { return !isBinaries( item ) && !isSources( item ) && !isNative( item ); } @@ -304,3 +304,60 @@ void ProductsView::setNone( QCheckListItem* item ) { item->setOn( false ); } } + +// ================================================================ +/*! + * ProductsView::hasBinaries + * Returns true if product supports "binaries" installation mode + */ +// ================================================================ +bool ProductsView::hasBinaries( QCheckListItem* item ) const +{ + if ( item->childCount() > 0 ) { + QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() ); + while( subItem ) { + if ( subItem->text() == tr( "install binaries" ) ) + return true; + subItem = (QCheckListItem*)( subItem->nextSibling() ); + } + } + return false; +} + +// ================================================================ +/*! + * ProductsView::hasSources + * Returns true if product supports "sources" installation mode + */ +// ================================================================ +bool ProductsView::hasSources( QCheckListItem* item ) const +{ + if ( item->childCount() > 0 ) { + QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() ); + while( subItem ) { + if ( subItem->text() == tr( "install sources" ) ) + return true; + subItem = (QCheckListItem*)( subItem->nextSibling() ); + } + } + return false; +} + +// ================================================================ +/*! + * ProductsView::hasNative + * Returns true if product supports "native" installation mode + */ +// ================================================================ +bool ProductsView::hasNative( QCheckListItem* item ) const +{ + if ( item->childCount() > 0 ) { + QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() ); + while( subItem ) { + if ( subItem->text() == tr( "use native" ) ) + return true; + subItem = (QCheckListItem*)( subItem->nextSibling() ); + } + } + return false; +}