From b074696ac1a51dbf237ab5994b94e90f32a209a6 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 10 Mar 2020 12:38:11 -0500 Subject: [PATCH] [netinstall] isCritical is const after construction --- src/modules/netinstall/PackageModel.cpp | 8 ++++---- src/modules/netinstall/PackageTreeItem.cpp | 6 ------ src/modules/netinstall/PackageTreeItem.h | 1 - 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/modules/netinstall/PackageModel.cpp b/src/modules/netinstall/PackageModel.cpp index 97c105ade..f51203944 100644 --- a/src/modules/netinstall/PackageModel.cpp +++ b/src/modules/netinstall/PackageModel.cpp @@ -234,6 +234,10 @@ PackageModel::setupModelData( const YAML::Node& data, PackageTreeItem* parent ) { itemData.postScript = CalamaresUtils::yamlToVariant( itemDefinition[ "post-install" ] ).toString(); } + if ( itemDefinition[ "critical" ] ) + { + itemData.isCritical = CalamaresUtils::yamlToVariant( itemDefinition[ "critical" ] ).toBool(); + } PackageTreeItem* item = new PackageTreeItem( itemData, parent ); if ( itemDefinition[ "selected" ] ) @@ -249,10 +253,6 @@ PackageModel::setupModelData( const YAML::Node& data, PackageTreeItem* parent ) item->setHidden( CalamaresUtils::yamlToVariant( itemDefinition[ "hidden" ] ).toBool() ); } - if ( itemDefinition[ "critical" ] ) - { - item->setCritical( CalamaresUtils::yamlToVariant( itemDefinition[ "critical" ] ).toBool() ); - } if ( itemDefinition[ "packages" ] ) for ( YAML::const_iterator packageIt = itemDefinition[ "packages" ].begin(); diff --git a/src/modules/netinstall/PackageTreeItem.cpp b/src/modules/netinstall/PackageTreeItem.cpp index 7a6a68f7b..3a67a2682 100644 --- a/src/modules/netinstall/PackageTreeItem.cpp +++ b/src/modules/netinstall/PackageTreeItem.cpp @@ -217,12 +217,6 @@ PackageTreeItem::isCritical() const return m_data.isCritical; } -void -PackageTreeItem::setCritical( bool isCritical ) -{ - m_data.isCritical = isCritical; -} - Qt::CheckState PackageTreeItem::isSelected() const { diff --git a/src/modules/netinstall/PackageTreeItem.h b/src/modules/netinstall/PackageTreeItem.h index cda1611b6..cee89727d 100644 --- a/src/modules/netinstall/PackageTreeItem.h +++ b/src/modules/netinstall/PackageTreeItem.h @@ -79,7 +79,6 @@ public: bool hiddenSelected() const; bool isCritical() const; - void setCritical( bool isCritical ); Qt::CheckState isSelected() const; void setSelected( Qt::CheckState isSelected );