[locale] Don't need own copy of zones list
This commit is contained in:
parent
439f828d9b
commit
51b7ec875f
@ -43,8 +43,7 @@
|
|||||||
LocalePage::LocalePage( Config* config, QWidget* parent )
|
LocalePage::LocalePage( Config* config, QWidget* parent )
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
, m_config( config )
|
, m_config( config )
|
||||||
, m_regionList( CalamaresUtils::Locale::TZRegion::fromZoneTab() )
|
, m_regionModel( std::make_unique< CalamaresUtils::Locale::CStringListModel >( CalamaresUtils::Locale::TZRegion::fromZoneTab() ) )
|
||||||
, m_regionModel( std::make_unique< CalamaresUtils::Locale::CStringListModel >( m_regionList ) )
|
|
||||||
, m_blockTzWidgetSet( false )
|
, m_blockTzWidgetSet( false )
|
||||||
{
|
{
|
||||||
QBoxLayout* mainLayout = new QVBoxLayout;
|
QBoxLayout* mainLayout = new QVBoxLayout;
|
||||||
@ -118,7 +117,6 @@ LocalePage::LocalePage( Config* config, QWidget* parent )
|
|||||||
|
|
||||||
LocalePage::~LocalePage()
|
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->setModel( m_regionModel.get() );
|
||||||
m_regionCombo->currentIndexChanged( m_regionCombo->currentIndex() );
|
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 ) )
|
if ( region && region->zones().find< TZZone >( initialZone ) )
|
||||||
{
|
{
|
||||||
m_tzWidget->setCurrentLocation( initialRegion, initialZone );
|
m_tzWidget->setCurrentLocation( initialRegion, initialZone );
|
||||||
@ -297,7 +295,7 @@ LocalePage::regionChanged( int currentIndex )
|
|||||||
Q_UNUSED( currentIndex )
|
Q_UNUSED( currentIndex )
|
||||||
QString selectedRegion = m_regionCombo->currentData().toString();
|
QString selectedRegion = m_regionCombo->currentData().toString();
|
||||||
|
|
||||||
TZRegion* region = m_regionList.find< TZRegion >( selectedRegion );
|
TZRegion* region = CalamaresUtils::Locale::TZRegion::fromZoneTab().find< TZRegion >( selectedRegion );
|
||||||
if ( !region )
|
if ( !region )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -79,7 +79,6 @@ private:
|
|||||||
void changeFormats();
|
void changeFormats();
|
||||||
|
|
||||||
// Dynamically, QList< TZRegion* >
|
// Dynamically, QList< TZRegion* >
|
||||||
CalamaresUtils::Locale::CStringPairList m_regionList;
|
|
||||||
std::unique_ptr< CalamaresUtils::Locale::CStringListModel > m_regionModel;
|
std::unique_ptr< CalamaresUtils::Locale::CStringListModel > m_regionModel;
|
||||||
|
|
||||||
TimeZoneWidget* m_tzWidget;
|
TimeZoneWidget* m_tzWidget;
|
||||||
|
Loading…
Reference in New Issue
Block a user