mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Planner: fix start time handling
We setup the startTime for the dive plan in too many places... but never actually copied it into the planned dive. Fixes #640 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
95466cb245
commit
f29f41ae9e
2 changed files with 1 additions and 4 deletions
|
@ -262,6 +262,7 @@ static void create_dive_from_plan(struct diveplan *diveplan, bool track_gas)
|
|||
// displayed dive so we can restart
|
||||
reset_cylinders(&displayed_dive, track_gas);
|
||||
dc = &displayed_dive.dc;
|
||||
dc->when = displayed_dive.when = diveplan->when;
|
||||
free(dc->sample);
|
||||
dc->sample = NULL;
|
||||
dc->samples = 0;
|
||||
|
|
|
@ -69,9 +69,6 @@ void DivePlannerPointsModel::createSimpleDive()
|
|||
{
|
||||
struct gasmix gas = { 0 };
|
||||
|
||||
// set the start time of the plan
|
||||
diveplan.when = displayed_dive.when;
|
||||
|
||||
if (isPlanner())
|
||||
// let's use the gas from the first cylinder
|
||||
gas = displayed_dive.cylinder[0].gasmix;
|
||||
|
@ -666,7 +663,6 @@ int DivePlannerPointsModel::rowCount(const QModelIndex &parent) const
|
|||
DivePlannerPointsModel::DivePlannerPointsModel(QObject *parent) : QAbstractTableModel(parent), mode(NOTHING)
|
||||
{
|
||||
memset(&diveplan, 0, sizeof(diveplan));
|
||||
startTime = QDateTime::currentDateTimeUtc();
|
||||
}
|
||||
|
||||
DivePlannerPointsModel *DivePlannerPointsModel::instance()
|
||||
|
|
Loading…
Add table
Reference in a new issue