aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models/divelistmodel.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-09-26 13:37:44 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-09-27 16:33:37 -0700
commit649ac1f83a7c2a5254363682c2c7cce9fd680ffe (patch)
tree2ed124dfded9393aa01488054f7309604bea3886 /qt-models/divelistmodel.cpp
parentf0fc1f3a56d7b4ace484d79d43089bceb64de777 (diff)
downloadsubsurface-649ac1f83a7c2a5254363682c2c7cce9fd680ffe.tar.gz
Mobile: clear dive data via model
Clearing the dive data directly in the core leaves us with an inconsistent model. Therefore, clear via the model. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/divelistmodel.cpp')
-rw-r--r--qt-models/divelistmodel.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp
index 779e695ab..6f7d69412 100644
--- a/qt-models/divelistmodel.cpp
+++ b/qt-models/divelistmodel.cpp
@@ -171,6 +171,13 @@ void DiveListModel::updateDive(int i, dive *d)
insertDive(i);
}
+void DiveListModel::clear()
+{
+ beginResetModel();
+ clear_dive_file_data();
+ endResetModel();
+}
+
void DiveListModel::reload()
{
beginResetModel();