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 /profile-widget | |
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 'profile-widget')
-rw-r--r-- | profile-widget/diveprofileitem.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/profile-widget/diveprofileitem.cpp b/profile-widget/diveprofileitem.cpp index 6352d5171..24edba4db 100644 --- a/profile-widget/diveprofileitem.cpp +++ b/profile-widget/diveprofileitem.cpp @@ -591,16 +591,15 @@ void DiveTemperatureItem::modelDataChanged(const QModelIndex &topLeft, const QMo void DiveTemperatureItem::createTextItem(int sec, int mkelvin) { - double deg; - const char *unit; - deg = get_temp_units(mkelvin, &unit); + temperature_t temp; + temp.mkelvin = mkelvin; DiveTextItem *text = new DiveTextItem(this); text->setAlignment(Qt::AlignRight | Qt::AlignBottom); text->setBrush(getColor(TEMP_TEXT)); text->setPos(QPointF(hAxis->posAtValue(sec), vAxis->posAtValue(mkelvin))); text->setScale(0.8); // need to call this BEFORE setText() - text->setText(QString("%1%2").arg(deg, 0, 'f', 1).arg(unit)); + text->setText(get_temperature_string(temp, true)); texts.append(text); } |