summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-models/divelistmodel.cpp6
-rw-r--r--subsurface-helper.cpp5
2 files changed, 6 insertions, 5 deletions
diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp
index 9aa78f344..39f8fbc47 100644
--- a/qt-models/divelistmodel.cpp
+++ b/qt-models/divelistmodel.cpp
@@ -3,11 +3,17 @@
#include "core/qthelper.h"
#include "core/trip.h"
#include "core/settings/qPrefGeneral.h"
+#include "core/ssrf.h" // for LOG_STP
#include <QDateTime>
DiveListSortModel::DiveListSortModel(QObject *parent) : QSortFilterProxyModel(parent)
{
+ setSourceModel(DiveListModel::instance());
+ setDynamicSortFilter(true);
+ setSortRole(DiveListModel::DiveDateRole);
+ sort(0, Qt::DescendingOrder);
updateFilterState();
+ LOG_STP("run_ui diveListModel sorted");
}
void DiveListSortModel::updateFilterState()
diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp
index ba2f05703..63096e22a 100644
--- a/subsurface-helper.cpp
+++ b/subsurface-helper.cpp
@@ -99,11 +99,6 @@ void run_ui()
DiveListModel diveListModel;
LOG_STP("run_ui diveListModel started");
DiveListSortModel *sortModel = new DiveListSortModel(0);
- sortModel->setSourceModel(&diveListModel);
- sortModel->setDynamicSortFilter(true);
- sortModel->setSortRole(DiveListModel::DiveDateRole);
- sortModel->sort(0, Qt::DescendingOrder);
- LOG_STP("run_ui diveListModel sorted");
GpsListModel gpsListModel;
QSortFilterProxyModel *gpsSortModel = new QSortFilterProxyModel(nullptr);
gpsSortModel->setSourceModel(&gpsListModel);