Fix findBests when no speed/gps

.. flawed logic. Same fix also applied to master.
This commit is contained in:
Mark Liversedge
2013-12-06 22:52:23 +00:00
parent 96e006be90
commit a83c3bfeee

View File

@@ -520,7 +520,7 @@ AddIntervalDialog::findBests(bool typeTime, const RideFile *ride, double windowS
// ride is shorter than the window size! // ride is shorter than the window size!
if (typeTime && windowSize > ride->dataPoints().last()->secs + secsDelta) return; if (typeTime && windowSize > ride->dataPoints().last()->secs + secsDelta) return;
else if (windowSize > ride->dataPoints().last()->km*1000) return; if (!typeTime && windowSize > ride->dataPoints().last()->km*1000) return;
// We're looking for intervals with durations in [windowSizeSecs, windowSizeSecs + secsDelta). // We're looking for intervals with durations in [windowSizeSecs, windowSizeSecs + secsDelta).
foreach (const RideFilePoint *point, ride->dataPoints()) { foreach (const RideFilePoint *point, ride->dataPoints()) {