[libcalamares] Make job weights integers

This commit is contained in:
Adriaan de Groot 2020-08-12 16:08:37 +02:00
parent 73b8ecd622
commit a91ef65a37
4 changed files with 11 additions and 13 deletions

View File

@ -1,5 +1,5 @@
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
*
* SPDX-FileCopyrightText: 2014-2015 Teo Mrnjavac <teo@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
@ -101,10 +101,10 @@ Job::Job( QObject* parent )
Job::~Job() {}
qreal
int
Job::getJobWeight() const
{
return qreal( 1.0 );
return 1;
}

View File

@ -100,13 +100,19 @@ public:
/** @brief The job's (relative) weight.
*
* The default implementation returns 1.0, which gives all jobs
* The default implementation returns 1, which gives all jobs
* the same weight, so they advance the overall progress the same
* amount. This is nonsense, since some jobs take much longer than
* others; it's up to the individual jobs to say something about
* how much work is (relatively) done.
*
* Since jobs are caused by **modules** from the sequence, the
* overall weight of the module is taken into account: its weight
* is divided among the jobs based on each jobs relative weight.
* This can be used in a module that runs a bunch of jobs to indicate
* which of the jobs is "heavy" and which is not.
*/
virtual qreal getJobWeight() const;
virtual int getJobWeight() const;
/** @brief The human-readable name of this job
*
* This should be a very short statement of what the job does.

View File

@ -190,12 +190,6 @@ PythonJob::PythonJob( const ModuleSystem::InstanceKey& instance,
PythonJob::~PythonJob() {}
qreal
PythonJob::getJobWeight() const
{
return 1.0;
}
QString
PythonJob::prettyName() const
{

View File

@ -55,8 +55,6 @@ public:
QString prettyStatusMessage() const override;
JobResult exec() override;
virtual qreal getJobWeight() const override;
private:
struct Private;