From a94fba24393211ed16f477e575c7c88c6debd549 Mon Sep 17 00:00:00 2001 From: Stefan Fuchs Date: Sat, 4 Nov 2017 09:11:16 +0100 Subject: Planner copy salinity only if current dive exists Signed-off-by: Stefan Fuchs --- desktop-widgets/mainwindow.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index bcd8f8e6e..df0a43b1b 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -979,11 +979,12 @@ void MainWindow::on_actionDivePlanner_triggered() DivePlannerPointsModel::instance()->setupStartTime(); DivePlannerPointsModel::instance()->createSimpleDive(); // plan the dive in the same mode as the currently selected one - if (current_dive) + if (current_dive) { divePlannerSettingsWidget()->setDiveMode(current_dive->dc.divemode); + if (current_dive->salinity) + divePlannerWidget()->setSalinity(current_dive->salinity); + } DivePictureModel::instance()->updateDivePictures(); - if (current_dive->salinity) - divePlannerWidget()->setSalinity(current_dive->salinity); divePlannerWidget()->setReplanButton(false); } -- cgit v1.2.3-70-g09d2