mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 00:13:24 +00:00
Removing cylinders in planner: Be more restrictive
Be even more restrictive regarding which cylinders can be removed from the cylinder table in the planner. Only if a cyliner is not used in the planned part of the dive it can be removed. It doesn't matter if there is another cylinder with same gasmix. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
cbf5d788e0
commit
8fd1c72f04
1 changed files with 3 additions and 3 deletions
|
@ -242,7 +242,7 @@ QVariant CylindersModel::data(const QModelIndex &index, int role) const
|
|||
if (gasmix_distance(mygas, gas2) == 0 && is_cylinder_used(&displayed_dive, i))
|
||||
same_gas = i;
|
||||
}
|
||||
if (same_gas == -1 &&
|
||||
if ((in_planner() || same_gas == -1) &&
|
||||
((DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING &&
|
||||
DivePlannerPointsModel::instance()->tankInUse(index.row())) ||
|
||||
(DivePlannerPointsModel::instance()->currentMode() == DivePlannerPointsModel::NOTHING &&
|
||||
|
@ -265,7 +265,7 @@ QVariant CylindersModel::data(const QModelIndex &index, int role) const
|
|||
if (gasmix_distance(mygas, gas2) == 0 && is_cylinder_used(&displayed_dive, i))
|
||||
same_gas = i;
|
||||
}
|
||||
if (same_gas == -1 &&
|
||||
if ((in_planner() || same_gas == -1) &&
|
||||
((DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING &&
|
||||
DivePlannerPointsModel::instance()->tankInUse(index.row())) ||
|
||||
(DivePlannerPointsModel::instance()->currentMode() == DivePlannerPointsModel::NOTHING &&
|
||||
|
@ -569,7 +569,7 @@ void CylindersModel::remove(const QModelIndex &index)
|
|||
if (gasmix_distance(mygas, gas2) == 0 && is_cylinder_used(&displayed_dive, i))
|
||||
same_gas = i;
|
||||
}
|
||||
if (same_gas == -1 &&
|
||||
if ((in_planner() || same_gas == -1) &&
|
||||
((DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING &&
|
||||
DivePlannerPointsModel::instance()->tankInUse(index.row())) ||
|
||||
(DivePlannerPointsModel::instance()->currentMode() == DivePlannerPointsModel::NOTHING &&
|
||||
|
|
Loading…
Add table
Reference in a new issue