Do not prefer gps fixes just for being into dive time

See commit 6f42ab46da. Unfortunately, this code is duplicated
(and an obvious candidate for code cleanup). So replicate the mentioned
commit here. In fact, the mentioned issue #666 talkes about the mobile
app, and the fix was only done for the desktop.

Originally-by: Salvador Cuñat <salvador.cunat@gmail.com>
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
Jan Mulder 2017-12-12 08:59:41 +01:00 committed by Dirk Hohndel
parent 5707554e98
commit ee9531f76e

View file

@ -294,15 +294,6 @@ bool GpsLocation::applyLocations()
if (j + 1 < cnt && time_during_dive_with_offset(d, gpsTable[j+1].when, SAME_GROUP)) {
if (verbose)
qDebug() << "look at the next gps fix @" << get_dive_date_string(gpsTable[j+1].when);
/* first let's test if this one is during the dive */
if (time_during_dive_with_offset(d, gpsTable[j+1].when, 0)) {
if (verbose)
qDebug() << "which is during the dive, pick that one";
copy_gps_location(gpsTable[j+1], d);
changed = true;
last = j + 1;
break;
}
/* we know the gps fixes are sorted; if they are both before the dive, ignore the first,
* if theay are both after the dive, take the first,
* if the first is before and the second is after, take the closer one */