From 5956c6678ef00a9ffca413d665a43af0f25e2f6c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 2 Apr 2020 22:42:41 +0200 Subject: [PATCH] [welcome] Don't const& POD - simplify parameter types in some set-methods - while here, shuffle methods to bring things together --- src/modules/welcome/Config.cpp | 6 +++--- src/modules/welcome/Config.h | 11 +++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/modules/welcome/Config.cpp b/src/modules/welcome/Config.cpp index 0377bcf0c..1c2b17c38 100644 --- a/src/modules/welcome/Config.cpp +++ b/src/modules/welcome/Config.cpp @@ -159,7 +159,7 @@ Config::setLanguageIcon( const QString& languageIcon ) } void -Config::setLocaleIndex( const int& index ) +Config::setLocaleIndex( int index ) { if ( index == m_localeIndex || index > CalamaresUtils::Locale::availableTranslations()->rowCount( QModelIndex() ) || index < 0 ) @@ -170,7 +170,7 @@ Config::setLocaleIndex( const int& index ) m_localeIndex = index; const auto& selectedLocale = m_languages->locale( m_localeIndex ).locale(); - cDebug() << "Selected locale" << selectedLocale; + cDebug() << "Index" << index << "Selected locale" << selectedLocale; QLocale::setDefault( selectedLocale ); CalamaresUtils::installTranslator( selectedLocale, Calamares::Branding::instance()->translationsDirectory() ); @@ -185,7 +185,7 @@ Config::requirementsModel() const } void -Config::setIsNextEnabled( const bool& isNextEnabled ) +Config::setIsNextEnabled( bool isNextEnabled ) { m_isNextEnabled = isNextEnabled; emit isNextEnabledChanged( m_isNextEnabled ); diff --git a/src/modules/welcome/Config.h b/src/modules/welcome/Config.h index 9c8fb12e5..80e4eeea9 100644 --- a/src/modules/welcome/Config.h +++ b/src/modules/welcome/Config.h @@ -49,13 +49,17 @@ class Config : public QObject public: Config( QObject* parent = nullptr ); + + Calamares::RequirementsModel& requirementsModel() const; + void setCountryCode( const QString& countryCode ); + + QString languageIcon() const; void setLanguageIcon( const QString& languageIcon ); - Calamares::RequirementsModel& requirementsModel() const; - void setIsNextEnabled( const bool& isNextEnabled ); + void setIsNextEnabled( bool isNextEnabled ); - void setLocaleIndex( const int& index ); + void setLocaleIndex( int index ); int localeIndex() const { return m_localeIndex; } QString supportUrl() const; @@ -76,7 +80,6 @@ public: public slots: CalamaresUtils::Locale::LabelModel* languagesModel() const; void retranslate(); - QString languageIcon() const; signals: void countryCodeChanged( QString countryCode );