summaryrefslogtreecommitdiff
path: root/src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* winrt: Fix crash on exitOliver Wolff2020-03-271-5/+6
| | | | | | | | | | | | Using a static ComPtr<IGeoLocationStatics> in requestAccess might cause a crash on exit as this pointer might be cleaned up after the application has exited. Make sure, that this pointer is deleted together with the rest by making it part of the d pointer. Fixes: QTBUG-80711 Change-Id: I93c09a4549967195101de07b3cef430f8cd52229 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-06-251-1/+4
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Id91b04d63ddfe46a44f377add670f704b536c183
| * winrt: Do not assert if requesting access failedOliver Wolff2019-06-241-1/+4
| | | | | | | | | | | | | | | | | | On Windows 8.1 accessing geolocation statics fails. If this happens, the function should not assert/crash, but just return false. Fixes: QTBUG-76344 Change-Id: I2dbd4734512f731ef065ec1e1e210fc22e057547 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-021-3/+1
|\ \ | |/ | | | | Change-Id: Ia0a66c229f249532e70b1548f5e618e4db4bc5ad
| * winrt: Remove incorrect asserts and fix incorrect conditionOliver Wolff2019-01-311-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setPreferredPositioningMethods and setUpdateInterval are called by init so these functions should not assert in initializing state. Additionally the early exit condition in setPreferredPositioningMethods has to be the same as in setUpdateInterval. Both cases have to return early if the locator has not been initialized. This initialization happens in init, so both states, Initializing and Initialized, are fine for further handling. Change-Id: I4ef8db7178c38299328041a8d163a1b9bbecc5b1 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* | Unify semicolon usage in Q_UNUSEDJesus Fernandez2019-01-231-1/+1
|/ | | | | Change-Id: I36dd6881b6f6f028869d63b6311cba7f52a99cc4 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* winrt: Initialize position source on first usageOliver Wolff2019-01-141-18/+54
| | | | | | | | | | | | | Loading the plugin without access to the location service will work and not error out. It is still possible to enable location service later and the backend will work as expected. This patch changes the behavior so that the pop up asking for access to the user's location data is no longer shown when the plugin is loaded, but when the backend is actually used for the first time. Change-Id: I23100f7867610c6f23b2d2ea5c15c268468949a9 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* winrt: Depend on access to service for supportedPositioningMethodsOliver Wolff2019-01-141-12/+2
| | | | | | | | | | The locator's status is only updated while a positioning session is active so it does not always reflect the correct state. By checking the access we have a more reliable way to reflect the current state. Task-number: QTBUG-66427 Change-Id: I75d2274c9efd29bf070913246738bf18a9ec5edc Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* winrt: Implement supportedPositioningMethodsChangedOliver Wolff2019-01-141-0/+10
| | | | | | Task-number: QTBUG-66427 Change-Id: I6cccb1d62c116e762e073e996e5932c7351787d9 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* winrt: Initialize status and position tokens' values in constructorOliver Wolff2019-01-141-3/+2
| | | | | | | | | Doing their initialization near the end of init() is too late because parts of init (namely setUpdateInterval and setPreferredPositioningMethods) rely on them. Change-Id: I81ea1db53aa531248f2c49b8f53f2c33b5fb954e Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* winrt: Do not emit error signal with NoErrorOliver Wolff2019-01-141-1/+4
| | | | | Change-Id: Ic90cf82b9c07377875408d0c485aa8af987323c4 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* winrt: Smaller code cleanupsOliver Wolff2019-01-141-5/+4
| | | | | | | | | - Use override where applicable - Use declaration initialization if possible - Do not use temporary variables which are not used Change-Id: I68311dfc090fa6a217814a7f801fef6764778cab Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* winrt: Check access to location service on every callOliver Wolff2019-01-141-10/+16
| | | | | | | | | | The access to location services can change while the application is running so checking the access only once does not work. If access is not granted set the proper error code. Change-Id: I00d82dd166d049363de1dc9b0ca7015bc494baf5 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* winrt: Minor changes to loggingOliver Wolff2019-01-141-2/+3
| | | | | Change-Id: Iaad7abbb668d6d0542c3697dae3544f7d8fe5c5a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* winrt: React on position source status change eventsOliver Wolff2019-01-141-54/+48
| | | | | | | | | | | Querying the position source's status is error prone as it is only updated if position tracking is active. Instead we can react on changes for this status and get updated information when it is available. Change-Id: I18d55faf6163568243d2e05d3c63f13e9e45f413 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* winrt: Minor improvements in error handlingOliver Wolff2019-01-041-2/+3
| | | | | | | | | | | - If more than 1 action is done inside runOnXamlThread any error should cause a "top level" error. - If every possible error inside runOnXamlThread gives a proper error message we do not need another error message outside of the block. Change-Id: I910f9e4bc7984e1c7e1f358eee975738ffa3bb2f Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* winrt: Implement minimumUpdateIntervalOliver Wolff2018-11-281-12/+12
| | | | | | | | | According to MSDN GeoLocator's default ReportInterval is 1 second or as frequent as the hardware can support – whichever is shorter. By using that functionality we can support minimumUpdateInterval "properly". Change-Id: Id54197babeec04c8fc0a309930b192e36d9138f8 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* winrt: Restart location handler on setUpdateInterval if necessaryOliver Wolff2018-11-281-0/+8
| | | | | | | | | | | Windows' backend will complain if we try to set the report interval while being subscribed to position changes so we have to remove this registration and redo it when the new interval is in effect. Change-Id: I5b3f23a7b6e530dd0a3f673e2b8ce6f5102b7eb1 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* winrt: Remove unneeded status change callbackOliver Wolff2018-11-281-14/+0
| | | | | | | | | | | We do not use the native callback's result but Windows' backend will complain if we try to set some of GeoLocator's properties while we are registered for status changes. By removing the callback registration we get rid of these warnings. Change-Id: Ic3829ee438c708fb4411ba94ba1202bb427e8815 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* winrt: Check availability in requestAccess on desktop buildsOliver Wolff2018-11-281-5/+39
| | | | | | | | | | | | | For some reason the native status is always Disabled for desktop builds (even though the location service is running). So with desktop builds we have to use requestAccess to gain information about the state of the location service. As the functionality is async the important parts of QWinRTFunctions are shadowed locally. Change-Id: I575ee0b161de734c29453a7a07350bc8d09720e8 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* winrt: Small code cleanupOliver Wolff2018-11-281-4/+1
| | | | | | | Windows 8.1 is no longer supported Change-Id: I00d103057a63abbcbc3ad3baa8ef93b35e07e819 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* winrt: Add nativeStatus helper functionsOliver Wolff2018-11-281-14/+18
| | | | | | | Gets rid of duplicated code. Change-Id: I4635b23c5ae431867299eeeafd4bd260f8ba156f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* winrt: Add categorized loggingOliver Wolff2018-11-281-0/+22
| | | | | Change-Id: I641690a87dab2527493c3c16ffb476e4121d9ecb Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* winrt: Make sure that Co(Un)Initialize is calledOliver Wolff2018-11-281-0/+2
| | | | | | | | | | If the QGeoPositionInfoSource is created in a command line app we cannot rely on CoInitialize having been called by the event dispatcher before. Fixes: QTBUG-71194 Change-Id: Id2a8fd22f7b4cf6e5c2629bf7dcd8319b585666e Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* winrt: Replace deprecated functionsOliver Wolff2018-11-281-20/+31
| | | | | | | | | get_Altitude and the like are marked deprecated and thus should not be used. Use proper replacement functions as advised in Microsoft's documentation. Change-Id: I2166611a3133cadf9fb110242f231d76ca517932 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* winrt: Fix setting of verticalAccuracyOliver Wolff2018-11-281-1/+1
| | | | | Change-Id: I74ce6e9433eb7ad0f065ea5c554a8c11dd690604 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* winrt: Minor code cleanupOliver Wolff2018-11-281-4/+5
| | | | | | | | - Use nullptr instead of 0 - Use recommended way of including Qt headers Change-Id: I170dbb5aa41a2dd4d10ff99c421da8a037cbe153 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Declare/Register metatype for QGeoPositionInfoPaolo Angelelli2018-03-231-4/+0
| | | | | | | | | | Instead of doing it all over the place, declare it in qgeopositioninfo.h and register it in QGeoPositionInfoSource() as well as in positioning.cpp Task-number: QTBUG-65937 Change-Id: I819af3393921bdc9ca46832d5b4181d41546dac0 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* winrt: Add error handling for GeoPositionInfoSource creationOliver Wolff2017-04-241-7/+19
| | | | | | | | | | | If something goes wrong while creating the source, the factory should return a nullptr (same as in QGeoPositionInfoSourceFactoryGipsy). One such error might be, that access to location is denied on first application start. Task-number: QTBUG-60299 Change-Id: I50e87895a74bcff856aa29a195762a83466bc5b9 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Remove support for WinRT 8.1 and Windows Phone 8.1Maurice Kalinowski2017-01-191-8/+3
| | | | | | Task-number: QTBUG-57288 Change-Id: I8ae2e044d6e4db0664cc81e216a5db505530687b Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-281-2/+19
|\ | | | | | | | | | | | | Conflicts: src/plugins/position/winrt/qgeopositioninfosource_winrt.cpp Change-Id: I44fd4bd47f97acd7ca5a0bdb235a701a59497528
| * Merge remote-tracking branch 'origin/5.6' into 5.75.7Liang Qi2016-11-241-2/+19
| |\ | | | | | | | | | Change-Id: I49b1b3fc94819b5a7f2fd1ab2481a1d8ea41586b
| | * winrt: Use backend provided timestampsMaurice Kalinowski2016-11-041-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IGeoCoordinate does provide a timestamp in system time. This value should be used to provide a timestamp to be forwarded to the user. In case the information provided is invalid, an invalid QDateTime is used for the position update. Task-number: QTBUG-56623 Change-Id: If476b41e5fd183edf33742d8e4401236a32c6037 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | winrt: Fixup for 79697d9fb63a109eb8e5098c90fd287815deb12bv5.8.0-beta1Maurice Kalinowski2016-10-241-1/+2
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-56340 Change-Id: I9a3876d413d0d93d9ad74332677ff0244fb2e00a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | winrt: Code cleanupMaurice Kalinowski2016-10-241-1/+1
| | | | | | | | | | | | | | | Change-Id: Ibc2db9fa2e662a8be215556b0db056119340f593 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | winrt: Add direction to position informationMaurice Kalinowski2016-10-061-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | QGeoPositionInfo::Direction matches to IGeoCoordinate::heading, both in degrees to true north. Task-number: QTBUG-56340 Change-Id: I9f3a5a207dd781d367096e8c04a2e3b09e64ea05 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | | Fix namespaced build of QtMaurice Kalinowski2016-06-101-2/+2
|/ / | | | | | | | | Change-Id: I38dda74ec97a0172c1127d7c1758d100aeb849d1 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | winrt: Enable compilation with desktop mkspecMaurice Kalinowski2016-05-181-1/+13
|/ | | | | | | | | | | The GeoPosition API is functional for desktop builds as well, running on Windows 8 and later. While the plugin builds for desktop, do not enable its compilation by default as support is experimental. Change-Id: I5ccd3f857ff3f0cfd1e220875c39883b89f5f2ce Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* WinRT: Refactor backendMaurice Kalinowski2015-12-091-100/+227
| | | | | | | | | | | | | | | | - Move members into private class to clean up the public backend. - Beware of the Xaml changes and switch thread where required. - Add updateSynchronized() slot to be able to start/stop timers properly. onPositionChanged is invoked from another thread, actually one not being created by QThread. Hence other singleShot mechanisms do not work either. - Rename classnames to properly spell WinRT. - Register QGeoPositionInfo to the metatype system like on other backends. Change-Id: Ic62beddff6d8542264a44ca3927ba7b692682c63 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Updated WinRT license headers to use LGPLv3 instead of LGPLv21Jani Heikkinen2015-05-201-10/+13
| | | | | | | | From 5.5.0 -> WinRT port is licensed with LGPLv3, see http://blog.qt.io/blog/2015/04/29/windows-10-support-in-qt/ Change-Id: I267f2c70cd7f365464bc596ac5dcb8503219cdbd Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-03-171-0/+5
|\ | | | | | | Change-Id: Ia4c1dbe6ca0c852bee6f0e5bc96fec6f7cde87e0
| * WinPhone: Disallow update interval of 0 msMaurice Kalinowski2015-03-061-0/+5
| | | | | | | | | | | | | | | | | | | | Windows Phone does not allow to set the update interval to 0 ms. However, instead of failing when the value is set, initiating the positionChanged will afterwards fail with E_ABORTED Task-number: QTBUG-44572 Change-Id: I1d7fc79fba46a550ac388b39991aa673cf01ae7b Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-03-031-1/+5
|\ \ | |/ | | | | Change-Id: I247820c085a1e5fa95e412b20ad0ecd9a857f19e
| * WinRT: Set default timeout value properlyMaurice Kalinowski2015-02-241-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If no timeout is specified according, the docs state that a 'reasonable' timeout period is used. However, that stayed 0 on WinRT so far. Now this is set to two minutes in case GPS needs to completely start, this value is copied from the Android implementation. Task-number: QTBUG-44572 Change-Id: Iacd33772339744d3099422455a1fe9b3a4ceef07 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Andrew Knight <qt@panimo.net> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Update contact URL in all license headers to qt.ioAlex Blasche2015-02-181-1/+1
| | | | | | | | | | Change-Id: Ia1e333be7fec8898de609d9b9303b1ad7687632e Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* | Update BSD and LGPLv2.1 licensesAlex Blasche2015-02-181-3/+3
| | | | | | | | | | | | | | | | - Removes subsidiary extension from Qt Company - Replaces remaining occurrences of Digia in BSD and LGPLv2.1 Change-Id: I7467a6744af7d1c3aef3c29118f219399162a18c Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* | Update all LGPLv2.1 license headers in source to latest versionAlex Blasche2015-02-151-4/+4
|/ | | | | | | | | | | This affects all QtPositioning related code and the test code in the entire repository. The Qt Company is set as new copyright owner and the copyright year is bumped to 2015. Change-Id: Iee0e990680683c20f5920e49cc1063ea9349e2cd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update license headers and add new license filesAntti Kokko2014-08-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: Iedee2507ab1bd46788409a98505d7be510253110 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Implement WinRT plugin for positioningMaurice Kalinowski2014-05-231-0/+392
[ChangeLog][QtPositioning][QGeoPositionInfoSource] WinRT backend added. Change-Id: I00e7725a082aa485c3ab5afcaebd20344b48e07d Reviewed-by: Alex Blasche <alexander.blasche@digia.com>