summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-30 16:12:35 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-30 16:12:35 -0700
commit6f1e071a54224700de8f96d0eefa0ee807f886b0 (patch)
tree49557fb4aa7e58659fd82a91e33f491b24c251cd /qt-ui
parenta0136a3b8c7c20e2d28a6757d7356bbec6154a6c (diff)
downloadsubsurface-6f1e071a54224700de8f96d0eefa0ee807f886b0.tar.gz
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 <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/diveplanner.cpp2
1 files changed, 2 insertions, 0 deletions
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()