summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-19 18:23:14 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-19 18:23:14 -0800
commit28ad26e8787f966223e448aaf728918dff92149e (patch)
treec908ff93a352ad38d5c845d86eac090ece9e3959 /qt-ui/diveplanner.cpp
parentc1f936f2889a38b83c32a42b85e0658d0fbd55c2 (diff)
downloadsubsurface-28ad26e8787f966223e448aaf728918dff92149e.tar.gz
Use the correct dive to create the gas list
If we are adding a dive, it's the stagingDive, otherwise it's the current_dive that we need to look at. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index f772a1c28..7be7263b8 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -449,13 +449,14 @@ void DivePlannerPointsModel::copyCylinders(dive *d)
QStringList& DivePlannerPointsModel::getGasList()
{
+ struct dive *activeDive = isPlanner() ? stagingDive : current_dive;
static QStringList list;
list.clear();
- if (!stagingDive) {
+ if (!activeDive) {
list.push_back(tr("AIR"));
} else {
for (int i = 0; i < MAX_CYLINDERS; i++) {
- cylinder_t *cyl = &stagingDive->cylinder[i];
+ cylinder_t *cyl = &activeDive->cylinder[i];
if (cylinder_nodata(cyl))
break;
list.push_back(gasToStr(cyl->gasmix.o2.permille, cyl->gasmix.he.permille));