diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2017-11-08 12:22:48 +0100 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-08 14:07:36 +0100 |
commit | 8d0361ff77707b9cae7c6bea6109c776afd6e2a6 (patch) | |
tree | a84796d833e137e65b15faace60216f5329d580e /core/save-xml.c | |
parent | 20510d4ff7d3f2bc17026ed6d67e3a7efaab130b (diff) | |
download | subsurface-8d0361ff77707b9cae7c6bea6109c776afd6e2a6.tar.gz |
Do not save dive sites that are not used
As it is not possible to delete dive sites from the logbook, we
need to make sure that we never save sites that are not tied to
any dive. With this change, unused site that are currently in
the logbook will also be removed, so it will also clear up
(wrong) historical data.
Supposed to fix #786
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'core/save-xml.c')
-rw-r--r-- | core/save-xml.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/save-xml.c b/core/save-xml.c index d3b9e6c8d..5bc4f5b38 100644 --- a/core/save-xml.c +++ b/core/save-xml.c @@ -571,7 +571,7 @@ void save_dives_buffer(struct membuffer *b, const bool select_only) int j; struct dive *d; struct dive_site *ds = get_dive_site(i); - if (dive_site_is_empty(ds)) { + if (dive_site_is_empty(ds) || !is_dive_site_used(ds->uuid, false)) { for_each_dive(j, d) { if (d->dive_site_uuid == ds->uuid) d->dive_site_uuid = 0; |