diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2019-09-27 16:26:54 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-09-27 16:26:58 -0700 |
commit | 9ae7040a91c3e3e0606d7abe085ef6da47efd6d2 (patch) | |
tree | de120b115df95fb96d945581aca41cd8c760263c /qt-models/gpslistmodel.cpp | |
parent | 400b218f769320221567b7b66f39c33126a7d2e1 (diff) | |
download | subsurface-9ae7040a91c3e3e0606d7abe085ef6da47efd6d2.tar.gz |
Revert the singleton PR
It turns out that this isn't working the way it was intended to.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models/gpslistmodel.cpp')
-rw-r--r-- | qt-models/gpslistmodel.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
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 <QVector> +GpsListModel *GpsListModel::m_instance = NULL; + GpsListModel::GpsListModel(QObject *parent) : QAbstractListModel(parent) { + m_instance = this; } -void GpsListModel::update(QVector<gpsTracker> trackers) +void GpsListModel::update() { + QVector<gpsTracker> trackers = QVector<gpsTracker>::fromList(GpsLocation::instance()->currentGPSInfo().values()); beginResetModel(); m_gpsFixes = trackers; endResetModel(); @@ -58,3 +62,9 @@ QHash<int, QByteArray> GpsListModel::roleNames() const roles[GpsLongitudeRole] = "longitude"; return roles; } + +GpsListModel *GpsListModel::instance() +{ + return m_instance; +} + |