From 5cb31d6adba6979e8efb6ea2acaca6280eed4bb3 Mon Sep 17 00:00:00 2001 From: Jocke Date: Sun, 16 Sep 2018 15:49:26 +0200 Subject: Mobile: set units system in "No cloud mode" When starting the app in "No cloud mode" we need to make sure that the units and unit_system match. Signed-off-by: Joakim Bygdell Signed-off-by: Dirk Hohndel --- mobile-widgets/qmlprefs.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mobile-widgets/qmlprefs.cpp') diff --git a/mobile-widgets/qmlprefs.cpp b/mobile-widgets/qmlprefs.cpp index 1f30f7a7e..cf7b5ddbb 100644 --- a/mobile-widgets/qmlprefs.cpp +++ b/mobile-widgets/qmlprefs.cpp @@ -4,6 +4,7 @@ #include "core/membuffer.h" #include "core/gpslocation.h" +#include "core/settings/qPrefUnit.h" /*** Global and constructors ***/ @@ -78,6 +79,10 @@ void QMLPrefs::setCredentialStatus(const qPrefCloudStorage::cloud_status value) QMLManager::instance()->appendTextToLog("Switching to no cloud mode"); set_filename(NOCLOUD_LOCALSTORAGE); clearCredentials(); + if (qPrefUnits::unit_system() == "imperial") + prefs.units = IMPERIAL_units; + else if (qPrefUnits::unit_system() == "metric") + prefs.units = SI_units; } m_credentialStatus = value; emit credentialStatusChanged(); -- cgit v1.2.3-70-g09d2