[partition] Initialize partition layout from config file

In order to keep the partition layout during calamares' execution, we
add a PartitionLayout object instance to PartitionCoreModule. This class
will therefore be used to initialize the PartitionLayout object and
interact with it thoughout the program's execution.

When no partition layout is present in the config file, we initialize
the layout with a single ext4 partition mounted on '/', as it was
previously done.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
This commit is contained in:
Arnaud Ferraris 2019-01-07 17:25:39 +01:00
parent f1ead5193d
commit b2bf873ede
3 changed files with 41 additions and 0 deletions

View file

@ -610,6 +610,15 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap )
QFuture< void > future =
QtConcurrent::run( this, &PartitionViewStep::initPartitionCoreModule );
watcher->setFuture( future );
if ( configurationMap.contains( "partitionLayout" ) )
{
m_core->initLayout( configurationMap.values( "partitionLayout" ).at(0).toList() );
}
else
{
m_core->initLayout();
}
}