aboutsummaryrefslogtreecommitdiffstats
path: root/subsurface-core/subsurface-qt/DiveObjectHelper.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2016-01-11 15:46:30 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-11 15:46:12 -0800
commit8929d6eb1a5d6ace2c6f4b6de71eb85a04e16a82 (patch)
treef0f1244dd825aa825da038c789d0b6ee09f0e614 /subsurface-core/subsurface-qt/DiveObjectHelper.cpp
parent8e8c32d26e0e9e44f5201925ae510d0ec6a43551 (diff)
downloadsubsurface-8929d6eb1a5d6ace2c6f4b6de71eb85a04e16a82.tar.gz
Simplify: remove waterTemp variable
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core/subsurface-qt/DiveObjectHelper.cpp')
-rw-r--r--subsurface-core/subsurface-qt/DiveObjectHelper.cpp11
1 files changed, 5 insertions, 6 deletions
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