aboutsummaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt
diff options
context:
space:
mode:
Diffstat (limited to 'core/subsurface-qt')
-rw-r--r--core/subsurface-qt/DiveObjectHelper.cpp9
-rw-r--r--core/subsurface-qt/DiveObjectHelper.h4
2 files changed, 8 insertions, 5 deletions
diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp
index 5ac144c07..23fa8a09f 100644
--- a/core/subsurface-qt/DiveObjectHelper.cpp
+++ b/core/subsurface-qt/DiveObjectHelper.cpp
@@ -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;
}
diff --git a/core/subsurface-qt/DiveObjectHelper.h b/core/subsurface-qt/DiveObjectHelper.h
index 1c9228365..118197ac3 100644
--- a/core/subsurface-qt/DiveObjectHelper.h
+++ b/core/subsurface-qt/DiveObjectHelper.h
@@ -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;