diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2016-01-08 13:11:49 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-01-08 08:04:04 -0800 |
commit | 89eed5d36e611f882dbf1e2686ad389f65688fa1 (patch) | |
tree | b7e185df6424d46c9d992ea388a03d4a6b19fd7e /qt-models/gpslistmodel.h | |
parent | 7b155774c5105f84303e869317fc946b11b3e78b (diff) | |
download | subsurface-89eed5d36e611f882dbf1e2686ad389f65688fa1.tar.gz |
Untangle Library Linkage
with the adittion of gpslistmodel/location, the libraries
qt-models had a direct dependency on subsurface-core, and
subsurface-core had a direct dependency on qt-models, this is
bad.
Moving a bit of code around I'v managed to clean this out, and
also to clear a bit of uneeded code (GpsTracker and gpsTracker where
basically the same thing.)
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models/gpslistmodel.h')
-rw-r--r-- | qt-models/gpslistmodel.h | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/qt-models/gpslistmodel.h b/qt-models/gpslistmodel.h index 35a5a03c4..91a15540f 100644 --- a/qt-models/gpslistmodel.h +++ b/qt-models/gpslistmodel.h @@ -5,30 +5,6 @@ #include <QObject> #include <QAbstractListModel> -class GpsTracker -{ -private: - quint64 m_when; - qint32 m_latitude; - qint32 m_longitude; - QString m_name; - -public: - GpsTracker(struct gpsTracker *gt) - { - m_when = gt->when; - m_latitude = gt->latitude.udeg; - m_longitude = gt->longitude.udeg; - m_name = gt->name; - } - GpsTracker(); - ~GpsTracker(); - uint64_t when() const; - int32_t latitude() const; - int32_t longitude() const; - QString name() const; -}; - class GpsListModel : public QAbstractListModel { Q_OBJECT @@ -43,14 +19,14 @@ public: static GpsListModel *instance(); GpsListModel(QObject *parent = 0); - void addGpsFix(struct gpsTracker *g); + void addGpsFix(gpsTracker g); void clear(); int rowCount(const QModelIndex &parent = QModelIndex()) const; QHash<int, QByteArray> roleNames() const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - + void update(); private: - QList<GpsTracker> m_gpsFixes; + QVector<gpsTracker> m_gpsFixes; static GpsListModel *m_instance; }; |