diff --git a/src/modules/packagechooser/PackageModel.cpp b/src/modules/packagechooser/PackageModel.cpp index f1c8b3056..55300f940 100644 --- a/src/modules/packagechooser/PackageModel.cpp +++ b/src/modules/packagechooser/PackageModel.cpp @@ -34,9 +34,7 @@ packageChooserModeNames() PackageItem::PackageItem() {} -PackageItem::PackageItem( const QString& a_id, - const QString& a_name, - const QString& a_description ) +PackageItem::PackageItem( const QString& a_id, const QString& a_name, const QString& a_description ) : id( a_id ) , name( a_name ) , description( a_description ) @@ -59,6 +57,7 @@ PackageItem::PackageItem::PackageItem( const QVariantMap& item_map ) , name( CalamaresUtils::Locale::TranslatedString( item_map, "name" ) ) , description( CalamaresUtils::Locale::TranslatedString( item_map, "description" ) ) , screenshot( CalamaresUtils::getString( item_map, "screenshot" ) ) + , packageNames( CalamaresUtils::getStringList( item_map, "packages" ) ) { if ( name.isEmpty() && id.isEmpty() ) { diff --git a/src/modules/packagechooser/PackageModel.h b/src/modules/packagechooser/PackageModel.h index 0ced3ffb3..0da0e4a53 100644 --- a/src/modules/packagechooser/PackageModel.h +++ b/src/modules/packagechooser/PackageModel.h @@ -34,6 +34,7 @@ struct PackageItem CalamaresUtils::Locale::TranslatedString name; CalamaresUtils::Locale::TranslatedString description; QPixmap screenshot; + QStringList packageNames; /// @brief Create blank PackageItem PackageItem(); @@ -50,16 +51,21 @@ struct PackageItem * @p screenshotPath, which may be a QRC path (:/path/in/qrc) or * a filesystem path, whatever QPixmap understands. */ - PackageItem( const QString& id, - const QString& name, - const QString& description, - const QString& screenshotPath ); + PackageItem( const QString& id, const QString& name, const QString& description, const QString& screenshotPath ); /** @brief Creates a PackageItem from a QVariantMap * * This is intended for use when loading PackageItems from a * configuration map. It will look up the various keys in the map * and handle translation strings as well. + * + * The following keys are used: + * - *id*: the identifier for this item; if it is the empty string + * then this is the special "no-package". + * - *name* (and *name[lang]*): for the name and its translations + * - *description* (and *description[lang]*) + * - *screenshot*: a path to a screenshot for this package + * - *packages*: a list of package names */ PackageItem( const QVariantMap& map );