mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Location service: move location provider into QML manager
Since we want to be able to toggle it from the QML UI that seems like a better place for it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e7b2f04bec
commit
a29e74e2e9
4 changed files with 6 additions and 4 deletions
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
GpsLocation::GpsLocation(QObject *parent)
|
GpsLocation::GpsLocation(QObject *parent)
|
||||||
{
|
{
|
||||||
QGeoPositionInfoSource *gpsSource = QGeoPositionInfoSource::createDefaultSource(parent);
|
gpsSource = QGeoPositionInfoSource::createDefaultSource(parent);
|
||||||
if (gpsSource != 0) {
|
if (gpsSource != 0) {
|
||||||
QString msg = QString("have position source %1").arg(gpsSource->sourceName());
|
QString msg = QString("have position source %1").arg(gpsSource->sourceName());
|
||||||
connect(gpsSource, SIGNAL(positionUpdated(QGeoPositionInfo)), this, SLOT(newPosition(QGeoPositionInfo)));
|
connect(gpsSource, SIGNAL(positionUpdated(QGeoPositionInfo)), this, SLOT(newPosition(QGeoPositionInfo)));
|
||||||
|
|
|
@ -14,6 +14,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QGeoPositionInfo lastPos;
|
QGeoPositionInfo lastPos;
|
||||||
|
QGeoPositionInfoSource *gpsSource;
|
||||||
void status(QString msg);
|
void status(QString msg);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
|
@ -17,7 +17,10 @@ void qmlUiShowMessage(const char *errorString)
|
||||||
|
|
||||||
QMLManager::QMLManager()
|
QMLManager::QMLManager()
|
||||||
{
|
{
|
||||||
//Initialize cloud credentials.
|
// create location manager service
|
||||||
|
locationProvider = new GpsLocation(this);
|
||||||
|
|
||||||
|
// Initialize cloud credentials.
|
||||||
setCloudUserName(prefs.cloud_storage_email);
|
setCloudUserName(prefs.cloud_storage_email);
|
||||||
setCloudPassword(prefs.cloud_storage_password);
|
setCloudPassword(prefs.cloud_storage_password);
|
||||||
setSaveCloudPassword(prefs.save_password_local);
|
setSaveCloudPassword(prefs.save_password_local);
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include "qt-models/divelistmodel.h"
|
#include "qt-models/divelistmodel.h"
|
||||||
#include "qt-mobile/qmlprofile.h"
|
#include "qt-mobile/qmlprofile.h"
|
||||||
#include "qt-mobile/gpslocation.h"
|
#include "qt-mobile/gpslocation.h"
|
||||||
GpsLocation *locationProvider;
|
|
||||||
|
|
||||||
QObject *qqWindowObject = NULL;
|
QObject *qqWindowObject = NULL;
|
||||||
|
|
||||||
|
@ -54,7 +53,6 @@ void run_ui()
|
||||||
qml_window->setHeight(1200);
|
qml_window->setHeight(1200);
|
||||||
qml_window->setWidth(800);
|
qml_window->setWidth(800);
|
||||||
#endif
|
#endif
|
||||||
locationProvider = new GpsLocation(qml_window);
|
|
||||||
qml_window->show();
|
qml_window->show();
|
||||||
qApp->exec();
|
qApp->exec();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue