mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-30 02:45:37 -04:00
[locale] Move current-location to Config
This commit is contained in:
parent
5a6a9a0d45
commit
726f882185
5 changed files with 63 additions and 40 deletions
|
@ -163,6 +163,31 @@ Config::timezoneData() const
|
|||
return ::timezoneData();
|
||||
}
|
||||
|
||||
void
|
||||
Config::setCurrentLocation( const QString& regionName, const QString& zoneName )
|
||||
{
|
||||
using namespace CalamaresUtils::Locale;
|
||||
auto* region = timezoneData().find< TZRegion >( regionName );
|
||||
auto* zone = region ? region->zones().find< TZZone >( zoneName ) : nullptr;
|
||||
if ( zone )
|
||||
{
|
||||
setCurrentLocation( zone );
|
||||
}
|
||||
else
|
||||
{
|
||||
setCurrentLocation( QStringLiteral("America"), QStringLiteral("New_York") );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Config::setCurrentLocation( const CalamaresUtils::Locale::TZZone* location )
|
||||
{
|
||||
if ( location != m_currentLocation )
|
||||
{
|
||||
m_currentLocation = location;
|
||||
emit currentLocationChanged( m_currentLocation );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Config::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue