aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/tab-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/tab-widgets')
-rw-r--r--desktop-widgets/tab-widgets/TabDiveStatistics.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/desktop-widgets/tab-widgets/TabDiveStatistics.cpp b/desktop-widgets/tab-widgets/TabDiveStatistics.cpp
index 0582ec930..cc7946a88 100644
--- a/desktop-widgets/tab-widgets/TabDiveStatistics.cpp
+++ b/desktop-widgets/tab-widgets/TabDiveStatistics.cpp
@@ -71,15 +71,12 @@ void TabDiveStatistics::updateData()
else
ui->sacLimits->setAverage("");
- temperature_t temp;
- temp.mkelvin = stats_selection.max_temp;
- ui->tempLimits->setMaximum(get_temperature_string(temp, true));
- temp.mkelvin = stats_selection.min_temp;
- ui->tempLimits->setMinimum(get_temperature_string(temp, true));
- if (stats_selection.combined_temp && stats_selection.combined_count) {
- const char *unit;
- get_temp_units(0, &unit);
- ui->tempLimits->setAverage(QString("%1%2").arg(stats_selection.combined_temp / stats_selection.combined_count, 0, 'f', 1).arg(unit));
+ ui->tempLimits->setMaximum(get_temperature_string(stats_selection.max_temp, true));
+ ui->tempLimits->setMinimum(get_temperature_string(stats_selection.min_temp, true));
+ if (stats_selection.combined_temp.mkelvin && stats_selection.combined_count) {
+ temperature_t avg_temp;
+ avg_temp.mkelvin = stats_selection.combined_temp.mkelvin / stats_selection.combined_count;
+ ui->tempLimits->setAverage(get_temperature_string(avg_temp, true));
}