[libcalamares] Make job weights integers
This commit is contained in:
parent
73b8ecd622
commit
a91ef65a37
@ -101,10 +101,10 @@ Job::Job( QObject* parent )
|
||||
Job::~Job() {}
|
||||
|
||||
|
||||
qreal
|
||||
int
|
||||
Job::getJobWeight() const
|
||||
{
|
||||
return qreal( 1.0 );
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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.
|
||||
|
@ -190,12 +190,6 @@ PythonJob::PythonJob( const ModuleSystem::InstanceKey& instance,
|
||||
|
||||
PythonJob::~PythonJob() {}
|
||||
|
||||
qreal
|
||||
PythonJob::getJobWeight() const
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
QString
|
||||
PythonJob::prettyName() const
|
||||
{
|
||||
|
@ -55,8 +55,6 @@ public:
|
||||
QString prettyStatusMessage() const override;
|
||||
JobResult exec() override;
|
||||
|
||||
virtual qreal getJobWeight() const override;
|
||||
|
||||
private:
|
||||
struct Private;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user