aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-models/diveplannermodel.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index a7be4b975..493188325 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -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);