From bc4ffce3a17dc48022efd55b437ea18d9719e7a0 Mon Sep 17 00:00:00 2001 From: Kyle Robertze Date: Sat, 4 Feb 2017 13:36:20 +0200 Subject: [PATCH] Made packages optional A group can now contain only subgroups. Thus packages can be categorized through sub-categories such as Internet->Web Browsers->firefox --- src/modules/netinstall/PackageModel.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/netinstall/PackageModel.cpp b/src/modules/netinstall/PackageModel.cpp index 2c07a55d0..629133c86 100644 --- a/src/modules/netinstall/PackageModel.cpp +++ b/src/modules/netinstall/PackageModel.cpp @@ -231,10 +231,11 @@ PackageModel::setupModelData( const YAML::Node& data, PackageTreeItem* parent ) item->setCritical( CalamaresUtils::yamlToVariant( itemDefinition["critical"] ).toBool() ); - for ( YAML::const_iterator packageIt = itemDefinition["packages"].begin(); - packageIt != itemDefinition["packages"].end(); ++packageIt ) - item->appendChild( - new PackageTreeItem( CalamaresUtils::yamlToVariant( *packageIt ).toString(), item ) ); + 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 );