From 3f9b8f03af1da01524eb8a4c14219dbd2b5c4a18 Mon Sep 17 00:00:00 2001 From: Gabriel Ozouf Date: Thu, 18 Jun 2020 17:22:46 +0200 Subject: [PATCH] [apps/global_preferences] Added country preference Change-Id: Ifbe09e2a24b4e1b9386f323bd5ebd9bed7fc8440 --- apps/global_preferences.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/global_preferences.h b/apps/global_preferences.h index fb82cbe0c..0001787f8 100644 --- a/apps/global_preferences.h +++ b/apps/global_preferences.h @@ -14,6 +14,8 @@ public: static GlobalPreferences * sharedGlobalPreferences(); I18n::Language language() const { return m_language; } void setLanguage(I18n::Language language) { m_language = language; } + I18n::Country country() const { return m_country; } + void setCountry(I18n::Country country) { m_country = country; } bool isInExamMode() const { return (int8_t)examMode() > 0; } ExamMode examMode() const; void setExamMode(ExamMode examMode); @@ -25,14 +27,17 @@ public: void setFont(const KDFont * font) { m_font = font; } constexpr static int NumberOfBrightnessStates = 12; private: - static_assert(I18n::NumberOfLanguages > 0, "I18n::NumberOfLanguages is not superior to 0"); // There should already have be an error when processing an empty EPSILON_I18N flag + static_assert(I18n::NumberOfLanguages > 0, "I18n::NumberOfLanguages is not superior to 0"); // There should already have been an error when processing an empty EPSILON_I18N flag + static_assert(I18n::NumberOfCountries > 0, "I18n::NumberOfCountries is not superior to 0"); // There should already have been an error when processing an empty EPSILON_COUNTRIES flag GlobalPreferences() : m_language((I18n::Language)0), + m_country((I18n::Country)0), m_examMode(ExamMode::Unknown), m_showPopUp(true), m_brightnessLevel(Ion::Backlight::MaxBrightness), m_font(KDFont::LargeFont) {} I18n::Language m_language; + I18n::Country m_country; static_assert((int8_t)GlobalPreferences::ExamMode::Off == 0, "GlobalPreferences::isInExamMode() is not right"); static_assert((int8_t)GlobalPreferences::ExamMode::Unknown < 0, "GlobalPreferences::isInExamMode() is not right"); mutable ExamMode m_examMode;