]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Fill the list of weightsystems from data in existing dives
authorDirk Hohndel <dirk@hohndel.org>
Mon, 6 Aug 2012 21:03:24 +0000 (14:03 -0700)
committerDirk Hohndel <dirk@hohndel.org>
Mon, 6 Aug 2012 21:03:24 +0000 (14:03 -0700)
This was simply an omission in the current implementation. All the
plumbing was there but never got hooked up with the fixup_dive function as
intended.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
dive.c
dive.h

diff --git a/dive.c b/dive.c
index 9f57aed58146554969901198ac761fc888904e18..57a735c8e72d2969cf7469c5969373cc94d4b0fc 100644 (file)
--- a/dive.c
+++ b/dive.c
@@ -472,6 +472,10 @@ struct dive *fixup_dive(struct dive *dive)
                if (same_rounded_pressure(cyl->sample_end, cyl->end))
                        cyl->end.mbar = 0;
        }
+       for (i = 0; i < MAX_WEIGHTSYSTEMS; i++) {
+               weightsystem_t *ws = dive->weightsystem + i;
+               add_weightsystem_description(ws);
+       }
 
        return dive;
 }
diff --git a/dive.h b/dive.h
index a25fafb39e95cc4b0eee571f94b195165b2200f4..30894e5066f5afa4e7a3dc4563772cb354f14784 100644 (file)
--- a/dive.h
+++ b/dive.h
@@ -338,6 +338,7 @@ extern void exit_ui(void);
 extern void report_error(GError* error);
 
 extern void add_cylinder_description(cylinder_type_t *);
+extern void add_weightsystem_description(weightsystem_t *);
 extern void add_people(const char *string);
 extern void add_location(const char *string);
 extern void remember_event(const char *eventname);