If only one dive selected, only one temperature in stats tab

In stats tab, when only one dive is selected, on one stat, only average is
shown, except temperature which 3 same temps for max, min and avg are shown.

[Dirk Hohndel: fixed whitespace]

Signed-off-by: Fabio Rueda <avances123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Fabio Rueda 2019-09-15 10:11:27 +02:00 committed by Dirk Hohndel
parent b3e5e5eef4
commit 356293da7d

View file

@ -70,8 +70,10 @@ void TabDiveStatistics::updateData()
else
ui->sacLimits->setAverage("");
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_count > 1) {
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;