From 4440bf3bfc2d8d4fd99fdf0241c18051d298c62c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 28 Apr 2024 17:45:51 +0200 Subject: [PATCH] [partition] Simplify collecting partition descriptions --- src/modules/partition/PartitionViewStep.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/modules/partition/PartitionViewStep.cpp b/src/modules/partition/PartitionViewStep.cpp index 119bf1baa..db087b59d 100644 --- a/src/modules/partition/PartitionViewStep.cpp +++ b/src/modules/partition/PartitionViewStep.cpp @@ -223,9 +223,15 @@ PartitionViewStep::prettyStatus() const const QList< PartitionCoreModule::SummaryInfo > list = m_core->createSummaryInfo(); cDebug() << "Summary for Partition" << list.length() << choice; - auto joinDiskInfo = [ choice ]( QString& s, const PartitionCoreModule::SummaryInfo& i ) - { return s + diskDescription( 1, i, choice ); }; - const QString diskInfoLabel = std::accumulate( list.begin(), list.end(), QString(), joinDiskInfo ); + const QString diskInfoLabel = [ &choice, &list ]() + { + QStringList s; + for ( const auto& i : list ) + { + s.append( diskDescription( 1, i, choice ) ); + } + return s.join( QString() ); + }(); const QString jobsLabel = jobDescriptions( jobs() ).join( QStringLiteral( "
" ) ); return diskInfoLabel + "
" + jobsLabel; }