summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmanager.cpp
diff options
context:
space:
mode:
authorGravatar Jocke <j.bygdell@gmail.com>2018-09-16 21:34:39 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-19 14:41:23 -0700
commit09e7fdc253aefcd05b2133d0745dceba34955247 (patch)
treecd93d9e0d05c3e37ea6610476a36e45ce197a58f /mobile-widgets/qmlmanager.cpp
parent5cb31d6adba6979e8efb6ea2acaca6280eed4bb3 (diff)
downloadsubsurface-09e7fdc253aefcd05b2133d0745dceba34955247.tar.gz
Mobile: git prefs overrules locale
The unit types are set from system locale when the app starts. We need to explicitly set the units to match the unit system that is saved in the git repo. Or we end up with situations where the preferences and git say "metric" but the units are "imperial". Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r--mobile-widgets/qmlmanager.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index c2b993b0c..d6c00c870 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -38,6 +38,7 @@
#include "core/settings/qPrefLocationService.h"
#include "core/settings/qPrefTechnicalDetails.h"
#include "core/settings/qPrefPartialPressureGas.h"
+#include "core/settings/qPrefUnit.h"
QMLManager *QMLManager::m_instance = NULL;
bool noCloudToCloud = false;
@@ -278,12 +279,10 @@ void QMLManager::openLocalThenRemote(QString url)
// if we can load from the cache, we know that we have a valid cloud account
if (QMLPrefs::instance()->credentialStatus() == qPrefCloudStorage::CS_UNKNOWN)
QMLPrefs::instance()->setCredentialStatus(qPrefCloudStorage::CS_VERIFIED);
- prefs.unit_system = git_prefs.unit_system;
if (git_prefs.unit_system == IMPERIAL)
- git_prefs.units = IMPERIAL_units;
+ qPrefUnits::set_unit_system("imperial");
else if (git_prefs.unit_system == METRIC)
- git_prefs.units = SI_units;
- prefs.units = git_prefs.units;
+ qPrefUnits::set_unit_system("metric");
qPrefTechnicalDetails::set_tankbar(git_prefs.tankbar);
qPrefTechnicalDetails::set_dcceiling(git_prefs.dcceiling);
qPrefTechnicalDetails::set_show_ccr_setpoint(git_prefs.show_ccr_setpoint);