From 5dfc18351741f31fa573005fd8d533c0aab4a592 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Sat, 8 May 2021 22:14:54 +0200 Subject: 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 77a6bc6d623148, this introduces too many recalculations of the plan. But without this patch, there are definitely not enough recalculations. Reported-by: Jay Anchor Signed-off-by: Robert C. Helling --- qt-models/diveplannermodel.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'qt-models') diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 4f4a86cdc..cdf340a3f 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -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; -- cgit v1.2.3-70-g09d2