mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-20 06:45:27 +00:00
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:
parent
04704d02c8
commit
9f4bc61f62
2 changed files with 6 additions and 9 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue