mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
400b218f76
commit
9ae7040a91
15 changed files with 118 additions and 89 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue