summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Salvador Cuñat <salvador.cunat@gmail.com>2014-06-23 22:06:03 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-24 21:59:18 +0800
commit2ae6f8078a7ea2a034295fcd00f210854a572ee7 (patch)
tree024e983ca3a174f75cb81c05dc2a31f1b2a7f9e0
parent0deee63b5eecc4a631c5ac4dcb49b47540dcc84c (diff)
downloadsubsurface-2ae6f8078a7ea2a034295fcd00f210854a572ee7.tar.gz
Look around DCs dive time for automatically fixed positions.
dive = find_dive_including(gpsfix->when); only finds dives which have a fix during the underwater time. If the positions have been fixed before or after the dive, fails quietly. So let's test this situation and, in case, pass the job to find_dive_n_near(). Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/subsurfacewebservices.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index c430deec6..1babdaa8e 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -50,8 +50,7 @@ static bool merge_locations_into_dives(void)
sort_table(&gps_location_table);
for_each_gps_location (i, gpsfix) {
- if (is_automatic_fix(gpsfix)) {
- dive = find_dive_including(gpsfix->when);
+ if (is_automatic_fix(gpsfix) && (dive = find_dive_including(gpsfix->when))) {
if (dive && !dive_has_gps_location(dive)) {
#if DEBUG_WEBSERVICE
struct tm tm;