mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
c1f936f288
commit
28ad26e878
1 changed files with 3 additions and 2 deletions
|
@ -449,13 +449,14 @@ void DivePlannerPointsModel::copyCylinders(dive *d)
|
||||||
|
|
||||||
QStringList& DivePlannerPointsModel::getGasList()
|
QStringList& DivePlannerPointsModel::getGasList()
|
||||||
{
|
{
|
||||||
|
struct dive *activeDive = isPlanner() ? stagingDive : current_dive;
|
||||||
static QStringList list;
|
static QStringList list;
|
||||||
list.clear();
|
list.clear();
|
||||||
if (!stagingDive) {
|
if (!activeDive) {
|
||||||
list.push_back(tr("AIR"));
|
list.push_back(tr("AIR"));
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < MAX_CYLINDERS; i++) {
|
for (int i = 0; i < MAX_CYLINDERS; i++) {
|
||||||
cylinder_t *cyl = &stagingDive->cylinder[i];
|
cylinder_t *cyl = &activeDive->cylinder[i];
|
||||||
if (cylinder_nodata(cyl))
|
if (cylinder_nodata(cyl))
|
||||||
break;
|
break;
|
||||||
list.push_back(gasToStr(cyl->gasmix.o2.permille, cyl->gasmix.he.permille));
|
list.push_back(gasToStr(cyl->gasmix.o2.permille, cyl->gasmix.he.permille));
|
||||||
|
|
Loading…
Add table
Reference in a new issue