summaryrefslogtreecommitdiffstats
path: root/qt-mobile/gpslocation.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-18 18:10:58 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-11-18 18:10:58 -0800
commit0b804e5b215f94a924f0d516da25dc46a81e710d (patch)
treecc6adcefb06854dd421e498486ab3da76510a581 /qt-mobile/gpslocation.cpp
parentd70f85ce35c95115438fecd26c70dc08ae4a3dbb (diff)
downloadsubsurface-0b804e5b215f94a924f0d516da25dc46a81e710d.tar.gz
Location service: make message delivery configurable
Instead of directly using the status output for the QML UI, set up the function used to display messages to the user as part of the constructor. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/gpslocation.cpp')
-rw-r--r--qt-mobile/gpslocation.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/qt-mobile/gpslocation.cpp b/qt-mobile/gpslocation.cpp
index b109a01a3..a07239b45 100644
--- a/qt-mobile/gpslocation.cpp
+++ b/qt-mobile/gpslocation.cpp
@@ -1,5 +1,4 @@
#include "qt-mobile/gpslocation.h"
-#include "qt-mobile/qmlmanager.h"
#include "pref.h"
#include "dive.h"
#include "helpers.h"
@@ -14,8 +13,9 @@
#define GPS_FIX_ADD_URL "http://api.subsurface-divelog.org/api/dive/add/"
#define GET_WEBSERVICE_UID_URL "https://cloud.subsurface-divelog.org/webuserid/"
-GpsLocation::GpsLocation(QObject *parent)
+GpsLocation::GpsLocation(void (*showMsgCB)(const char *), QObject *parent)
{
+ showMessageCB = showMsgCB;
// create a QSettings object that's separate from the main application settings
geoSettings = new QSettings(QSettings::NativeFormat, QSettings::UserScope,
QString("org.subsurfacedivelog"), QString("subsurfacelocation"), this);
@@ -80,7 +80,8 @@ void GpsLocation::updateTimeout()
void GpsLocation::status(QString msg)
{
qDebug() << msg;
- qmlUiShowMessage(qPrintable(msg));
+ if (showMessageCB)
+ (*showMessageCB)(qPrintable(msg));
}
QString GpsLocation::getUserid(QString user, QString passwd)