summaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt/DiveObjectHelper.cpp
diff options
context:
space:
mode:
authorGravatar Jocke <j.bygdell@gmail.com>2018-07-16 18:25:21 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-11 11:19:07 -0700
commitf9e81c73269d9205ed4851cd86e946a24a8f5b5b (patch)
tree13e65a262e8e0f80959653e8bde52147693f504a /core/subsurface-qt/DiveObjectHelper.cpp
parent94428b9a1823fd7df9f2f0f7815900efca2213a4 (diff)
downloadsubsurface-f9e81c73269d9205ed4851cd86e946a24a8f5b5b.tar.gz
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>
Diffstat (limited to 'core/subsurface-qt/DiveObjectHelper.cpp')
-rw-r--r--core/subsurface-qt/DiveObjectHelper.cpp9
1 files changed, 6 insertions, 3 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;
}