From 9ae7040a91c3e3e0606d7abe085ef6da47efd6d2 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 27 Sep 2019 16:26:54 -0700 Subject: Revert the singleton PR It turns out that this isn't working the way it was intended to. Signed-off-by: Dirk Hohndel --- qt-models/gpslistmodel.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'qt-models/gpslistmodel.cpp') diff --git a/qt-models/gpslistmodel.cpp b/qt-models/gpslistmodel.cpp index 7849561d3..8d874d67b 100644 --- a/qt-models/gpslistmodel.cpp +++ b/qt-models/gpslistmodel.cpp @@ -3,12 +3,16 @@ #include "core/qthelper.h" #include +GpsListModel *GpsListModel::m_instance = NULL; + GpsListModel::GpsListModel(QObject *parent) : QAbstractListModel(parent) { + m_instance = this; } -void GpsListModel::update(QVector trackers) +void GpsListModel::update() { + QVector trackers = QVector::fromList(GpsLocation::instance()->currentGPSInfo().values()); beginResetModel(); m_gpsFixes = trackers; endResetModel(); @@ -58,3 +62,9 @@ QHash GpsListModel::roleNames() const roles[GpsLongitudeRole] = "longitude"; return roles; } + +GpsListModel *GpsListModel::instance() +{ + return m_instance; +} + -- cgit v1.2.3-70-g09d2