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:
Berthold Stoeger 2021-01-23 11:46:04 +01:00 committed by Dirk Hohndel
parent d68c3d8ab5
commit 1e525244e6

View file

@ -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);