aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models/divetripmodel.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-11-15 20:59:13 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-16 08:29:53 -0800
commit8a33c04894d6830885d7f47140962d5fdafd648f (patch)
treead14b83881042f4d9ec2f6dcdcc2db5d9a81fb43 /qt-models/divetripmodel.h
parentf0a89759bf38375d32ad70ba4710a98d30a47e5d (diff)
downloadsubsurface-8a33c04894d6830885d7f47140962d5fdafd648f.tar.gz
Cleanup: use DiveTripModelBase::clear() to reset the log
Introduce a DiveTripModelBase::clear() function that cleanly clears all dive data inside a beginResetModel()/endResetModel() pair. Thus, the UI will be cleanly reset and we can remove explicit calls to - graphics->setEmptyState() - mainTab->clearTabs() - mainTab->clearTabs() - diveList->reload() from MainWindow::closeCurrentFile(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/divetripmodel.h')
-rw-r--r--qt-models/divetripmodel.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/qt-models/divetripmodel.h b/qt-models/divetripmodel.h
index dc0d4b299..6b3f26fd7 100644
--- a/qt-models/divetripmodel.h
+++ b/qt-models/divetripmodel.h
@@ -70,6 +70,9 @@ public:
// by instance().
static void resetModel(Layout layout);
+ // Clear all dives
+ void clear();
+
Qt::ItemFlags flags(const QModelIndex &index) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;