aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-09-28 23:01:37 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-10-04 09:19:10 -0700
commit2560734624d404728b28ff7c5e7e34a1006a4b36 (patch)
treea13cdb3975150931ce9812cb03cdad639986a3a2 /qt-models
parenta30e6b306f446d292b319b83892494bc23195cd9 (diff)
downloadsubsurface-2560734624d404728b28ff7c5e7e34a1006a4b36.tar.gz
Cleanup: initialize DiveListSortModel in constructor
The model was initialized in the global run_ui() function. Move that into the constructor of the class. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/divelistmodel.cpp6
1 files changed, 6 insertions, 0 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()