summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jocke <j.bygdell@gmail.com>2018-09-16 15:49:26 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-19 14:41:11 -0700
commit5cb31d6adba6979e8efb6ea2acaca6280eed4bb3 (patch)
treed033523fc175ece94270de14dcf48877795a46f0
parenta63be142b5ba4d51fe9add1451eb5cdb2f81eb57 (diff)
downloadsubsurface-5cb31d6adba6979e8efb6ea2acaca6280eed4bb3.tar.gz
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 <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--mobile-widgets/qmlprefs.cpp5
1 files changed, 5 insertions, 0 deletions
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();