[partition] Refactor partition-labeling

This commit is contained in:
Adriaan de Groot 2021-01-20 14:48:44 +01:00
parent 1ec886e8cb
commit 31bf38977e

View File

@ -71,6 +71,12 @@ prettyGptType( const QString& type )
return gptTypePrettyStrings.value( type.toLower(), type ); return gptTypePrettyStrings.value( type.toLower(), type );
} }
static QString
prettyGptType( const Partition* partition )
{
return prettyGptType( partition->type() );
}
static QString static QString
prettyGptEntries( const Partition* partition ) prettyGptEntries( const Partition* partition )
{ {
@ -86,7 +92,7 @@ prettyGptEntries( const Partition* partition )
list += partition->label(); list += partition->label();
} }
QString type = prettyGptType( partition->type() ); QString type = prettyGptType( partition );
if ( !type.isEmpty() ) if ( !type.isEmpty() )
{ {
list += type; list += type;
@ -166,7 +172,7 @@ CreatePartitionJob::prettyStatusMessage() const
const PartitionTable* table = CalamaresUtils::Partition::getPartitionTable( m_partition ); const PartitionTable* table = CalamaresUtils::Partition::getPartitionTable( m_partition );
if ( table && table->type() == PartitionTable::TableType::gpt ) if ( table && table->type() == PartitionTable::TableType::gpt )
{ {
QString type = prettyGptType( m_partition->type() ); QString type = prettyGptType( m_partition );
if ( type.isEmpty() ) if ( type.isEmpty() )
{ {
type = m_partition->label(); type = m_partition->label();