Simplify: remove SAC 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 16:16:48 -02:00 committed by Dirk Hohndel
parent 04704d02c8
commit 9f4bc61f62
2 changed files with 6 additions and 9 deletions

View file

@ -58,13 +58,6 @@ DiveObjectHelper::DiveObjectHelper(struct dive *d) :
}
m_gas = gases;
if (d->sac) {
const char *unit;
int decimal;
double value = get_volume_units(d->sac, &decimal, &unit);
m_sac = QString::number(value, 'f', decimal).append(unit);
}
for (int i = 0; i < MAX_CYLINDERS; i++)
m_cylinders << getFormattedCylinder(d, i);
@ -186,7 +179,12 @@ QString DiveObjectHelper::gas() const
QString DiveObjectHelper::sac() const
{
return m_sac;
if (!m_dive->sac)
return QString();
const char *unit;
int decimal;
double value = get_volume_units(m_dive->sac, &decimal, &unit);
QString::number(value, 'f', decimal).append(unit);
}
QStringList DiveObjectHelper::weights() const

View file

@ -66,7 +66,6 @@ private:
QString m_time;
QString m_tags;
QString m_gas;
QString m_sac;
QStringList m_weights;
QStringList m_cylinders;
struct dive *m_dive;