From 916050181518136d32bfe3cdd268ee7dcf8a412e Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Fri, 9 Sep 2011 19:10:23 +0100 Subject: [PATCH] Fix RideSummaryWindow crash Fixups for QStringList introduced a new bug by referencing Time In Zones for HR zones 9 and 10, when in fact they do not go any higher that 8. They also were not computed because the worklist used was updated to include any HR metrics when the ride is dirty (e.g. when selecting intervals on ride plot or updating the metrics within metadata). --- src/RideSummaryWindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/RideSummaryWindow.cpp b/src/RideSummaryWindow.cpp index c79a8588a..1997532e9 100644 --- a/src/RideSummaryWindow.cpp +++ b/src/RideSummaryWindow.cpp @@ -182,9 +182,7 @@ RideSummaryWindow::htmlSummary() const << "time_in_zone_H5" << "time_in_zone_H6" << "time_in_zone_H7" - << "time_in_zone_H8" - << "time_in_zone_H9" - << "time_in_zone_H10"; + << "time_in_zone_H8"; // Use pre-computed and saved metric values if the ride has not // been edited. Otherwise we need to re-compute every time. @@ -199,12 +197,14 @@ RideSummaryWindow::htmlSummary() const worklist += maximumColumn; worklist += metricColumn; worklist += timeInZones; + worklist += timeInZonesHR; // go calculate them then... QHash computed = RideMetric::computeMetrics(mainWindow, ride, mainWindow->zones(), mainWindow->hrZones(), worklist); for(int i = 0; i < worklist.count(); ++i) { - if (worklist[i] != "") + if (worklist[i] != "") { metrics.setForSymbol(worklist[i], computed.value(worklist[i])->value(true)); + } } } else {