mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Don't merge divecomputers if we know they are different
When merging dives, if we know for sure that the dive computers are different, don't merge them into one (by interleaving the data), but instead keep both as separate dive computers in the same dive. This fixes a bug when due to a faulty download the same dive from two dive computers looks quite different. They don't get merged automatically (which is fine - they are quite different), but when manually merging them, we of course want one dive with two dive computers, not one dive with one merged dive computer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
3159a90b0a
commit
818542eeca
1 changed files with 1 additions and 1 deletions
2
dive.c
2
dive.c
|
@ -2135,7 +2135,7 @@ struct dive *merge_dives(struct dive *a, struct dive *b, int offset, bool prefer
|
||||||
if (dl) {
|
if (dl) {
|
||||||
/* If we prefer downloaded, do those first, and get rid of "might be same" computers */
|
/* If we prefer downloaded, do those first, and get rid of "might be same" computers */
|
||||||
join_dive_computers(&res->dc, &dl->dc, &a->dc, 1);
|
join_dive_computers(&res->dc, &dl->dc, &a->dc, 1);
|
||||||
} else if (offset)
|
} else if (offset && might_be_same_device(&a->dc, &b->dc))
|
||||||
interleave_dive_computers(&res->dc, &a->dc, &b->dc, offset);
|
interleave_dive_computers(&res->dc, &a->dc, &b->dc, offset);
|
||||||
else
|
else
|
||||||
join_dive_computers(&res->dc, &a->dc, &b->dc, 0);
|
join_dive_computers(&res->dc, &a->dc, &b->dc, 0);
|
||||||
|
|
Loading…
Reference in a new issue