[partition] Improve jobDescriptions()

- make the dox match what the function does
- reduce calls to job->description()
This commit is contained in:
Adriaan de Groot 2024-07-21 22:58:41 +02:00
parent e4d2b27138
commit 51c39cdbee

View File

@ -110,8 +110,8 @@ PartitionViewStep::prettyName() const
/** @brief Gather the pretty descriptions of all the partitioning jobs /** @brief Gather the pretty descriptions of all the partitioning jobs
* *
* Returns a QStringList of each job's pretty description, including * Returns a QStringList of each job's pretty description, including
* empty strings and duplicates. The list is in-order of how the * duplicates (but no empty lines). The list is in-order of how the
* jobs will be run. * jobs will be run. If no job has a non-empty description, the list is empty.
*/ */
static QStringList static QStringList
jobDescriptions( const Calamares::JobList& jobs ) jobDescriptions( const Calamares::JobList& jobs )
@ -119,9 +119,10 @@ jobDescriptions( const Calamares::JobList& jobs )
QStringList jobsLines; QStringList jobsLines;
for ( const Calamares::job_ptr& job : qAsConst( jobs ) ) 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; return jobsLines;