diff --git a/src/libcalamares/PythonJob.cpp b/src/libcalamares/PythonJob.cpp index 39f500194..1fe0ae513 100644 --- a/src/libcalamares/PythonJob.cpp +++ b/src/libcalamares/PythonJob.cpp @@ -170,7 +170,8 @@ namespace Calamares { -PythonJob::PythonJob( const QString& scriptFile, +PythonJob::PythonJob( const QString& instance, + const QString& scriptFile, const QString& workingPath, const QVariantMap& moduleConfiguration, QObject* parent ) @@ -179,12 +180,18 @@ PythonJob::PythonJob( const QString& scriptFile, , m_workingPath( workingPath ) , m_description() , m_configurationMap( moduleConfiguration ) + , m_weight( (instance == QStringLiteral( "unpackfs" )) ? 8.0 : 1.0 ) { } PythonJob::~PythonJob() {} +qreal +PythonJob::getJobWeight() const +{ + return m_weight; +} QString PythonJob::prettyName() const diff --git a/src/libcalamares/PythonJob.h b/src/libcalamares/PythonJob.h index a2bdf171c..9c2b91a57 100644 --- a/src/libcalamares/PythonJob.h +++ b/src/libcalamares/PythonJob.h @@ -21,6 +21,8 @@ #include "Job.h" +#include "modulesystem/InstanceKey.h" + #include namespace CalamaresPython @@ -36,7 +38,8 @@ class PythonJob : public Job { Q_OBJECT public: - explicit PythonJob( const QString& scriptFile, + explicit PythonJob( const QString& instance, // TODO: InstanceKey + const QString& scriptFile, const QString& workingPath, const QVariantMap& moduleConfiguration = QVariantMap(), QObject* parent = nullptr ); @@ -46,6 +49,8 @@ public: QString prettyStatusMessage() const override; JobResult exec() override; + virtual qreal getJobWeight() const override; + private: friend class CalamaresPython::Helper; friend class CalamaresPython::PythonJobInterface; @@ -56,6 +61,7 @@ private: QString m_workingPath; QString m_description; QVariantMap m_configurationMap; + qreal m_weight; }; } // namespace Calamares diff --git a/src/libcalamaresui/modulesystem/PythonJobModule.cpp b/src/libcalamaresui/modulesystem/PythonJobModule.cpp index 46ec1dff1..072388cca 100644 --- a/src/libcalamaresui/modulesystem/PythonJobModule.cpp +++ b/src/libcalamaresui/modulesystem/PythonJobModule.cpp @@ -49,7 +49,7 @@ PythonJobModule::loadSelf() return; } - m_job = Calamares::job_ptr( new PythonJob( m_scriptFileName, m_workingPath, m_configurationMap ) ); + m_job = Calamares::job_ptr( new PythonJob( name(), m_scriptFileName, m_workingPath, m_configurationMap ) ); m_loaded = true; }