| 
						
						
							
								
							
						
						
					 | 
				
			
			 | 
			 | 
			
				@ -21,9 +21,9 @@
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				#include "utils/Yaml.h"
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				PackageModel::PackageModel( const YAML::Node& data, QObject* parent ) :
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    QAbstractItemModel( parent ),
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    m_columnHeadings()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				PackageModel::PackageModel( const YAML::Node& data, QObject* parent )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    : QAbstractItemModel( parent )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    , m_columnHeadings()
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				{
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    m_rootItem = new PackageTreeItem();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    setupModelData( data, m_rootItem );
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -38,33 +38,47 @@ QModelIndex
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				PackageModel::index( int row, int column, const QModelIndex& parent ) const
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				{
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( !hasIndex( row, column, parent ) )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return QModelIndex();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    PackageTreeItem* parentItem;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( !parent.isValid() )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        parentItem = m_rootItem;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    else
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        parentItem = static_cast<PackageTreeItem*>( parent.internalPointer() );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        parentItem = static_cast< PackageTreeItem* >( parent.internalPointer() );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    PackageTreeItem* childItem = parentItem->child( row );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( childItem )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return createIndex( row, column, childItem );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    else
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return QModelIndex();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				QModelIndex
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				PackageModel::parent( const QModelIndex& index ) const
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				{
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( !index.isValid() )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return QModelIndex();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    PackageTreeItem* child = static_cast<PackageTreeItem*>( index.internalPointer() );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    PackageTreeItem* child = static_cast< PackageTreeItem* >( index.internalPointer() );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    PackageTreeItem* parent = child->parentItem();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( parent == m_rootItem )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return QModelIndex();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    return createIndex( parent->row(), 0, parent );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -72,13 +86,19 @@ int
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				PackageModel::rowCount( const QModelIndex& parent ) const
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				{
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( parent.column() > 0 )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return 0;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    PackageTreeItem* parentItem;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( !parent.isValid() )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        parentItem = m_rootItem;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    else
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        parentItem = static_cast<PackageTreeItem*>( parent.internalPointer() );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        parentItem = static_cast< PackageTreeItem* >( parent.internalPointer() );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    return parentItem->childCount();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				}
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -87,7 +107,9 @@ int
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				PackageModel::columnCount( const QModelIndex& parent ) const
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				{
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( parent.isValid() )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return static_cast<PackageTreeItem*>( parent.internalPointer() )->columnCount();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return static_cast< PackageTreeItem* >( parent.internalPointer() )->columnCount();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    return m_rootItem->columnCount();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -95,17 +117,25 @@ QVariant
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				PackageModel::data( const QModelIndex& index, int role ) const
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				{
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( !index.isValid() )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return QVariant();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    PackageTreeItem* item = static_cast<PackageTreeItem*>( index.internalPointer() );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    PackageTreeItem* item = static_cast< PackageTreeItem* >( index.internalPointer() );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( index.column() == 0 && role == Qt::CheckStateRole )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return item->isSelected();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( item->isHidden() && role == Qt::DisplayRole ) // Hidden group
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( item->isHidden() && role == Qt::DisplayRole )  // Hidden group
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return QVariant();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( role == Qt::DisplayRole )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return item->data( index.column() );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    return QVariant();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -114,27 +144,31 @@ PackageModel::setData( const QModelIndex& index, const QVariant& value, int role
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				{
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( role == Qt::CheckStateRole && index.isValid() )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        PackageTreeItem* item = static_cast<PackageTreeItem*>( index.internalPointer() );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        item->setSelected( static_cast<Qt::CheckState>( value.toInt() ) );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        PackageTreeItem* item = static_cast< PackageTreeItem* >( index.internalPointer() );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        item->setSelected( static_cast< Qt::CheckState >( value.toInt() ) );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        emit dataChanged( this->index( 0, 0 ), index.sibling( index.column(), index.row() + 1 ),
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                          QVector<int>( Qt::CheckStateRole ) );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        emit dataChanged( this->index( 0, 0 ),
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                          index.sibling( index.column(), index.row() + 1 ),
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                          QVector< int >( Qt::CheckStateRole ) );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    return true;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				bool
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				PackageModel::setHeaderData( int section, Qt::Orientation orientation,
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                             const QVariant& value, int role )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				PackageModel::setHeaderData( int section, Qt::Orientation orientation, const QVariant& value, int role )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				{
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    Q_UNUSED( role )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( orientation == Qt::Horizontal )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( m_columnHeadings.value( section ) != QVariant() )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            m_columnHeadings.replace( section, value );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        else
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            m_columnHeadings.insert( section, value );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        emit headerDataChanged( orientation, section, section );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    return true;
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -144,9 +178,13 @@ Qt::ItemFlags
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				PackageModel::flags( const QModelIndex& index ) const
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				{
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( !index.isValid() )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return Qt::ItemFlags();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( index.column() == 0 )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return Qt::ItemIsUserCheckable | QAbstractItemModel::flags( index );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    return QAbstractItemModel::flags( index );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -154,46 +192,55 @@ QVariant
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				PackageModel::headerData( int section, Qt::Orientation orientation, int role ) const
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				{
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    if ( orientation == Qt::Horizontal && role == Qt::DisplayRole )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        return m_columnHeadings.value( section );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    return QVariant();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				QList<PackageTreeItem::ItemData>
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				QList< PackageTreeItem::ItemData >
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				PackageModel::getPackages() const
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				{
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    QList<PackageTreeItem*> items = getItemPackages( m_rootItem );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    QList< PackageTreeItem* > items = getItemPackages( m_rootItem );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    for ( auto package : m_hiddenItems )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( package->hiddenSelected() )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            items.append( getItemPackages( package ) );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    QList<PackageTreeItem::ItemData> packages;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    QList< PackageTreeItem::ItemData > packages;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    for ( auto item : items )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        PackageTreeItem::ItemData itemData;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        itemData.preScript = item->parentItem()->preScript(); // Only groups have hooks
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        itemData.packageName = item->packageName(); // this seg faults
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        itemData.postScript = item->parentItem()->postScript(); // Only groups have hooks
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        itemData.isCritical = item->parentItem()->isCritical(); // Only groups are critical
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        itemData.preScript = item->parentItem()->preScript();  // Only groups have hooks
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        itemData.packageName = item->packageName();  // this seg faults
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        itemData.postScript = item->parentItem()->postScript();  // Only groups have hooks
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        itemData.isCritical = item->parentItem()->isCritical();  // Only groups are critical
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        packages.append( itemData );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    return packages;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				QList<PackageTreeItem*>
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				QList< PackageTreeItem* >
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				PackageModel::getItemPackages( PackageTreeItem* item ) const
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				{
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    QList<PackageTreeItem*> selectedPackages;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    QList< PackageTreeItem* > selectedPackages;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    for ( int i = 0; i < item->childCount(); i++ )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( item->child( i )->isSelected() == Qt::Unchecked )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            continue;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( !item->child( i )->childCount() ) // package
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( !item->child( i )->childCount() )  // package
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            selectedPackages.append( item->child( i ) );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        else
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            selectedPackages.append( getItemPackages( item->child( i ) ) );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    return selectedPackages;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				}
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				void
 | 
			
		
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
			
			 | 
			 | 
			
				@ -203,49 +250,49 @@ PackageModel::setupModelData( const YAML::Node& data, PackageTreeItem* parent )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				    {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        const YAML::Node itemDefinition = *it;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        QString name(
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            tr( CalamaresUtils::yamlToVariant( itemDefinition["name"] ).toByteArray() ) );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        QString description(
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            tr( CalamaresUtils::yamlToVariant( itemDefinition["description"] ).toByteArray() ) );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        QString name( tr( CalamaresUtils::yamlToVariant( itemDefinition[ "name" ] ).toByteArray() ) );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        QString description( tr( CalamaresUtils::yamlToVariant( itemDefinition[ "description" ] ).toByteArray() ) );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        PackageTreeItem::ItemData itemData;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        itemData.name = name;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        itemData.description = description;
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( itemDefinition["pre-install"] )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            itemData.preScript =
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                CalamaresUtils::yamlToVariant( itemDefinition["pre-install"] ).toString();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( itemDefinition["post-install"] )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            itemData.postScript =
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                CalamaresUtils::yamlToVariant( itemDefinition["post-install"] ).toString();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( itemDefinition[ "pre-install" ] )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            itemData.preScript = CalamaresUtils::yamlToVariant( itemDefinition[ "pre-install" ] ).toString();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( itemDefinition[ "post-install" ] )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            itemData.postScript = CalamaresUtils::yamlToVariant( itemDefinition[ "post-install" ] ).toString();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        PackageTreeItem* item = new PackageTreeItem( itemData, parent );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( itemDefinition["selected"] )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            item->setSelected(
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                CalamaresUtils::yamlToVariant( itemDefinition["selected"] ).toBool() ?
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                Qt::Checked : Qt::Unchecked );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( itemDefinition[ "selected" ] )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            item->setSelected( CalamaresUtils::yamlToVariant( itemDefinition[ "selected" ] ).toBool() ? Qt::Checked
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                                                                                                      : Qt::Unchecked );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        else
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            item->setSelected( parent->isSelected() ); // Inherit from it's parent
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            item->setSelected( parent->isSelected() );  // Inherit from it's parent
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( itemDefinition["hidden"] )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            item->setHidden(
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                CalamaresUtils::yamlToVariant( itemDefinition["hidden"] ).toBool() );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( itemDefinition[ "hidden" ] )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            item->setHidden( CalamaresUtils::yamlToVariant( itemDefinition[ "hidden" ] ).toBool() );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( itemDefinition["critical"] )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            item->setCritical(
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                CalamaresUtils::yamlToVariant( itemDefinition["critical"] ).toBool() );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( itemDefinition[ "critical" ] )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            item->setCritical( CalamaresUtils::yamlToVariant( itemDefinition[ "critical" ] ).toBool() );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( itemDefinition["packages"] )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            for ( YAML::const_iterator packageIt = itemDefinition["packages"].begin();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                    packageIt != itemDefinition["packages"].end(); ++packageIt )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( itemDefinition[ "packages" ] )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            for ( YAML::const_iterator packageIt = itemDefinition[ "packages" ].begin();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                  packageIt != itemDefinition[ "packages" ].end();
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                  ++packageIt )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                item->appendChild(
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				                    new PackageTreeItem( CalamaresUtils::yamlToVariant( *packageIt ).toString(), item ) );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( itemDefinition["subgroups"] )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            setupModelData( itemDefinition["subgroups"], item );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( itemDefinition[ "subgroups" ] )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            setupModelData( itemDefinition[ "subgroups" ], item );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        if ( item->isHidden() )
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            m_hiddenItems.append( item );
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        }
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        else
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				        {
 | 
			
		
		
	
		
			
				 | 
				 | 
			
			 | 
			 | 
			
				            item->setCheckable( true );
 | 
			
		
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
			
			 | 
			 | 
			
				
 
 |