diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-12-30 11:12:49 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-12-30 11:12:49 +0100 |
commit | 912f7c727a4362c9530804d9bf1fd92062734af1 (patch) | |
tree | 2b8f133217b6a2b79cb2359f43db2cac3dcbd4db /src | |
parent | 7bc6e97a440bc938c042141a6b6890831ee176df (diff) | |
parent | 5ec322a7572fca8cfb3b9d4cb30bcff5fbe6eed1 (diff) | |
download | qtlocation-912f7c727a4362c9530804d9bf1fd92062734af1.tar.gz |
Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
.qmake.conf
Change-Id: Iccbd3c3f2162973d407a31b02ea6911f3c1d5b31
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/position/corelocation/qgeopositioninfosource_cl.mm | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/plugins/position/corelocation/qgeopositioninfosource_cl.mm b/src/plugins/position/corelocation/qgeopositioninfosource_cl.mm index fae16715..2d412138 100644 --- a/src/plugins/position/corelocation/qgeopositioninfosource_cl.mm +++ b/src/plugins/position/corelocation/qgeopositioninfosource_cl.mm @@ -61,6 +61,12 @@ } return self; } +- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status +{ + Q_UNUSED(manager) + if (status == kCLAuthorizationStatusNotDetermined) + m_positionInfoSource->requestUpdate(MINIMUM_UPDATE_INTERVAL); +} - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { @@ -198,22 +204,21 @@ bool QGeoPositionInfoSourceCL::enableLocationManager() // while probably a noop, the call generates a warning). // -requestWhenInUseAuthorization only requires NSLocationWhenInUseUsageDescription // entry in Info.plist (available on iOS (>= 8.0), tvOS (>= 9.0) and watchOS (>= 2.0). + } #ifndef Q_OS_MACOS - NSDictionary<NSString *, id> *infoDict = NSBundle.mainBundle.infoDictionary; - const bool hasAlwaysUseUsage = !![infoDict objectForKey:@"NSLocationAlwaysAndWhenInUseUsageDescription"]; - const bool hasWhenInUseUsage = !![infoDict objectForKey:@"NSLocationWhenInUseUsageDescription"]; + NSDictionary<NSString *, id> *infoDict = NSBundle.mainBundle.infoDictionary; + const bool hasAlwaysUseUsage = !![infoDict objectForKey:@"NSLocationAlwaysAndWhenInUseUsageDescription"]; + const bool hasWhenInUseUsage = !![infoDict objectForKey:@"NSLocationWhenInUseUsageDescription"]; #ifndef Q_OS_TVOS - if (hasAlwaysUseUsage && hasWhenInUseUsage) - [m_locationManager requestAlwaysAuthorization]; - else + if (hasAlwaysUseUsage && hasWhenInUseUsage) + [m_locationManager requestAlwaysAuthorization]; + else #endif // !Q_OS_TVOS - if (hasWhenInUseUsage) - [m_locationManager requestWhenInUseAuthorization]; + if (hasWhenInUseUsage) + [m_locationManager requestWhenInUseAuthorization]; #endif // !Q_OS_MACOS - } - return (m_locationManager != nullptr); } |