diff options
Diffstat (limited to 'qt-models')
-rw-r--r-- | qt-models/divelistmodel.cpp | 7 | ||||
-rw-r--r-- | qt-models/divelistmodel.h | 1 |
2 files changed, 8 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(); diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h index d6eb07463..686dcd1c3 100644 --- a/qt-models/divelistmodel.h +++ b/qt-models/divelistmodel.h @@ -62,6 +62,7 @@ public: QHash<int, QByteArray> roleNames() const; QString startAddDive(); void resetInternalData(); + void clear(); // Clear all dives in core Q_INVOKABLE DiveObjectHelper at(int i); private: static DiveListModel *m_instance; |