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@atdotde.de>
This commit is contained in:
Robert C. Helling 2017-01-16 09:54:15 +01:00 committed by Dirk Hohndel
parent 22267762ce
commit dbf1390094

View file

@ -927,7 +927,9 @@ void MainWindow::on_actionReplanDive_triggered()
setApplicationState("PlanDive");
divePlannerWidget()->setReplanButton(true);
divePlannerWidget()->setupStartTime(QDateTime::fromMSecsSinceEpoch(1000 * current_dive->when, Qt::UTC));
if (current_dive->surface_pressure.mbar)
divePlannerWidget()->setSurfacePressure(current_dive->surface_pressure.mbar);
if (current_dive->salinity)
divePlannerWidget()->setSalinity(current_dive->salinity);
DivePlannerPointsModel::instance()->loadFromDive(current_dive);
reset_cylinders(&displayed_dive, true);