summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/diveplanner.cpp4
-rw-r--r--qt-ui/models.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 84555bcd6..7831cc6d9 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -129,9 +129,9 @@ void DivePlannerPointsModel::loadFromDive(dive *d)
void DivePlannerPointsModel::setupCylinders()
{
if (mode == PLAN && current_dive) {
- // take the used cylinders from the selected dive as starting point
+ // take the displayed cylinders from the selected dive as starting point
CylindersModel::instance()->copyFromDive(current_dive);
- copy_cylinders(current_dive, &displayed_dive, false);
+ copy_cylinders(current_dive, &displayed_dive, !prefs.display_unused_tanks);
reset_cylinders(&displayed_dive, true);
return;
}
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index f0c15d486..fec7d02ed 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -367,7 +367,8 @@ void CylindersModel::copyFromDive(dive *d)
return;
rows = 0;
for (int i = 0; i < MAX_CYLINDERS; i++) {
- if (!cylinder_none(&d->cylinder[i]) && is_cylinder_used(d, i)) {
+ if (!cylinder_none(&d->cylinder[i]) &&
+ (is_cylinder_used(d, i) || prefs.display_unused_tanks)) {
rows = i + 1;
}
}