- if ( item->childCount() > 0 ) {
- QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() );
- while( subItem ) {
- if ( subItem->isOn() )
- return subItem->text() == tr( "install sources" );
- subItem = (QCheckListItem*)( subItem->nextSibling() );
- }
- }
- else {
- return item->isOn();
- }
- return false;
-}
-// ================================================================
-/*!
- * ProductsView::isNative
- * Returns true if "use native" is on for the item
- */
-// ================================================================
-bool ProductsView::isNative( QCheckListItem* item )
-{
- if ( item->childCount() > 0 ) {
- QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() );
- while( subItem ) {
- if ( subItem->isOn() )
- return subItem->text() == tr( "use native" );
- subItem = (QCheckListItem*)( subItem->nextSibling() );
- }
- }
- return false;
-}
-// ================================================================
-/*!
- * ProductsView::isNone
- * Returns true if "not install" is on for the item
- */
-// ================================================================
-bool ProductsView::isNone( QCheckListItem* item )
-{
- return !isBinaries( item ) && !isSources( item ) && !isNative( item );
-}
-// ================================================================
-/*!
- * ProductsView::setBinaries
- * Sets "install binaries" on for the item; if "binaries" item
- * is absent, set "install sources" on if it is present
- */
-// ================================================================
-void ProductsView::setBinaries( QCheckListItem* item ) {
- if ( item->childCount() > 0 ) {
- QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() );
- QCheckListItem* srcItem = 0;
- QCheckListItem* nativeItem = 0;
- while( subItem ) {
- if ( subItem->text() == tr( "install sources" ) )
- srcItem = subItem;
- if ( subItem->text() == tr( "use native" ) )
- nativeItem = subItem;
- if ( subItem->text() == tr( "install binaries" ) ) {
- subItem->setOn( true );
- return;
- }
- subItem = (QCheckListItem*)( subItem->nextSibling() );
- }
- if ( nativeItem ) // prefer native item
- nativeItem->setOn( true );
- else if ( srcItem )
- srcItem->setOn( true );
- }
- else {
- item->setOn( true );
- }
-}
-// ================================================================
-/*!
- * ProductsView::setSources
- * Sets "install sources" on for the item; if "sources" item
- * is absent, set "install binaries" on if it is present
- */
-// ================================================================
-void ProductsView::setSources( QCheckListItem* item ) {
- if ( item->childCount() > 0 ) {
- QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() );
- QCheckListItem* binItem = 0;
- QCheckListItem* nativeItem = 0;
- while( subItem ) {
- if ( subItem->text() == tr( "install binaries" ) )
- binItem = binItem;
- if ( subItem->text() == tr( "use native" ) )
- nativeItem = subItem;
- if ( subItem->text() == tr( "install sources" ) ) {
- subItem->setOn( true );
- return;
- }
- subItem = (QCheckListItem*)( subItem->nextSibling() );
- }
- if ( nativeItem ) // prefer native item
- nativeItem->setOn( true );
- else if ( binItem )
- binItem->setOn( true );
- }
- else {
- item->setOn( true );
- }
-}
-// ================================================================
-/*!
- * ProductsView::setNative
- * Sets "use native" on for the item; if "sources" item
- * is absent, set "install binaries" on if it is present
- */
-// ================================================================
-void ProductsView::setNative( QCheckListItem* item ) {
- if ( item->childCount() > 0 ) {
- QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() );
- QCheckListItem* binItem = 0;
- QCheckListItem* srcItem = 0;
- while( subItem ) {
- if ( subItem->text() == tr( "install binaries" ) )
- binItem = binItem;
- if ( subItem->text() == tr( "install sources" ) )
- srcItem = subItem;
- if ( subItem->text() == tr( "use native" ) ) {
- subItem->setOn( true );
- return;
- }
- subItem = (QCheckListItem*)( subItem->nextSibling() );
- }
- if ( binItem ) // prefer binaries
- binItem->setOn( true );
- else if ( srcItem )
- srcItem->setOn( true );
- }
- else {
- item->setOn( true );
- }
-}
-// ================================================================
-/*!
- * ProductsView::setNone
- * Sets "not install" on for the item
- */
-// ================================================================
-void ProductsView::setNone( QCheckListItem* item ) {
- if ( item->childCount() > 0 ) {
- QCheckListItem* subItem = (QCheckListItem*)( item->firstChild() );
- while( subItem ) {
- if ( subItem->text() == tr( "not install" ) ) {
- subItem->setOn( true );
- return;
- }
- subItem = (QCheckListItem*)( subItem->nextSibling() );
- }
- }
- else {
- item->setOn( false );