mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
cleanup: use proper model/view semantics in DivePlannerModel
When clearing the model, use "beginResetModel/endResetModel" instead of "beginRemoveRows/endRemoveRows". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
d68c3d8ab5
commit
1e525244e6
1 changed files with 3 additions and 5 deletions
|
@ -956,11 +956,9 @@ void DivePlannerPointsModel::clear()
|
|||
bool oldRecalc = setRecalc(false);
|
||||
|
||||
cylinders.updateDive(&displayed_dive);
|
||||
if (rowCount() > 0) {
|
||||
beginRemoveRows(QModelIndex(), 0, rowCount() - 1);
|
||||
divepoints.clear();
|
||||
endRemoveRows();
|
||||
}
|
||||
beginResetModel();
|
||||
divepoints.clear();
|
||||
endResetModel();
|
||||
cylinders.clear();
|
||||
preserved_until.seconds = 0;
|
||||
setRecalc(oldRecalc);
|
||||
|
|
Loading…
Reference in a new issue