[locale] Don't need own copy of zones list

This commit is contained in:
Adriaan de Groot 2020-07-20 13:55:00 +02:00
parent 439f828d9b
commit 51b7ec875f
2 changed files with 3 additions and 6 deletions

View File

@ -43,8 +43,7 @@
LocalePage::LocalePage( Config* config, QWidget* parent )
: QWidget( parent )
, m_config( config )
, m_regionList( CalamaresUtils::Locale::TZRegion::fromZoneTab() )
, m_regionModel( std::make_unique< CalamaresUtils::Locale::CStringListModel >( m_regionList ) )
, m_regionModel( std::make_unique< CalamaresUtils::Locale::CStringListModel >( CalamaresUtils::Locale::TZRegion::fromZoneTab() ) )
, m_blockTzWidgetSet( false )
{
QBoxLayout* mainLayout = new QVBoxLayout;
@ -118,7 +117,6 @@ LocalePage::LocalePage( Config* config, QWidget* parent )
LocalePage::~LocalePage()
{
qDeleteAll( m_regionList );
}
@ -145,7 +143,7 @@ LocalePage::init( const QString& initialRegion, const QString& initialZone )
m_regionCombo->setModel( m_regionModel.get() );
m_regionCombo->currentIndexChanged( m_regionCombo->currentIndex() );
auto* region = m_regionList.find< TZRegion >( initialRegion );
auto* region = CalamaresUtils::Locale::TZRegion::fromZoneTab().find< TZRegion >( initialRegion );
if ( region && region->zones().find< TZZone >( initialZone ) )
{
m_tzWidget->setCurrentLocation( initialRegion, initialZone );
@ -297,7 +295,7 @@ LocalePage::regionChanged( int currentIndex )
Q_UNUSED( currentIndex )
QString selectedRegion = m_regionCombo->currentData().toString();
TZRegion* region = m_regionList.find< TZRegion >( selectedRegion );
TZRegion* region = CalamaresUtils::Locale::TZRegion::fromZoneTab().find< TZRegion >( selectedRegion );
if ( !region )
{
return;

View File

@ -79,7 +79,6 @@ private:
void changeFormats();
// Dynamically, QList< TZRegion* >
CalamaresUtils::Locale::CStringPairList m_regionList;
std::unique_ptr< CalamaresUtils::Locale::CStringListModel > m_regionModel;
TimeZoneWidget* m_tzWidget;