diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/load-git.c | 5 | ||||
-rw-r--r-- | core/parse-xml.c | 2 | ||||
-rw-r--r-- | core/save-git.c | 2 | ||||
-rw-r--r-- | core/save-xml.c | 5 |
4 files changed, 11 insertions, 3 deletions
diff --git a/core/load-git.c b/core/load-git.c index c9c195ca6..add7afe8c 100644 --- a/core/load-git.c +++ b/core/load-git.c @@ -285,6 +285,9 @@ static void parse_dive_surge(char *line, struct membuffer *str, struct git_parse static void parse_dive_chill(char *line, struct membuffer *str, struct git_parser_state *state) { UNUSED(str); state->active_dive->chill = get_index(line); } +static void parse_dive_watersalinity(char *line, struct membuffer *str, struct git_parser_state *state) +{ UNUSED(str); state->active_dive->user_salinity = get_salinity(line); } + static void parse_dive_notrip(char *line, struct membuffer *str, struct git_parser_state *state) { UNUSED(str); @@ -1001,7 +1004,7 @@ struct keyword_action dive_action[] = { #define D(x) { #x, parse_dive_ ## x } D(airpressure), D(airtemp), D(buddy), D(chill), D(current), D(cylinder), D(divemaster), D(divesiteid), D(duration), D(gps), D(location), D(notes), D(notrip), D(rating), D(suit), D(surge), - D(tags), D(visibility), D(watertemp), D(wavesize), D(weightsystem) + D(tags), D(visibility), D(watersalinity), D(watertemp), D(wavesize), D(weightsystem) }; static void dive_parser(char *line, struct membuffer *str, struct git_parser_state *state) diff --git a/core/parse-xml.c b/core/parse-xml.c index cd87d27a1..a7aec8c6a 100644 --- a/core/parse-xml.c +++ b/core/parse-xml.c @@ -1331,6 +1331,8 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf, str return; if (MATCH("buddy", utf8_string, &dive->buddy)) return; + if (MATCH("watersalinity", salinity, &dive->user_salinity)) + return; if (MATCH("rating.dive", get_rating, &dive->rating)) return; if (MATCH("visibility.dive", get_rating, &dive->visibility)) diff --git a/core/save-git.c b/core/save-git.c index 8f27c8b0b..4f6110eb1 100644 --- a/core/save-git.c +++ b/core/save-git.c @@ -437,6 +437,8 @@ static void create_dive_buffer(struct dive *dive, struct membuffer *b) SAVE("current", current); SAVE("surge", surge); SAVE("chill", chill); + if (dive->user_salinity) + put_format(b, "watersalinity %d g/l\n", (int)(dive->user_salinity/10)); if (surface_pressure.mbar) SAVE("airpressure", surface_pressure.mbar); cond_put_format(dive->notrip, b, "notrip\n"); diff --git a/core/save-xml.c b/core/save-xml.c index 2a8ec5fa7..963907fb2 100644 --- a/core/save-xml.c +++ b/core/save-xml.c @@ -499,9 +499,10 @@ void save_one_dive_to_mb(struct membuffer *b, struct dive *dive, bool anonymize) if (dive->chill) put_format(b, " chill='%d'", dive->chill); save_tags(b, dive->tag_list); - if (dive->dive_site) { + if (dive->dive_site) put_format(b, " divesiteid='%8x'", dive->dive_site->uuid); - } + if (dive->user_salinity) + put_salinity(b, dive->user_salinity, " watersalinity='", " g/l'"); show_date(b, dive->when); if (surface_pressure.mbar) put_pressure(b, surface_pressure, " airpressure='", " bar'"); |