aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-26 07:29:40 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-26 07:30:09 -0700
commit1863452a25b452432a8cebf8474185fd1ee28508 (patch)
tree51b2dadaa7f67b2645f24246e15bbabe445765db
parentfe44bc90416262c0da2c3c3e5d29100df2b67706 (diff)
downloadsubsurface-1863452a25b452432a8cebf8474185fd1ee28508.tar.gz
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 <dirk@hohndel.org>
-rw-r--r--qt-ui/diveplanner.cpp3
1 files changed, 3 insertions, 0 deletions
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;