mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
a30e6b306f
commit
2560734624
2 changed files with 6 additions and 5 deletions
|
@ -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()
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue