Salome HOME
New version of doxygen (1.4.6) is introduced
[tools/install.git] / src / SALOME_ProductsView.cxx
index adace540898fc2230493ae32191269de03b0e801..96c3734d7943868fa234c3e3407268af8041fc66 100644 (file)
@@ -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;
+}