mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Planner: don't allow negative depths
This patch allows only non-negative depths in the divepoints table as negative depths confuse the planenr/deco algortihm. The spinbox appearing in the table should get a setMinimum(0) but I was not able to find the correct way to implement that. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
3d511fe26b
commit
a7969d1083
1 changed files with 2 additions and 1 deletions
|
@ -545,7 +545,8 @@ bool DivePlannerPointsModel::setData(const QModelIndex &index, const QVariant &v
|
|||
divedatapoint &p = divepoints[index.row()];
|
||||
switch (index.column()) {
|
||||
case DEPTH:
|
||||
p.depth = units_to_depth(value.toInt());
|
||||
if (value.toInt() >= 0)
|
||||
p.depth = units_to_depth(value.toInt());
|
||||
break;
|
||||
case RUNTIME:
|
||||
p.time = value.toInt() * 60;
|
||||
|
|
Loading…
Add table
Reference in a new issue