From ea143e96683d346aae26d8cbd210dc4f68f5f873 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Sun, 15 Feb 2015 12:28:46 +0100 Subject: Use unused cylinders in planner if they are displayed This makes prefs.display_unused_tanks also relevant for the planner. Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 4 ++-- qt-ui/models.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index f535a6a98..434da1fab 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -131,9 +131,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 19f0d12c0..bac9b4df0 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -368,7 +368,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; } } -- cgit v1.2.3-70-g09d2