[locale] Move job-creation to Config

- since Config knows what settings there are, it should create the
  jobs to run later -- not the Page.
- this doesn't work yet, because the Config does **not** know what
  the selected timezone is yet.
This commit is contained in:
Adriaan de Groot 2020-07-20 22:21:29 +02:00
parent 8c21b59853
commit 5a6a9a0d45
5 changed files with 21 additions and 19 deletions

View file

@ -20,6 +20,8 @@
#include "Config.h"
#include "SetTimezoneJob.h"
#include "utils/Logger.h"
#include "utils/Variant.h"
@ -172,3 +174,18 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
}
m_localeGenLines = loadLocales( localeGenPath );
}
Calamares::JobList
Config::createJobs()
{
Calamares::JobList list;
const CalamaresUtils::Locale::TZZone* location = nullptr; // TODO: m_tzWidget->currentLocation();
if ( location )
{
Calamares::Job* j = new SetTimezoneJob( location->region(), location->zone() );
list.append( Calamares::job_ptr( j ) );
}
return list;
}