From 9195f247c4b05a0cb849cf998355dc3ec3b65641 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 11 Nov 2015 10:54:36 -0800 Subject: Location service: move files around to fit new directory layout Signed-off-by: Dirk Hohndel --- CMakeLists.txt | 2 +- gpslocation.cpp | 32 -------------------------------- gpslocation.h | 25 ------------------------- qt-mobile/gpslocation.cpp | 32 ++++++++++++++++++++++++++++++++ qt-mobile/gpslocation.h | 25 +++++++++++++++++++++++++ subsurface-mobile-helper.cpp | 2 +- 6 files changed, 59 insertions(+), 59 deletions(-) delete mode 100644 gpslocation.cpp delete mode 100644 gpslocation.h create mode 100644 qt-mobile/gpslocation.cpp create mode 100644 qt-mobile/gpslocation.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f8e68053..2c5981202 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -348,10 +348,10 @@ if(SUBSURFACE_MOBILE) set(MOBILE_SRC qt-mobile/qmlmanager.cpp qt-mobile/qmlprofile.cpp + qt-mobile/gpslocation.cpp qt-models/divelistmodel.cpp subsurface-mobile-main.cpp subsurface-mobile-helper.cpp - gpslocation.cpp ) add_definitions(-DSUBSURFACE_MOBILE) qt5_add_resources(MOBILE_RESOURCES qt-mobile/qml/mobile-resources.qrc) diff --git a/gpslocation.cpp b/gpslocation.cpp deleted file mode 100644 index da4734897..000000000 --- a/gpslocation.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "gpslocation.h" -#include - - -GpsLocation::GpsLocation(QObject *parent) -{ - QGeoPositionInfoSource *gpsSource = QGeoPositionInfoSource::createDefaultSource(parent); - if (gpsSource != 0) { - qDebug() << "have position source" << gpsSource->sourceName(); - connect(gpsSource, SIGNAL(positionUpdated(QGeoPositionInfo)), this, SLOT(newPosition(QGeoPositionInfo))); - connect(gpsSource, SIGNAL(updateTimeout()), this, SLOT(updateTimeout())); - lastPos = gpsSource->lastKnownPosition(); - gpsSource->requestUpdate(1000); - QGeoCoordinate lastCoord = lastPos.coordinate(); - if (lastCoord.isValid()) { - qDebug() << lastCoord.toString(); - } else { - qDebug() << "invalid last position"; - } - } else { - qDebug() << "don't have GPS source"; - } -} -void GpsLocation::newPosition(QGeoPositionInfo pos) -{ - qDebug() << "received new position" << pos.coordinate().toString(); -} - -void GpsLocation::updateTimeout() -{ - qDebug() << "request to get new position timed out"; -} diff --git a/gpslocation.h b/gpslocation.h deleted file mode 100644 index 8e26fd25e..000000000 --- a/gpslocation.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef GPSLOCATION_H -#define GPSLOCATION_H - -#include -#include -#include -#include - -class GpsLocation : QObject -{ - Q_OBJECT -public: - GpsLocation(QObject *parent); - -private: - QGeoPositionInfo lastPos; - -signals: - -public slots: - void newPosition(QGeoPositionInfo pos); - void updateTimeout(); -}; - -#endif // GPSLOCATION_H diff --git a/qt-mobile/gpslocation.cpp b/qt-mobile/gpslocation.cpp new file mode 100644 index 000000000..3f47396c1 --- /dev/null +++ b/qt-mobile/gpslocation.cpp @@ -0,0 +1,32 @@ +#include "qt-mobile/gpslocation.h" +#include + + +GpsLocation::GpsLocation(QObject *parent) +{ + QGeoPositionInfoSource *gpsSource = QGeoPositionInfoSource::createDefaultSource(parent); + if (gpsSource != 0) { + qDebug() << "have position source" << gpsSource->sourceName(); + connect(gpsSource, SIGNAL(positionUpdated(QGeoPositionInfo)), this, SLOT(newPosition(QGeoPositionInfo))); + connect(gpsSource, SIGNAL(updateTimeout()), this, SLOT(updateTimeout())); + lastPos = gpsSource->lastKnownPosition(); + gpsSource->requestUpdate(1000); + QGeoCoordinate lastCoord = lastPos.coordinate(); + if (lastCoord.isValid()) { + qDebug() << lastCoord.toString(); + } else { + qDebug() << "invalid last position"; + } + } else { + qDebug() << "don't have GPS source"; + } +} +void GpsLocation::newPosition(QGeoPositionInfo pos) +{ + qDebug() << "received new position" << pos.coordinate().toString(); +} + +void GpsLocation::updateTimeout() +{ + qDebug() << "request to get new position timed out"; +} diff --git a/qt-mobile/gpslocation.h b/qt-mobile/gpslocation.h new file mode 100644 index 000000000..8e26fd25e --- /dev/null +++ b/qt-mobile/gpslocation.h @@ -0,0 +1,25 @@ +#ifndef GPSLOCATION_H +#define GPSLOCATION_H + +#include +#include +#include +#include + +class GpsLocation : QObject +{ + Q_OBJECT +public: + GpsLocation(QObject *parent); + +private: + QGeoPositionInfo lastPos; + +signals: + +public slots: + void newPosition(QGeoPositionInfo pos); + void updateTimeout(); +}; + +#endif // GPSLOCATION_H diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp index 0643ae9e0..cbffc7b1d 100644 --- a/subsurface-mobile-helper.cpp +++ b/subsurface-mobile-helper.cpp @@ -18,7 +18,7 @@ #include "qt-mobile/qmlmanager.h" #include "qt-models/divelistmodel.h" #include "qt-mobile/qmlprofile.h" -#include "gpslocation.h" +#include "qt-mobile/gpslocation.h" GpsLocation *locationProvider; QObject *qqWindowObject = NULL; -- cgit v1.2.3-70-g09d2