Reimplement the internal repesentation of GPS fixes

Instead of using the Settings as our data structure and constantly accessing
them, we now have a QMap for the GPS fixes and only access the Settings to keep
them in sync with the QMap. This should significantly speed things up.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-01-09 14:07:58 -08:00
parent 7701975d98
commit 33142ed7f8
3 changed files with 110 additions and 129 deletions

View file

@ -1,5 +1,6 @@
#include "gpslistmodel.h"
#include "helpers.h"
#include <QVector>
GpsListModel *GpsListModel::m_instance = NULL;
@ -17,7 +18,7 @@ void GpsListModel::addGpsFix(gpsTracker g)
void GpsListModel::update()
{
QVector<gpsTracker> trackers = GpsLocation::instance()->currentGPSInfo();
QVector<gpsTracker> trackers = QVector<gpsTracker>::fromList(GpsLocation::instance()->currentGPSInfo().values());
beginResetModel();
m_gpsFixes = trackers;
endResetModel();