Planner: Update plan when deco parameters change

This makes sure that the dive plan is updated (including the
planner notes) when parameters of the dive or the planner
change.

This fixes a bug reported by Jay Anchor.

There is a chance that by partly undoing 77a6bc6d62, this
introduces too many recalculations of the plan. But without
this patch, there are definitely not enough recalculations.

Reported-by: Jay Anchor <jay.anchor-subsurface@e257.fi>
Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
Robert C. Helling 2021-05-08 22:14:54 +02:00
parent dc645ce8c6
commit 5dfc183517

View file

@ -464,6 +464,7 @@ DivePlannerPointsModel *DivePlannerPointsModel::instance()
void DivePlannerPointsModel::emitDataChanged()
{
updateDiveProfile();
emit dataChanged(createIndex(0, 0), createIndex(rowCount() - 1, COLUMNS - 1));
}
@ -1062,6 +1063,8 @@ static bool shouldComputeVariations()
void DivePlannerPointsModel::updateDiveProfile()
{
if (!d)
return;
createTemporaryPlan();
if (diveplan_empty(&diveplan))
return;