mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-01 19:35:36 -04:00
[locale] Move more business logic to Config
- writing *localeConf* settings to GS can be done always when the formats are set, rather than special-cased. The code that handles the "special case" of no widget existing for the ViewStep overlooks the other crashes that happen then. - Since Config knows what jobs to create, just ask it rather than keeping a copy.
This commit is contained in:
parent
f6419d5de1
commit
0c9480aa3f
3 changed files with 12 additions and 22 deletions
|
@ -170,18 +170,28 @@ Config::Config( QObject* parent )
|
|||
|
||||
connect( this, &Config::currentLocationChanged, [&]() {
|
||||
auto* gs = Calamares::JobQueue::instance()->globalStorage();
|
||||
|
||||
// Update the GS region and zone (and possibly the live timezone)
|
||||
const auto* location = currentLocation();
|
||||
bool locationChanged = ( location->region() != gs->value( "locationRegion" ) )
|
||||
|| ( location->zone() != gs->value( "locationZone" ) );
|
||||
|
||||
gs->insert( "locationRegion", location->region() );
|
||||
gs->insert( "locationZone", location->zone() );
|
||||
|
||||
if ( locationChanged && m_adjustLiveTimezone )
|
||||
{
|
||||
QProcess::execute( "timedatectl", // depends on systemd
|
||||
{ "set-timezone", location->region() + '/' + location->zone() } );
|
||||
}
|
||||
|
||||
// Update GS localeConf (the LC_ variables)
|
||||
auto map = localeConfiguration().toMap();
|
||||
QVariantMap vm;
|
||||
for ( auto it = map.constBegin(); it != map.constEnd(); ++it )
|
||||
{
|
||||
vm.insert( it.key(), it.value() );
|
||||
}
|
||||
gs->insert( "localeConf", vm );
|
||||
} );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue