Mobile: return all used gasmixes as a list

Planning ahead for full edit capabilities of dives that uses multiple cylinders.  

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This commit is contained in:
Jocke 2018-07-16 18:25:21 +02:00 committed by Dirk Hohndel
parent 94428b9a18
commit f9e81c7326
2 changed files with 8 additions and 5 deletions

View file

@ -417,9 +417,12 @@ QString DiveObjectHelper::endPressure() const
return endPressure;
}
QString DiveObjectHelper::firstGas() const
QStringList DiveObjectHelper::firstGas() const
{
QString gas;
gas = get_gas_string(m_dive->cylinder[0].gasmix);
QStringList gas;
for (int i = 0; i < MAX_CYLINDERS; i++) {
if (is_cylinder_used(m_dive, i))
gas << get_gas_string(m_dive->cylinder[i].gasmix);
}
return gas;
}

View file

@ -48,7 +48,7 @@ class DiveObjectHelper : public QObject {
Q_PROPERTY(QStringList getCylinder READ getCylinder CONSTANT)
Q_PROPERTY(QString startPressure READ startPressure CONSTANT)
Q_PROPERTY(QString endPressure READ endPressure CONSTANT)
Q_PROPERTY(QString firstGas READ firstGas CONSTANT)
Q_PROPERTY(QStringList firstGas READ firstGas CONSTANT)
public:
DiveObjectHelper(struct dive *dive = NULL);
~DiveObjectHelper();
@ -92,7 +92,7 @@ public:
QStringList getCylinder() const;
QString startPressure() const;
QString endPressure() const;
QString firstGas() const;
QStringList firstGas() const;
private:
struct dive *m_dive;