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>
This commit is contained in:
Dirk Hohndel 2019-09-27 16:26:54 -07:00
parent 400b218f76
commit 9ae7040a91
15 changed files with 118 additions and 89 deletions

View file

@ -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;
}