From 5fd2873df2ae26ba4a449bb51dca23747ef2f138 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Date: Mon, 9 Feb 2015 14:30:06 -0300 Subject: [PATCH] AllPlotWindow - add average power to the end of the selection name only if not zero It's annoying when there is no power --- src/AllPlotWindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/AllPlotWindow.cpp b/src/AllPlotWindow.cpp index b31b1721b..ce9deb26d 100644 --- a/src/AllPlotWindow.cpp +++ b/src/AllPlotWindow.cpp @@ -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);