From 98f912f80a59a0e3b61a902d0771e9f05c66833d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 21 Jul 2020 00:11:16 +0200 Subject: [PATCH] [locale] Drop LocalePage:;init - setting the initial location is something the Config-object should do - setting up the combo-boxes can be done in the constructor --- src/modules/locale/LocalePage.cpp | 17 ++++------------- src/modules/locale/LocalePage.h | 2 -- src/modules/locale/LocaleViewStep.cpp | 2 +- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/modules/locale/LocalePage.cpp b/src/modules/locale/LocalePage.cpp index d4d24afef..f0a2418ac 100644 --- a/src/modules/locale/LocalePage.cpp +++ b/src/modules/locale/LocalePage.cpp @@ -115,6 +115,10 @@ LocalePage::LocalePage( Config* config, QWidget* parent ) connect( m_formatsChangeButton, &QPushButton::clicked, this, &LocalePage::changeFormats ); CALAMARES_RETRANSLATE_SLOT( &LocalePage::updateLocaleLabels ) + + m_regionCombo->setModel( m_config->regionModel() ); + m_regionCombo->currentIndexChanged( m_regionCombo->currentIndex() ); + updateGlobalStorage(); } @@ -136,19 +140,6 @@ LocalePage::updateLocaleLabels() m_formatsLabel->setText( labels.second ); } -void -LocalePage::init( const QString& initialRegion, const QString& initialZone ) -{ - using namespace CalamaresUtils::Locale; - - m_regionCombo->setModel( m_config->regionModel() ); - m_regionCombo->currentIndexChanged( m_regionCombo->currentIndex() ); - - m_config->setCurrentLocation( initialRegion, initialZone ); - - updateGlobalStorage(); -} - std::pair< QString, QString > LocalePage::prettyLocaleStatus( const LocaleConfiguration& lc ) const { diff --git a/src/modules/locale/LocalePage.h b/src/modules/locale/LocalePage.h index c8312309e..3d4b1d03f 100644 --- a/src/modules/locale/LocalePage.h +++ b/src/modules/locale/LocalePage.h @@ -43,8 +43,6 @@ public: explicit LocalePage( class Config* config, QWidget* parent = nullptr ); virtual ~LocalePage(); - void init( const QString& initialRegion, const QString& initialZone ); - QString prettyStatus() const; QMap< QString, QString > localesMap(); diff --git a/src/modules/locale/LocaleViewStep.cpp b/src/modules/locale/LocaleViewStep.cpp index 81162d843..e17c7b004 100644 --- a/src/modules/locale/LocaleViewStep.cpp +++ b/src/modules/locale/LocaleViewStep.cpp @@ -70,7 +70,7 @@ LocaleViewStep::setUpPage() { m_actualWidget = new LocalePage( m_config.get() ); } - m_actualWidget->init( m_startingTimezone.first, m_startingTimezone.second ); + m_config->setCurrentLocation( m_startingTimezone.first, m_startingTimezone.second ); m_widget->layout()->addWidget( m_actualWidget ); ensureSize( m_actualWidget->sizeHint() );