[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

@ -101,10 +101,10 @@ Job::Job( QObject* parent )
Job::~Job() {} Job::~Job() {}
qreal int
Job::getJobWeight() const Job::getJobWeight() const
{ {
return qreal( 1.0 ); return 1;
} }

View File

@ -100,13 +100,19 @@ public:
/** @brief The job's (relative) weight. /** @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 * the same weight, so they advance the overall progress the same
* amount. This is nonsense, since some jobs take much longer than * amount. This is nonsense, since some jobs take much longer than
* others; it's up to the individual jobs to say something about * others; it's up to the individual jobs to say something about
* how much work is (relatively) done. * 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 /** @brief The human-readable name of this job
* *
* This should be a very short statement of what the job does. * 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() {} PythonJob::~PythonJob() {}
qreal
PythonJob::getJobWeight() const
{
return 1.0;
}
QString QString
PythonJob::prettyName() const PythonJob::prettyName() const
{ {

View File

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