[packagechooser] Simplify parameters

- Just pass the no-package-selected item around.
main
Adriaan de Groot 5 years ago
parent 996714dd06
commit 01c4383178

@ -164,9 +164,8 @@ PackageChooserPage::selectedPackageIds() const
} }
void void
PackageChooserPage::setIntroduction( const CalamaresUtils::Locale::TranslatedString& name, PackageChooserPage::setIntroduction( const PackageItem& item )
const CalamaresUtils::Locale::TranslatedString& description )
{ {
m_introduction.name = name; m_introduction.name = item.name;
m_introduction.description = description; m_introduction.description = item.description;
} }

@ -21,8 +21,6 @@
#include "PackageModel.h" #include "PackageModel.h"
#include "locale/TranslatableConfiguration.h"
#include <QAbstractItemModel> #include <QAbstractItemModel>
#include <QWidget> #include <QWidget>
@ -40,8 +38,7 @@ public:
void setModel( QAbstractItemModel* model ); void setModel( QAbstractItemModel* model );
/// @brief Sets the introductory (no-package-selected) texts /// @brief Sets the introductory (no-package-selected) texts
void setIntroduction( const CalamaresUtils::Locale::TranslatedString& name, void setIntroduction( const PackageItem& item );
const CalamaresUtils::Locale::TranslatedString& description );
/// @brief Is anything selected? /// @brief Is anything selected?
bool hasSelection() const; bool hasSelection() const;
/** @brief Get the list of selected ids /** @brief Get the list of selected ids

@ -288,7 +288,7 @@ PackageChooserViewStep::hookupModel()
const auto& package = m_model->packageData( i ); const auto& package = m_model->packageData( i );
if ( package.id.isEmpty() ) if ( package.id.isEmpty() )
{ {
m_widget->setIntroduction( package.name, package.description ); m_widget->setIntroduction( package );
break; break;
} }
} }

Loading…
Cancel
Save