From 8929d6eb1a5d6ace2c6f4b6de71eb85a04e16a82 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 11 Jan 2016 15:46:30 -0200 Subject: Simplify: remove waterTemp variable Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- subsurface-core/subsurface-qt/DiveObjectHelper.cpp | 11 +++++------ subsurface-core/subsurface-qt/DiveObjectHelper.h | 1 - 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'subsurface-core/subsurface-qt') diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp index 35dc53704..b1501b380 100644 --- a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp +++ b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp @@ -34,7 +34,6 @@ static QString getFormattedCylinder(struct dive *dive, unsigned int idx) } DiveObjectHelper::DiveObjectHelper(struct dive *d) : - m_waterTemp(get_temperature_string(d->watertemp, true)), m_suit(d->suit ? d->suit : EMPTY_DIVE_STRING), m_trip(d->divetrip ? d->divetrip->location : EMPTY_DIVE_STRING), m_maxcns(d->maxcns), @@ -45,10 +44,6 @@ DiveObjectHelper::DiveObjectHelper(struct dive *d) : if (ds) m_gps = QString("%1,%2").arg(ds->latitude.udeg / 1000000.0).arg(ds->longitude.udeg / 1000000.0); - if (m_waterTemp.isEmpty()) { - m_waterTemp = EMPTY_DIVE_STRING; - } - m_notes = QString::fromUtf8(d->notes); if (m_notes.isEmpty()) m_notes = EMPTY_DIVE_STRING; @@ -179,7 +174,11 @@ QString DiveObjectHelper::airTemp() const QString DiveObjectHelper::waterTemp() const { - return m_waterTemp; + QString temp = get_temperature_string(m_dive->watertemp, true); + if (temp.isEmpty()) { + temp = EMPTY_DIVE_STRING; + } + return temp; } QString DiveObjectHelper::notes() const diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.h b/subsurface-core/subsurface-qt/DiveObjectHelper.h index b874506ab..a47bff599 100644 --- a/subsurface-core/subsurface-qt/DiveObjectHelper.h +++ b/subsurface-core/subsurface-qt/DiveObjectHelper.h @@ -65,7 +65,6 @@ private: QString m_date; QString m_time; QString m_gps; - QString m_waterTemp; QString m_notes; QString m_tags; QString m_gas; -- cgit v1.2.3-70-g09d2