mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Merge branch 'webservice-import'
Update maxdepth / duration that have moved into the divecomputer structure. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
commit
100c400809
4 changed files with 37 additions and 3 deletions
9
dive.c
9
dive.c
|
|
@ -1206,12 +1206,19 @@ static int max_time(duration_t a, duration_t b)
|
|||
*/
|
||||
static int likely_same_dive(struct dive *a, struct dive *b)
|
||||
{
|
||||
int fuzz, match;
|
||||
int match, fuzz = 20 * 60;
|
||||
|
||||
/* Don't try to merge dives in different trips */
|
||||
if (a->divetrip && b->divetrip && a->divetrip != b->divetrip)
|
||||
return 0;
|
||||
|
||||
/* if one of the dives has no depth and duration this could be
|
||||
* a location marker from the webservice (in this situation it
|
||||
* is valid to only check the first dc structure as we know that
|
||||
* a location marker will only ever have one of those structures) */
|
||||
if ((!a->dc.maxdepth.mm && !a->dc.duration.seconds) ||
|
||||
(!b->dc.maxdepth.mm && !b->dc.duration.seconds))
|
||||
return ((a->when <= b->when + fuzz) && (a->when >= b->when - fuzz));
|
||||
/*
|
||||
* Do some basic sanity testing of the values we
|
||||
* have filled in during 'fixup_dive()'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue