From 01c438317840afe08cac77cd3350d247af4c6cd6 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 4 Sep 2019 19:40:35 +0200 Subject: [PATCH] [packagechooser] Simplify parameters - Just pass the no-package-selected item around. --- src/modules/packagechooser/PackageChooserPage.cpp | 7 +++---- src/modules/packagechooser/PackageChooserPage.h | 5 +---- src/modules/packagechooser/PackageChooserViewStep.cpp | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/modules/packagechooser/PackageChooserPage.cpp b/src/modules/packagechooser/PackageChooserPage.cpp index 1986cf464..1ca7b2c30 100644 --- a/src/modules/packagechooser/PackageChooserPage.cpp +++ b/src/modules/packagechooser/PackageChooserPage.cpp @@ -164,9 +164,8 @@ PackageChooserPage::selectedPackageIds() const } void -PackageChooserPage::setIntroduction( const CalamaresUtils::Locale::TranslatedString& name, - const CalamaresUtils::Locale::TranslatedString& description ) +PackageChooserPage::setIntroduction( const PackageItem& item ) { - m_introduction.name = name; - m_introduction.description = description; + m_introduction.name = item.name; + m_introduction.description = item.description; } diff --git a/src/modules/packagechooser/PackageChooserPage.h b/src/modules/packagechooser/PackageChooserPage.h index 4a1ac207b..79b9fa69c 100644 --- a/src/modules/packagechooser/PackageChooserPage.h +++ b/src/modules/packagechooser/PackageChooserPage.h @@ -21,8 +21,6 @@ #include "PackageModel.h" -#include "locale/TranslatableConfiguration.h" - #include #include @@ -40,8 +38,7 @@ public: void setModel( QAbstractItemModel* model ); /// @brief Sets the introductory (no-package-selected) texts - void setIntroduction( const CalamaresUtils::Locale::TranslatedString& name, - const CalamaresUtils::Locale::TranslatedString& description ); + void setIntroduction( const PackageItem& item ); /// @brief Is anything selected? bool hasSelection() const; /** @brief Get the list of selected ids diff --git a/src/modules/packagechooser/PackageChooserViewStep.cpp b/src/modules/packagechooser/PackageChooserViewStep.cpp index ff506117d..6fb29a4f7 100644 --- a/src/modules/packagechooser/PackageChooserViewStep.cpp +++ b/src/modules/packagechooser/PackageChooserViewStep.cpp @@ -288,7 +288,7 @@ PackageChooserViewStep::hookupModel() const auto& package = m_model->packageData( i ); if ( package.id.isEmpty() ) { - m_widget->setIntroduction( package.name, package.description ); + m_widget->setIntroduction( package ); break; } }