Changeset dbf1390 in subsurface


Ignore:
Timestamp:
Jan 18, 2017, 6:50:01 AM (6 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
f7cecf5
Parents:
2226776
git-author:
Robert C. Helling <helling@…> (01/16/17 00:54:15)
git-committer:
Dirk Hohndel <dirk@…> (01/18/17 06:50:01)
Message:

Only set surface pressure when it has a value

When replanning a dive, do not set the surface pressure when it is 0.
Same for salinity.

This closes #161 .

Signed-off-by: Robert C. Helling <helling@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • desktop-widgets/mainwindow.cpp

    rb2cc840 rdbf1390  
    928928        divePlannerWidget()->setReplanButton(true);
    929929        divePlannerWidget()->setupStartTime(QDateTime::fromMSecsSinceEpoch(1000 * current_dive->when, Qt::UTC));
    930         divePlannerWidget()->setSurfacePressure(current_dive->surface_pressure.mbar);
    931         divePlannerWidget()->setSalinity(current_dive->salinity);
     930        if (current_dive->surface_pressure.mbar)
     931                divePlannerWidget()->setSurfacePressure(current_dive->surface_pressure.mbar);
     932        if (current_dive->salinity)
     933                divePlannerWidget()->setSalinity(current_dive->salinity);
    932934        DivePlannerPointsModel::instance()->loadFromDive(current_dive);
    933935        reset_cylinders(&displayed_dive, true);
Note: See TracChangeset for help on using the changeset viewer.