summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-23 11:53:42 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-23 11:53:42 -0800
commitc521aec88452460cc139d9d74d1f23ef58eac1a6 (patch)
tree819396ee40b8ca251f854560c22b1f10c67b855c /main.c
parentb1db60ba4795638192c0dea93670d858d4178528 (diff)
downloadsubsurface-c521aec88452460cc139d9d74d1f23ef58eac1a6.tar.gz
Import and merge GPS data from the webservice
Dive locations marked (and named) via the companion app are downloaded from the webservice, parsed and merged with the existing dives. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.c b/main.c
index b96c39fd3..27458f86a 100644
--- a/main.c
+++ b/main.c
@@ -165,7 +165,10 @@ void report_dives(gboolean is_imported, gboolean prefer_imported)
struct dive *dive = pp[1];
struct dive *merged;
- if (prev->when + prev->duration.seconds < dive->when)
+ /* only try to merge overlapping dives - or if one of the dives has
+ * zero duration (that might be a gps marker from the webservice) */
+ if (prev->duration.seconds && dive->duration.seconds &&
+ prev->when + prev->duration.seconds < dive->when)
continue;
merged = try_to_merge(prev, dive, prefer_imported);