summaryrefslogtreecommitdiffstats
path: root/core/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2016-08-10 13:27:03 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-08-27 10:55:40 -0700
commit81d5d82b7bfb1a7a1cfe44b8d33befe9b31a2099 (patch)
tree31392ef07c43c9ac68ca95805b4865c5859c0848 /core/parse-xml.c
parent048379cc2b56257be4a435bb707d8a18c9958371 (diff)
downloadsubsurface-81d5d82b7bfb1a7a1cfe44b8d33befe9b31a2099.tar.gz
Settings update: Clean up save user id local
So, prefs.save_userid_local is being set outside of a preferences set (it's set to true and false while loading the files via xml or git) and because of that I had to bypass a few method calls. When something triggers a preferences change, the application will be notified that the preferences changed, thing that I couldn't do while reading the xml or git because that should be local-only. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/parse-xml.c')
-rw-r--r--core/parse-xml.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/parse-xml.c b/core/parse-xml.c
index 052cb124c..aa2e7125f 100644
--- a/core/parse-xml.c
+++ b/core/parse-xml.c
@@ -1771,7 +1771,12 @@ static void divecomputer_end(void)
static void userid_start(void)
{
in_userid = true;
- set_save_userid_local(true); //if the xml contains userid, keep saving it.
+ //if the xml contains userid, keep saving it.
+ // don't call the prefs method here as we don't wanna
+ // actually change the preferences, this is temporary and
+ // will be reverted when the file finishes.
+
+ prefs.save_userid_local = true;
}
static void userid_stop(void)
@@ -2045,7 +2050,7 @@ int parse_xml_buffer(const char *url, const char *buffer, int size,
if (!doc)
return report_error(translate("gettextFromC", "Failed to parse '%s'"), url);
- set_save_userid_local(false);
+ prefs.save_userid_local = false;
reset_all();
dive_start();
doc = test_xslt_transforms(doc, params);