From 1863452a25b452432a8cebf8474185fd1ee28508 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 26 Jul 2014 07:29:40 -0700 Subject: [PATCH] Add dive: initialize start time of dive commit f29f41ae9ea8 ("Planner: fix start time handling") broke the start time handling for Add dive. While in actual planner mode we set the start time for the plan, we did not do this when simply adding a dive. The moment the time / date was changed (which admittedly in real life a user would most likely do) all was well, but if the user just accepted the "now + 1h" default, things went badly wrong. Fixes #658 See #655 Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index d1d4abdd0..62c4e56a4 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -69,6 +69,9 @@ void DivePlannerPointsModel::createSimpleDive() { struct gasmix gas = { 0 }; + // initialize the start time in the plan + diveplan.when = displayed_dive.when; + if (isPlanner()) // let's use the gas from the first cylinder gas = displayed_dive.cylinder[0].gasmix;