diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-06-15 05:52:12 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-15 09:56:11 -0700 |
commit | 617b105458f362516de9bf2997f747de5dc14e44 (patch) | |
tree | e00732092acf74dcd1d17df3dccd46e7d4017458 | |
parent | b144518a85f105b096688425452f053ffbf2bea0 (diff) | |
download | subsurface-617b105458f362516de9bf2997f747de5dc14e44.tar.gz |
Cloud storage: create preference entry for base URL
This just deals with the mechanics. There is no UI to enter / change this
URL (and that's intentional), neither is it used, yet.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | pref.h | 2 | ||||
-rw-r--r-- | qt-ui/preferences.cpp | 8 | ||||
-rw-r--r-- | subsurfacestartup.c | 1 |
3 files changed, 11 insertions, 0 deletions
@@ -28,6 +28,8 @@ struct preferences { const char *divelist_font; const char *default_filename; const char *default_cylinder; + const char *cloud_base_url; + const char *cloud_git_url; double font_size; partial_pressure_graphs_t pp_graphs; short mod; diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index e7aa7020b..9d018815b 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -431,6 +431,9 @@ void PreferencesDialog::syncSettings() SAVE_OR_REMOVE("cloud_verification_status", default_prefs.cloud_verification_status, prefs.cloud_verification_status); SAVE_OR_REMOVE("cloud_background_sync", default_prefs.cloud_background_sync, ui.cloud_background_sync->isChecked()); + // at this point we intentionally do not have a UI for changing this + // it could go into some sort of "advanced setup" or something + SAVE_OR_REMOVE("cloud_base_url", default_prefs.cloud_base_url, prefs.cloud_base_url); s.endGroup(); loadSettings(); emit settingsChanged(); @@ -563,6 +566,11 @@ void PreferencesDialog::loadSettings() } GET_INT("cloud_verification_status", cloud_verification_status); GET_BOOL("cloud_background_sync", cloud_background_sync); + + // creating the git url here is simply a convenience when C code wants + // to compare against that git URL - it's always derived from the base URL + GET_TXT("cloud_base_url", cloud_base_url); + prefs.cloud_git_url = strdup(qPrintable(QString(prefs.cloud_base_url) + "/git")); s.endGroup(); } diff --git a/subsurfacestartup.c b/subsurfacestartup.c index 391cbeb60..ab4af7035 100644 --- a/subsurfacestartup.c +++ b/subsurfacestartup.c @@ -5,6 +5,7 @@ #include "gettext.h" struct preferences prefs; struct preferences default_prefs = { + .cloud_base_url = "https://cloud.subsurface-divelog.org/", .units = SI_UNITS, .unit_system = METRIC, .coordinates_traditional = true, |