mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
a0136a3b8c
commit
6f1e071a54
1 changed files with 2 additions and 0 deletions
|
@ -764,6 +764,7 @@ void DivePlannerPointsModel::clear()
|
||||||
} else {
|
} else {
|
||||||
stagingDive = alloc_dive();
|
stagingDive = alloc_dive();
|
||||||
}
|
}
|
||||||
|
bool oldRecalc = setRecalc(false);
|
||||||
CylindersModel::instance()->setDive(stagingDive);
|
CylindersModel::instance()->setDive(stagingDive);
|
||||||
if (rowCount() > 0) {
|
if (rowCount() > 0) {
|
||||||
beginRemoveRows(QModelIndex(), 0, rowCount() - 1);
|
beginRemoveRows(QModelIndex(), 0, rowCount() - 1);
|
||||||
|
@ -771,6 +772,7 @@ void DivePlannerPointsModel::clear()
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
}
|
}
|
||||||
CylindersModel::instance()->clear();
|
CylindersModel::instance()->clear();
|
||||||
|
setRecalc(oldRecalc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivePlannerPointsModel::addDecoToModel()
|
void DivePlannerPointsModel::addDecoToModel()
|
||||||
|
|
Loading…
Reference in a new issue