From 2ae6f8078a7ea2a034295fcd00f210854a572ee7 Mon Sep 17 00:00:00 2001 From: Salvador Cuñat Date: Mon, 23 Jun 2014 22:06:03 +0200 Subject: Look around DCs dive time for automatically fixed positions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Dirk Hohndel --- qt-ui/subsurfacewebservices.cpp | 3 +-- 1 file changed, 1 insertion(+), 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; -- cgit v1.2.3-70-g09d2