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 <rafael.salvioni@gmail.com>
This commit is contained in:
rafsalvioni 2023-03-27 14:35:24 -03:00 committed by Dirk Hohndel
parent 9da7ec4828
commit 2f4b415e91
3 changed files with 3 additions and 4 deletions

View file

@ -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)

View file

@ -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");
}

View file

@ -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, " <water");
put_salinity(b, dc->salinity, " salinity='", " g/l'");