summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-07 21:36:27 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-07 21:41:52 -0800
commit8a98dd485a80790cd80be9332230675b42c8051c (patch)
tree59dbe2cf9f67003708aec899710d6150beb20aae
parent2b1ffb3cc49566c8c138e1e536c8d1f25344e960 (diff)
downloadsubsurface-8a98dd485a80790cd80be9332230675b42c8051c.tar.gz
Set up model for GPS fixes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--subsurface-mobile-helper.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp
index 9d9875ead..4956a112d 100644
--- a/subsurface-mobile-helper.cpp
+++ b/subsurface-mobile-helper.cpp
@@ -17,6 +17,7 @@
#include <QSortFilterProxyModel>
#include "qt-mobile/qmlmanager.h"
#include "qt-models/divelistmodel.h"
+#include "qt-models/gpslistmodel.h"
#include "qt-mobile/qmlprofile.h"
QObject *qqWindowObject = NULL;
@@ -51,8 +52,15 @@ void run_ui()
sortModel->setDynamicSortFilter(true);
sortModel->setSortRole(DiveListModel::DiveDateRole);
sortModel->sort(0, Qt::DescendingOrder);
+ GpsListModel gpsListModel;
+ QSortFilterProxyModel *gpsSortModel = new QSortFilterProxyModel(0);
+ gpsSortModel->setSourceModel(&gpsListModel);
+ gpsSortModel->setDynamicSortFilter(true);
+ gpsSortModel->setSortRole(GpsListModel::GpsDateRole);
+ gpsSortModel->sort(0, Qt::DescendingOrder);
QQmlContext *ctxt = engine.rootContext();
ctxt->setContextProperty("diveModel", sortModel);
+ ctxt->setContextProperty("gpsModel", gpsSortModel);
engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml")));
qqWindowObject = engine.rootObjects().value(0);
if (!qqWindowObject) {