mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
a6796d9c80
commit
8e8c32d26e
2 changed files with 6 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue