From 86fd014bbd9aadda44b5a8d5d948c3912ba860ac Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 13 Oct 2020 00:00:37 +0200 Subject: [PATCH] [libcalamares] Fallback from status -> description -> name for progress --- src/libcalamares/JobQueue.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libcalamares/JobQueue.cpp b/src/libcalamares/JobQueue.cpp index 526cd70bf..1637f0719 100644 --- a/src/libcalamares/JobQueue.cpp +++ b/src/libcalamares/JobQueue.cpp @@ -177,6 +177,18 @@ private: const auto& jobitem = m_runningJobs->at( m_jobIndex ); progress = ( jobitem.cumulative + jobitem.weight * percentage ) / m_overallQueueWeight; message = jobitem.job->prettyStatusMessage(); + // In progress reports at the start of a job (e.g. when the queue + // starts the job, or if the job itself reports 0.0) be more + // accepting in what gets reported: jobs with no status fall + // back to description and name, whichever is non-empty. + if ( percentage == 0.0 && message.isEmpty() ) + { + message = jobitem.job->prettyDescription(); + if ( message.isEmpty() ) + { + message = jobitem.job->prettyName(); + } + } } else {