mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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 <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
55898c07ff
commit
b60a3d71d3
2 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue