aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2021-05-08 22:14:54 +0200
committerGravatar Robert C. Helling <helling@atdotde.de>2021-05-12 10:02:47 +0200
commit5dfc18351741f31fa573005fd8d533c0aab4a592 (patch)
treeb0b75e1f6984a665004277b07e12e5993e606066 /qt-models
parentdc645ce8c672af8d8166c27ff581ae44994faf6d (diff)
downloadsubsurface-5dfc18351741f31fa573005fd8d533c0aab4a592.tar.gz
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 <jay.anchor-subsurface@e257.fi> Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/diveplannermodel.cpp3
1 files changed, 3 insertions, 0 deletions
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;