1
0
Fork 0
mirror of https://github.com/subsurface/subsurface.git synced 2025-02-19 22:16:15 +00:00

QML UI: sort GPS fixes correctly

That was silly. We have the GpsWhenRole specificly for sorting and then
didn't use it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-03-11 07:26:42 -08:00
parent 26c2dea46c
commit c4fb42f8ad

View file

@ -57,7 +57,7 @@ void run_ui()
QSortFilterProxyModel *gpsSortModel = new QSortFilterProxyModel(0); QSortFilterProxyModel *gpsSortModel = new QSortFilterProxyModel(0);
gpsSortModel->setSourceModel(&gpsListModel); gpsSortModel->setSourceModel(&gpsListModel);
gpsSortModel->setDynamicSortFilter(true); gpsSortModel->setDynamicSortFilter(true);
gpsSortModel->setSortRole(GpsListModel::GpsDateRole); gpsSortModel->setSortRole(GpsListModel::GpsWhenRole);
gpsSortModel->sort(0, Qt::DescendingOrder); gpsSortModel->sort(0, Qt::DescendingOrder);
QQmlContext *ctxt = engine.rootContext(); QQmlContext *ctxt = engine.rootContext();
ctxt->setContextProperty("diveModel", sortModel); ctxt->setContextProperty("diveModel", sortModel);