diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-09-28 23:31:40 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-10-04 09:19:10 -0700 |
commit | 3db50aedeaea94b7395fe6fcdb56bda9bee2f2cb (patch) | |
tree | ff4de197788d1122bba31f8d5cea67357a6ff3df /qt-models/divelistmodel.h | |
parent | 2a9a3dda20c47e74746fbfa3c6e5fd9ee919b2b3 (diff) | |
download | subsurface-3db50aedeaea94b7395fe6fcdb56bda9bee2f2cb.tar.gz |
Cleanup: Turn DiveListSortModel into classical singleton
To make this class available from QMLManager, the run_ui()
function would create the object and then set a pointer in
QMLManager. It works, but is inconsistent with the rest of
the code. Therefore, make it a classical singleton class,
which is generated on demand.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/divelistmodel.h')
-rw-r--r-- | qt-models/divelistmodel.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h index 87c5bb254..e7fb5369c 100644 --- a/qt-models/divelistmodel.h +++ b/qt-models/divelistmodel.h @@ -11,7 +11,8 @@ class DiveListSortModel : public QSortFilterProxyModel { Q_OBJECT public: - DiveListSortModel(QObject *parent = 0); + DiveListSortModel(); + static DiveListSortModel *instance(); void setSourceModel(QAbstractItemModel *sourceModel); Q_INVOKABLE void reload(); Q_INVOKABLE QString tripTitle(const QString &trip); |