C++ trickery to make the code shorter to read.

This commit is contained in:
Adriaan de Groot 2017-07-03 18:07:18 -04:00
parent 3ecd2f2ff6
commit ee4e4dfccc
6 changed files with 32 additions and 37 deletions

View file

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014-2017, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -474,8 +475,7 @@ ChoicePage::doAlongsideSetupSplitter( const QModelIndex& current,
qRound64( part->used() * 1.1 ),
part->capacity() - requiredStorageB,
part->capacity() / 2,
Calamares::Branding::instance()->
string( Calamares::Branding::ProductName ) );
*Calamares::Branding::ProductName );
if ( m_isEfi )
setupEfiSystemPartitionSelector();
@ -775,8 +775,7 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current )
if ( !homePartitionPath->isEmpty() )
m_reuseHomeCheckBox->setText( tr( "Reuse %1 as home partition for %2." )
.arg( *homePartitionPath )
.arg( Calamares::Branding::instance()->string(
Calamares::Branding::ShortProductName ) ) );
.arg( *Calamares::Branding::ShortProductName ) );
delete homePartitionPath;
if ( m_isEfi )
@ -919,8 +918,7 @@ ChoicePage::updateActionChoicePreview( ChoicePage::Choice choice )
.arg( m_beforePartitionBarsView->selectionModel()->currentIndex().data().toString() )
.arg( size / ( 1024 * 1024 ) )
.arg( sizeNext / ( 1024 * 1024 ) )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) ) );
.arg( *Calamares::Branding::ShortProductName ) );
} );
m_previewAfterFrame->show();
@ -948,8 +946,7 @@ ChoicePage::updateActionChoicePreview( ChoicePage::Choice choice )
m_afterPartitionBarsView->setNestedPartitionsMode( mode );
m_afterPartitionLabelsView = new PartitionLabelsView( m_previewAfterFrame );
m_afterPartitionLabelsView->setExtendedPartitionHidden( mode == PartitionBarsView::NoNestedPartitions );
m_afterPartitionLabelsView->setCustomNewRootLabel( Calamares::Branding::instance()->
string( Calamares::Branding::BootloaderEntryName ) );
m_afterPartitionLabelsView->setCustomNewRootLabel( *Calamares::Branding::BootloaderEntryName );
PartitionModel* model = m_core->partitionModelForDevice( selectedDevice() );
@ -1073,8 +1070,7 @@ ChoicePage::setupEfiSystemPartitionSelector()
tr( "An EFI system partition cannot be found anywhere "
"on this system. Please go back and use manual "
"partitioning to set up %1." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) ) );
.arg( *Calamares::Branding::ShortProductName ) );
updateNextEnabled();
}
else if ( efiSystemPartitions.count() == 1 ) //probably most usual situation
@ -1083,8 +1079,7 @@ ChoicePage::setupEfiSystemPartitionSelector()
tr( "The EFI system partition at %1 will be used for "
"starting %2." )
.arg( efiSystemPartitions.first()->partitionPath() )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) ) );
.arg( *Calamares::Branding::ShortProductName ) );
}
else
{