diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-01-30 17:23:41 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-03-15 16:52:17 +0000 |
commit | d5bffb5125da23718e8098441b4a4269a5cf2f33 (patch) | |
tree | 48a39ba7f833116cba7dcc7917d13d34a062949c /src/core/location_provider_qt.cpp | |
parent | 789f375411b542db3ac3be79cbe0a6153720abf1 (diff) |
Basic adaptations for 64-based
Change-Id: I11e2da206e4e59872a38c178f57a5879c1bbf229
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core/location_provider_qt.cpp')
-rw-r--r-- | src/core/location_provider_qt.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/core/location_provider_qt.cpp b/src/core/location_provider_qt.cpp index a507f32d1..5f0df2c0c 100644 --- a/src/core/location_provider_qt.cpp +++ b/src/core/location_provider_qt.cpp @@ -161,8 +161,8 @@ void QtPositioningHelper::updatePosition(const QGeoPositionInfo &pos) if (!pos.isValid()) return; Q_ASSERT(m_positionInfoSource->error() == QGeoPositionInfoSource::NoError); - device::Geoposition newPos; - newPos.error_code = device::Geoposition::ERROR_CODE_NONE; + device::mojom::Geoposition newPos; + newPos.error_code = device::mojom::Geoposition::ErrorCode::NONE; newPos.error_message.clear(); newPos.timestamp = toTime(pos.timestamp()); @@ -195,15 +195,15 @@ void QtPositioningHelper::updatePosition(const QGeoPositionInfo &pos) void QtPositioningHelper::error(QGeoPositionInfoSource::Error positioningError) { Q_ASSERT(positioningError != QGeoPositionInfoSource::NoError); - device::Geoposition newPos; + device::mojom::Geoposition newPos; switch (positioningError) { case QGeoPositionInfoSource::AccessError: - newPos.error_code = device::Geoposition::ERROR_CODE_PERMISSION_DENIED; + newPos.error_code = device::mojom::Geoposition::ErrorCode::PERMISSION_DENIED; break; case QGeoPositionInfoSource::ClosedError: case QGeoPositionInfoSource::UnknownSourceError: // position unavailable is as good as it gets in Geoposition default: - newPos.error_code = device::Geoposition::ERROR_CODE_POSITION_UNAVAILABLE; + newPos.error_code = device::mojom::Geoposition::ErrorCode::POSITION_UNAVAILABLE; break; } if (m_locationProvider) @@ -212,11 +212,11 @@ void QtPositioningHelper::error(QGeoPositionInfoSource::Error positioningError) void QtPositioningHelper::timeout() { - device::Geoposition newPos; + device::mojom::Geoposition newPos; // content::Geoposition::ERROR_CODE_TIMEOUT is not handled properly in the renderer process, and the timeout // argument used in JS never comes all the way to the browser process. // Let's just treat it like any other error where the position is unavailable. - newPos.error_code = device::Geoposition::ERROR_CODE_POSITION_UNAVAILABLE; + newPos.error_code = device::mojom::Geoposition::ErrorCode::POSITION_UNAVAILABLE; if (m_locationProvider) postToLocationProvider(base::Bind(&LocationProviderQt::updatePosition, m_locationProviderFactory.GetWeakPtr(), newPos)); } @@ -240,7 +240,7 @@ LocationProviderQt::~LocationProviderQt() } } -bool LocationProviderQt::StartProvider(bool highAccuracy) +void LocationProviderQt::StartProvider(bool highAccuracy) { QThread *guiThread = qApp->thread(); if (!m_positioningHelper) { @@ -249,7 +249,6 @@ bool LocationProviderQt::StartProvider(bool highAccuracy) } QMetaObject::invokeMethod(m_positioningHelper, "start", Qt::QueuedConnection, Q_ARG(bool, highAccuracy)); - return true; } void LocationProviderQt::StopProvider() @@ -269,7 +268,7 @@ void LocationProviderQt::SetUpdateCallback(const LocationProviderUpdateCallback& m_callback = callback; } -void LocationProviderQt::updatePosition(const device::Geoposition &position) +void LocationProviderQt::updatePosition(const device::mojom::Geoposition &position) { m_lastKnownPosition = position; m_callback.Run(this, position); |