aboutsummaryrefslogtreecommitdiffstats
path: root/statistics.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-14 09:44:18 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-14 09:44:18 -0800
commit23cfd907dea74dd8e4c8bbf93c8c3f598868623e (patch)
tree820717f6b5cb2614129c06b9b43ddff14ddd3efb /statistics.c
parentca19578e407424221309f8724b451ffe2c1f9769 (diff)
downloadsubsurface-23cfd907dea74dd8e4c8bbf93c8c3f598868623e.tar.gz
Better handling of manually edited air temperature
We now load and save this in the XML file, we do the right thing when merging dives and show the edited air temperature in the Dive Info notebook when a divecomputer doesn't have an air temperature. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'statistics.c')
-rw-r--r--statistics.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/statistics.c b/statistics.c
index d87353b7f..fdea8bdba 100644
--- a/statistics.c
+++ b/statistics.c
@@ -574,7 +574,12 @@ static void show_single_dive_stats(struct dive *dive)
value = get_temp_units(dc->airtemp.mkelvin, &unit);
set_label(single_w.air_temp, "%.1f %s", value, unit);
} else {
- set_label(single_w.air_temp, "");
+ if (dive->airtemp.mkelvin) {
+ value = get_temp_units(dive->airtemp.mkelvin, &unit);
+ set_label(single_w.air_temp, "%.1f %s", value, unit);
+ } else {
+ set_label(single_w.air_temp, "");
+ }
}
mbar = dc->surface_pressure.mbar;
/* it would be easy to get dive data here: