aboutsummaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-17 17:58:31 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-17 17:58:31 -0700
commitb63b656c1fa2414fc9d24d3e52448f4d246f3697 (patch)
tree809cc93f1cd4982496b6d788acf0ee16c2d5b4b1 /dive.c
parentb39e478c57745c1b546152cc45cd28cb701aaa83 (diff)
downloadsubsurface-b63b656c1fa2414fc9d24d3e52448f4d246f3697.tar.gz
Make sure cylinder related data is filled when dives are read
This is re-run every time we update the dive list model for the UI, but we should run it a first time right after loading the dives so that this data is correct even without the UI running - this way the data in headless standalone applications like the HTML exporter is correct as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dive.c b/dive.c
index d1f4f8bd2..f187e13c8 100644
--- a/dive.c
+++ b/dive.c
@@ -8,6 +8,7 @@
#include "dive.h"
#include "libdivecomputer.h"
#include "device.h"
+#include "divelist.h"
/* one could argue about the best place to have this variable -
* it's used in the UI, but it seems to make the most sense to have it
@@ -1382,6 +1383,7 @@ struct dive *fixup_dive(struct dive *dive)
if (same_rounded_pressure(cyl->sample_end, cyl->end))
cyl->end.mbar = 0;
}
+ update_cylinder_related_info(dive);
for (i = 0; i < MAX_WEIGHTSYSTEMS; i++) {
weightsystem_t *ws = dive->weightsystem + i;
add_weightsystem_description(ws);