From 07da6e39059e4873676f25e00095f8873a01ceb0 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 13 Mar 2020 02:59:09 +0100 Subject: [PATCH] [libcalamares] Expand instance with weight --- src/libcalamares/Settings.cpp | 3 +++ src/libcalamares/Settings.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/libcalamares/Settings.cpp b/src/libcalamares/Settings.cpp index 4dc165679..7e1c15e30 100644 --- a/src/libcalamares/Settings.cpp +++ b/src/libcalamares/Settings.cpp @@ -75,6 +75,7 @@ InstanceDescription::InstanceDescription( const QVariantMap& m ) : module( m.value( "module" ).toString() ) , id( m.value( "id" ).toString() ) , config( m.value( "config" ).toString() ) + , weight( m.value( "weight" ).toInt() ) { if ( id.isEmpty() ) { @@ -84,6 +85,8 @@ InstanceDescription::InstanceDescription( const QVariantMap& m ) { config = module + QStringLiteral( ".conf" ); } + + weight = qBound( 1, weight, 100 ); } Settings* Settings::s_instance = nullptr; diff --git a/src/libcalamares/Settings.h b/src/libcalamares/Settings.h index ce9d158e3..94474c09c 100644 --- a/src/libcalamares/Settings.h +++ b/src/libcalamares/Settings.h @@ -39,6 +39,7 @@ struct DLLEXPORT InstanceDescription QString module; ///< Module name (e.g. "welcome") QString id; ///< Id, to distinguish multiple instances (e.g. "one", for "welcome@one") QString config; ///< Config-file name (for multiple instances) + int weight; }; class DLLEXPORT Settings : public QObject