From 28ad26e8787f966223e448aaf728918dff92149e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 19 Nov 2013 18:23:14 -0800 Subject: 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 --- qt-ui/diveplanner.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qt-ui/diveplanner.cpp') 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)); -- cgit v1.2.3-70-g09d2