diff options
author | Stefan Fuchs <sfuchs@gmx.de> | 2017-09-30 18:00:34 +0200 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-10-01 23:55:37 +0300 |
commit | 7713c7e607b11c0828decdbf35d910280153f880 (patch) | |
tree | 8e08d80032ba7cdcaa344042da7e220f217b75c5 /qt-models/diveplannermodel.cpp | |
parent | 325c4459ade70f626d6a39fecfb9e0c27f0c5cee (diff) | |
download | subsurface-7713c7e607b11c0828decdbf35d910280153f880.tar.gz |
Use helper function dive_endtime() where apropriate
Calculating dive.when + dive.duration doesn't always give the correct
endtime of a dive especially when a dive has surface interval(s) in
the middle.
Using the helper function dive_endtime() fixes this issue.
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
Diffstat (limited to 'qt-models/diveplannermodel.cpp')
-rw-r--r-- | qt-models/diveplannermodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index ca84fd597..4c60e6736 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -58,7 +58,7 @@ void DivePlannerPointsModel::setupStartTime() startTime = QDateTime::currentDateTimeUtc().addSecs(3600 + gettimezoneoffset()); if (dive_table.nr) { struct dive *d = get_dive(dive_table.nr - 1); - time_t ends = d->when + d->duration.seconds; + time_t ends = dive_endtime(d); time_t diff = ends - startTime.toTime_t(); if (diff > 0) { startTime = startTime.addSecs(diff + 3600); |