From 95a23cf4701d4918f866cb5ef1c25a5b2b380096 Mon Sep 17 00:00:00 2001 From: Stefan Fuchs Date: Sun, 18 Feb 2018 21:55:57 +0100 Subject: 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 --- profile-widget/diveprofileitem.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'profile-widget') 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); } -- cgit v1.2.3-70-g09d2