diff options
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; +} + |