diff options
author | Stefan Fuchs <sfuchs@gmx.de> | 2018-02-18 21:55:57 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-02-24 11:45:17 -0800 |
commit | 95a23cf4701d4918f866cb5ef1c25a5b2b380096 (patch) | |
tree | d4735ee6e8fe357483f88cab290e1749ad303656 /desktop-widgets/templatelayout.h | |
parent | 928e7ed8694e49efdabe3502eef32c4519bf6b0c (diff) | |
download | subsurface-95a23cf4701d4918f866cb5ef1c25a5b2b380096.tar.gz |
Use temperature_t for temperatures in struct stats_t
Use struct temperature_t for temperatures in struct stats_t and
use get_temperature_string() when printing these temperatures for
statistics and HTML export.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'desktop-widgets/templatelayout.h')
-rw-r--r-- | desktop-widgets/templatelayout.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/desktop-widgets/templatelayout.h b/desktop-widgets/templatelayout.h index cb60cc03d..6c3c079e4 100644 --- a/desktop-widgets/templatelayout.h +++ b/desktop-widgets/templatelayout.h @@ -104,13 +104,9 @@ if (property == "year") { } else if (property == "dives") { return object.year->selection_size; } else if (property == "min_temp") { - const char *unit; - double temp = get_temp_units(object.year->min_temp, &unit); - return object.year->min_temp == 0 ? "0" : QString::number(temp, 'g', 2) + unit; + return object.year->min_temp.mkelvin == 0 ? "0" : get_temperature_string(object.year->min_temp, true); } else if (property == "max_temp") { - const char *unit; - double temp = get_temp_units(object.year->max_temp, &unit); - return object.year->max_temp == 0 ? "0" : QString::number(temp, 'g', 2) + unit; + return object.year->max_temp.mkelvin == 0 ? "0" : get_temperature_string(object.year->max_temp, true); } else if (property == "total_time") { return get_dive_duration_string(object.year->total_time.seconds, QObject::tr("h"), QObject::tr("min"), QObject::tr("sec"), " "); |