Commit 14a3e10c authored by Adriaan de Groot's avatar Adriaan de Groot

[netinstall] Simplify getItemPackages

- Use convenience predicate isPackage()
- Name child->item(i) for brevity
parent 464561b4
......@@ -203,18 +203,19 @@ PackageModel::getItemPackages( PackageTreeItem* item ) const
PackageTreeItem::List selectedPackages;
for ( int i = 0; i < item->childCount(); i++ )
{
if ( item->child( i )->isSelected() == Qt::Unchecked )
auto* child = item->child( i );
if ( child->isSelected() == Qt::Unchecked )
{
continue;
}
if ( !item->child( i )->childCount() ) // package
if ( child->isPackage() ) // package
{
selectedPackages.append( item->child( i ) );
selectedPackages.append( child );
}
else
{
selectedPackages.append( getItemPackages( item->child( i ) ) );
selectedPackages.append( getItemPackages( child ) );
}
}
return selectedPackages;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment