[partition] Move partitioning options into a class

- As (auto) partitioning grows more options, the parameter
   list becomes more unwieldy. Add some structure to it.
This commit is contained in:
Adriaan de Groot 2018-09-17 06:42:14 -04:00
parent 5136021416
commit d2f4079a18
4 changed files with 121 additions and 86 deletions

View file

@ -85,6 +85,8 @@ ReplaceWidget::reset()
void
ReplaceWidget::applyChanges()
{
auto gs = Calamares::JobQueue::instance()->globalStorage();
PartitionModel* model = qobject_cast< PartitionModel* >( m_ui->partitionTreeView->model() );
if ( model )
{
@ -93,7 +95,9 @@ ReplaceWidget::applyChanges()
{
Device* dev = model->device();
PartitionActions::doReplacePartition( m_core, dev, partition );
PartitionActions::doReplacePartition(
m_core, dev, partition,
{ gs->value( "defaultFileSystemType" ).toString(), QString() } );
if ( m_isEfi )
{
@ -102,17 +106,13 @@ ReplaceWidget::applyChanges()
{
PartitionInfo::setMountPoint(
efiSystemPartitions.first(),
Calamares::JobQueue::instance()->
globalStorage()->
value( "efiSystemPartition" ).toString() );
gs->value( "efiSystemPartition" ).toString() );
}
else if ( efiSystemPartitions.count() > 1 )
{
PartitionInfo::setMountPoint(
efiSystemPartitions.at( m_ui->bootComboBox->currentIndex() ),
Calamares::JobQueue::instance()->
globalStorage()->
value( "efiSystemPartition" ).toString() );
gs->value( "efiSystemPartition" ).toString() );
}
}