From 11dcae436eed5c684077b5a5e2b20d73fbebcca9 Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Sat, 4 Feb 2017 10:42:00 +0100 Subject: MOBILE: Read profile settings from git Signed-off-by: Joakim Bygdell --- core/subsurfacestartup.c | 2 +- mobile-widgets/qmlmanager.cpp | 4 ++++ subsurface-mobile-main.cpp | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/subsurfacestartup.c b/core/subsurfacestartup.c index f240d139c..500e91857 100644 --- a/core/subsurfacestartup.c +++ b/core/subsurfacestartup.c @@ -7,7 +7,7 @@ #include "git-access.h" #include "libdivecomputer/version.h" -struct preferences prefs, informational_prefs; +struct preferences prefs, informational_prefs, git_prefs; struct preferences default_prefs = { .cloud_base_url = "https://cloud.subsurface-divelog.org/", #if defined(SUBSURFACE_MOBILE) diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 31936b6ee..422320fdc 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -155,6 +155,8 @@ void QMLManager::openLocalThenRemote(QString url) if (informational_prefs.unit_system == IMPERIAL) informational_prefs.units = IMPERIAL_units; prefs.units = informational_prefs.units; + prefs.tankbar = git_prefs.tankbar; + prefs.dcceiling = git_prefs.dcceiling; process_dives(false, false); DiveListModel::instance()->clear(); DiveListModel::instance()->addAllDives(); @@ -540,6 +542,8 @@ void QMLManager::consumeFinishedLoad(timestamp_t currentDiveTimestamp) if (informational_prefs.unit_system == IMPERIAL) informational_prefs.units = IMPERIAL_units; prefs.units = informational_prefs.units; + prefs.tankbar = git_prefs.tankbar; + prefs.dcceiling = git_prefs.dcceiling; DiveListModel::instance()->clear(); process_dives(false, false); DiveListModel::instance()->addAllDives(); diff --git a/subsurface-mobile-main.cpp b/subsurface-mobile-main.cpp index 87fbd48d1..c64368ceb 100644 --- a/subsurface-mobile-main.cpp +++ b/subsurface-mobile-main.cpp @@ -54,7 +54,6 @@ int main(int argc, char **argv) prefs.animation_speed = 0; // we render the profile to pixmap, no animations // always show the divecomputer reported ceiling in red - prefs.dcceiling = 1; prefs.redceiling = 1; init_proxy(); -- cgit v1.2.3-70-g09d2