[partition] Write the install choices to Global Storage

This commit is contained in:
Adriaan de Groot 2020-10-06 15:54:26 +02:00
parent 92a874dae7
commit 029c3f1c74

View File

@ -150,6 +150,19 @@ getSwapChoices( const QVariantMap& configurationMap )
return choices;
}
void
updateGlobalStorage( Config::InstallChoice installChoice, Config::SwapChoice swapChoice )
{
auto* gs = Calamares::JobQueue::instance() ? Calamares::JobQueue::instance()->globalStorage() : nullptr;
if ( gs )
{
QVariantMap m;
m.insert( "install", Config::installChoiceNames().find( installChoice ) );
m.insert( "swap", Config::swapChoiceNames().find( swapChoice ) );
gs->insert( "partitionChoices", m );
}
}
void
Config::setInstallChoice( int c )
{
@ -168,6 +181,7 @@ Config::setInstallChoice( InstallChoice c )
{
m_installChoice = c;
emit installChoiceChanged( c );
::updateGlobalStorage( c, m_swapChoice );
}
}
@ -189,6 +203,7 @@ Config::setSwapChoice( Config::SwapChoice c )
{
m_swapChoice = c;
emit swapChoiceChanged( c );
::updateGlobalStorage( m_installChoice, c );
}
}