diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2016-01-11 15:40:10 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-11 15:46:12 -0800 |
commit | 8e8c32d26e0e9e44f5201925ae510d0ec6a43551 (patch) | |
tree | b9acaf8f1af36d03e9dff08e3aa898a12554680b | |
parent | a6796d9c80f7f643ce729261eabac5f5fab78936 (diff) | |
download | subsurface-8e8c32d26e0e9e44f5201925ae510d0ec6a43551.tar.gz |
Simplify: removed buddy and airTemp variable
also fixed a bug on the depth
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | subsurface-core/subsurface-qt/DiveObjectHelper.cpp | 13 | ||||
-rw-r--r-- | subsurface-core/subsurface-qt/DiveObjectHelper.h | 2 |
2 files changed, 6 insertions, 9 deletions
diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp index c60dc4a67..35dc53704 100644 --- a/subsurface-core/subsurface-qt/DiveObjectHelper.cpp +++ b/subsurface-core/subsurface-qt/DiveObjectHelper.cpp @@ -34,8 +34,6 @@ static QString getFormattedCylinder(struct dive *dive, unsigned int idx) } DiveObjectHelper::DiveObjectHelper(struct dive *d) : - m_buddy(d->buddy ? d->buddy : EMPTY_DIVE_STRING), - m_airTemp(get_temperature_string(d->airtemp, true)), 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), @@ -47,9 +45,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_airTemp.isEmpty()) { - m_airTemp = EMPTY_DIVE_STRING; - } if (m_waterTemp.isEmpty()) { m_waterTemp = EMPTY_DIVE_STRING; } @@ -170,12 +165,16 @@ QString DiveObjectHelper::divemaster() const QString DiveObjectHelper::buddy() const { - return m_buddy; + return m_dive->buddy ? m_dive->buddy : EMPTY_DIVE_STRING; } QString DiveObjectHelper::airTemp() const { - return m_airTemp; + QString temp = get_temperature_string(m_dive->airtemp, true); + if (temp.isEmpty()) { + temp = EMPTY_DIVE_STRING; + } + return temp; } QString DiveObjectHelper::waterTemp() const diff --git a/subsurface-core/subsurface-qt/DiveObjectHelper.h b/subsurface-core/subsurface-qt/DiveObjectHelper.h index 4240b035b..b874506ab 100644 --- a/subsurface-core/subsurface-qt/DiveObjectHelper.h +++ b/subsurface-core/subsurface-qt/DiveObjectHelper.h @@ -65,8 +65,6 @@ private: QString m_date; QString m_time; QString m_gps; - QString m_buddy; - QString m_airTemp; QString m_waterTemp; QString m_notes; QString m_tags; |