From 6f1e071a54224700de8f96d0eefa0ee807f886b0 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 30 May 2014 16:12:35 -0700 Subject: Planner: don't recreate the dive while cleaning up the widgets Otherwise the change to the Cylinder widget would trigger a recreation of the dive in an inconsistent state. Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'qt-ui') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 76f81961f..21559a65a 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -764,6 +764,7 @@ void DivePlannerPointsModel::clear() } else { stagingDive = alloc_dive(); } + bool oldRecalc = setRecalc(false); CylindersModel::instance()->setDive(stagingDive); if (rowCount() > 0) { beginRemoveRows(QModelIndex(), 0, rowCount() - 1); @@ -771,6 +772,7 @@ void DivePlannerPointsModel::clear() endRemoveRows(); } CylindersModel::instance()->clear(); + setRecalc(oldRecalc); } void DivePlannerPointsModel::addDecoToModel() -- cgit v1.2.3-70-g09d2