diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2016-01-20 18:45:43 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-20 08:48:23 -0800 |
commit | a329d44de091939c0a972433811e9889d1739c2c (patch) | |
tree | 9176866a2c8eb21b53342ca8ac93f050f0fb8741 /qt-mobile | |
parent | 85c57c005fdcb0748224414134ce974de4f29be8 (diff) | |
download | subsurface-a329d44de091939c0a972433811e9889d1739c2c.tar.gz |
If set imperial units explicitly on mobile app
If unit_system is set to imperial, we need to set the units explicitly
on mobile application.
Fixes #993
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r-- | qt-mobile/qmlmanager.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index d5e5706be..ecaca047f 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -78,6 +78,8 @@ void QMLManager::finishSetup() appendTextToLog(QString("loading dives from cache failed %1").arg(error)); } else { prefs.unit_system = informational_prefs.unit_system; + if (informational_prefs.unit_system == IMPERIAL) + informational_prefs.units = IMPERIAL_units; prefs.units = informational_prefs.units; int i; struct dive *d; @@ -299,6 +301,8 @@ void QMLManager::loadDivesWithValidCredentials() return; } prefs.unit_system = informational_prefs.unit_system; + if (informational_prefs.unit_system == IMPERIAL) + informational_prefs.units = IMPERIAL_units; prefs.units = informational_prefs.units; process_dives(false, false); |