summaryrefslogtreecommitdiffstats
path: root/statistics.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-04-09 19:46:05 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-04-09 19:46:05 -0700
commit3611b0ae2d78402593b5bd007917454a4dcb9b50 (patch)
tree52cefdee596f2930acbb11fe9b09cba0e99d3d44 /statistics.c
parent51c4a5335b5c371f91ac9c6fd66779b78e1aa890 (diff)
downloadsubsurface-3611b0ae2d78402593b5bd007917454a4dcb9b50.tar.gz
Automatically show Freshwater tag (but don't set it)
If the salinity is 10000 we show (but do not set) the Freshwater tag. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'statistics.c')
-rw-r--r--statistics.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/statistics.c b/statistics.c
index 241e5929d..52477468b 100644
--- a/statistics.c
+++ b/statistics.c
@@ -548,6 +548,7 @@ static void show_single_dive_stats(struct dive *dive)
struct dive *prev_dive;
struct tm tm;
struct divecomputer *dc;
+ int more = 0;
process_all_dives(dive, &prev_dive);
if (!dive)
@@ -643,7 +644,7 @@ static void show_single_dive_stats(struct dive *dive)
/* Dive type */
*buf = '\0';
if (dive->dive_tags) {
- int i, more = 0;
+ int i;
for (i = 0; i < DTAG_NR; i++)
if(dive->dive_tags & (1 << i)) {
@@ -653,6 +654,11 @@ static void show_single_dive_stats(struct dive *dive)
more = 1;
}
}
+ if (!(dive->dive_tags & DTAG_FRESH) && dc->salinity == 10000) {
+ if (more)
+ strcat(buf, ", ");
+ strcat(buf, _(dtag_names[DTAG_FRESH_NR]));
+ }
set_label(single_w.dive_type, buf);
}