Simplify: remove waterTemp variable

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2016-01-11 15:46:30 -02:00 committed by Dirk Hohndel
parent 8e8c32d26e
commit 8929d6eb1a
2 changed files with 5 additions and 7 deletions

View file

@ -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

View file

@ -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;