Add dive: initialize start time of dive

commit f29f41ae9e ("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 <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-07-26 07:29:40 -07:00
parent fe44bc9041
commit 1863452a25

View file

@ -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;