From 51c39cdbee78582d5229b43afbbaaa74dade552e Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 21 Jul 2024 22:58:41 +0200 Subject: [PATCH] [partition] Improve jobDescriptions() - make the dox match what the function does - reduce calls to job->description() --- src/modules/partition/PartitionViewStep.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/partition/PartitionViewStep.cpp b/src/modules/partition/PartitionViewStep.cpp index db087b59d..27020477b 100644 --- a/src/modules/partition/PartitionViewStep.cpp +++ b/src/modules/partition/PartitionViewStep.cpp @@ -110,8 +110,8 @@ PartitionViewStep::prettyName() const /** @brief Gather the pretty descriptions of all the partitioning jobs * * Returns a QStringList of each job's pretty description, including - * empty strings and duplicates. The list is in-order of how the - * jobs will be run. + * duplicates (but no empty lines). The list is in-order of how the + * jobs will be run. If no job has a non-empty description, the list is empty. */ static QStringList jobDescriptions( const Calamares::JobList& jobs ) @@ -119,9 +119,10 @@ jobDescriptions( const Calamares::JobList& jobs ) QStringList jobsLines; for ( const Calamares::job_ptr& job : qAsConst( jobs ) ) { - if ( !job->prettyDescription().isEmpty() ) + const auto description = job->prettyDescription(); + if ( !description.isEmpty() ) { - jobsLines.append( job->prettyDescription() ); + jobsLines.append( description ); } } return jobsLines;