AllPlotWindow - add average power to the end of the selection name only if not zero

It's annoying when there is no power
This commit is contained in:
Alejandro Martinez
2015-02-09 14:30:06 -03:00
parent 5b1e035517
commit 5fd2873df2

View File

@@ -2057,8 +2057,9 @@ AllPlotWindow::setEndSelection(AllPlot* plot, double xValue, bool newInterval, Q
if (bottom->text(0).startsWith(name)) delete allIntervals->takeChild(count-1);
}
// add average power to the end of the selection name
name += QString("(%1 watts)").arg(round((wattsTotal && arrayLength) ? wattsTotal/arrayLength : 0));
// add average power to the end of the selection name, if available
if (wattsTotal && arrayLength)
name += tr("(%1 watts)").arg(round(wattsTotal/arrayLength));
QTreeWidgetItem *last = new IntervalItem(ride->ride(), name, duration1, duration2, distance1, distance2,
allIntervals->childCount()+1);