From 2f4b415e9148c584a743e488804289e9b644c3ae Mon Sep 17 00:00:00 2001 From: rafsalvioni Date: Mon, 27 Mar 2023 14:35:24 -0300 Subject: [PATCH] Saves default sea water salinity in log Some DCs only report water type, without salinity level. Subsurface fixes most of these cases using default levels, but when the type of water is Sea/Salt, this fix was not saved. This causes a bit confusion, mainly if the user defines own salinity level. Signed-off-by: Rafael M. Salvioni --- CHANGELOG.md | 1 + core/save-git.c | 3 +-- core/save-xml.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 189ca0747..20a5e0316 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +core: fix bug when save sea water salinity given by DC desktop: add column for dive notes to the dive list table desktop: fix bug when printing a dive plan with multiple segments desktop: fix remembering of bluetooth address for remembered dive computers (not MacOS) diff --git a/core/save-git.c b/core/save-git.c index e9826e585..42ee4f546 100644 --- a/core/save-git.c +++ b/core/save-git.c @@ -211,8 +211,7 @@ static void save_airpressure(struct membuffer *b, struct divecomputer *dc) static void save_salinity(struct membuffer *b, struct divecomputer *dc) { - /* only save if we have a value that isn't the default of sea water */ - if (!dc->salinity || dc->salinity == SEAWATER_SALINITY) + if (!dc->salinity) return; put_salinity(b, dc->salinity, "salinity ", "g/l\n"); } diff --git a/core/save-xml.c b/core/save-xml.c index a8478fc96..f1498860b 100644 --- a/core/save-xml.c +++ b/core/save-xml.c @@ -152,8 +152,7 @@ static void save_airpressure(struct membuffer *b, struct divecomputer *dc) static void save_salinity(struct membuffer *b, struct divecomputer *dc) { - /* only save if we have a value that isn't the default of sea water */ - if (!dc->salinity || dc->salinity == SEAWATER_SALINITY) + if (!dc->salinity) return; put_string(b, " salinity, " salinity='", " g/l'");