diff options
Diffstat (limited to 'qt-models/divelistmodel.cpp')
-rw-r--r-- | qt-models/divelistmodel.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp index 6d94b09c9..d3c4e3ce2 100644 --- a/qt-models/divelistmodel.cpp +++ b/qt-models/divelistmodel.cpp @@ -6,7 +6,7 @@ #include "core/ssrf.h" // for LOG_STP #include <QDateTime> -DiveListSortModel::DiveListSortModel(QObject *parent) : QSortFilterProxyModel(parent) +DiveListSortModel::DiveListSortModel() { setSourceModel(DiveListModel::instance()); setDynamicSortFilter(true); @@ -16,6 +16,12 @@ DiveListSortModel::DiveListSortModel(QObject *parent) : QSortFilterProxyModel(pa LOG_STP("run_ui diveListModel sorted"); } +DiveListSortModel *DiveListSortModel::instance() +{ + static DiveListSortModel self; + return &self; +} + void DiveListSortModel::updateFilterState() { if (filterString.isEmpty()) { |