From c7dcd7fbf0173fb665e5b9c348e0ead7f969e827 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 27 Feb 2021 22:27:47 +0100 Subject: planner: don't clear recalc in DivePlannerPointsModel::clear() There are no more external users of this flag, therefore clearing that flag is a no-op. Moreover, clear the cylinders array and the preserved_until flag befor emitting the model-reset signal. Signed-off-by: Berthold Stoeger --- qt-models/diveplannermodel.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'qt-models') diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 7019472c7..082b5d5d4 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -995,14 +995,11 @@ bool DivePlannerPointsModel::tankInUse(int cylinderid) const void DivePlannerPointsModel::clear() { - bool oldrec = std::exchange(recalc, false); - + cylinders.clear(); + preserved_until.seconds = 0; beginResetModel(); divepoints.clear(); endResetModel(); - cylinders.clear(); - preserved_until.seconds = 0; - recalc = oldrec; } void DivePlannerPointsModel::createTemporaryPlan() -- cgit v1.2.3-70-g09d2