From 7e82205e9b7b14e960dc1e83fcf6ef927e746fba Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Wed, 2 Sep 2020 11:10:51 +0200 Subject: Planner: Properly initialize salinity When the dive has no explicity salinity, our conversion between pressure and depth assumed salt water. Make this explicity by using the corresponding macro. When the planner starts and no salinity is set explicity, set the water type chooser to salt water to reflect our default assumption. Signed-off-by: Robert C. Helling --- desktop-widgets/mainwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'desktop-widgets') diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 87a7e1d06..5c151849f 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -895,6 +895,8 @@ void MainWindow::on_actionDivePlanner_triggered() divePlannerSettingsWidget->setBailoutVisibility(current_dive->dc.divemode); if (current_dive->salinity) divePlannerWidget->setSalinity(current_dive->salinity); + else // No salinity means salt water + divePlannerWidget->setSalinity(SEAWATER_SALINITY); } divePlannerWidget->setReplanButton(false); } -- cgit v1.2.3-70-g09d2