Skip to content

Commit

Permalink
Fix ifdef condition (#1757)
Browse files Browse the repository at this point in the history
  • Loading branch information
har13205 authored Oct 24, 2024
1 parent d97cee6 commit a4186d2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,18 @@ void ShowDeviceLocationUsingIndoorPositioning::setMapView(MapQuickView* mapView)

void ShowDeviceLocationUsingIndoorPositioning::requestBluetoothThenLocationPermissions()
{
#ifdef PERMISSIONS_PLATFORM
qApp->requestPermission(QBluetoothPermission{}, [this](const QPermission& permission)
{
Q_UNUSED(permission);
requestLocationPermissionThenSetupILDS();
});
#endif // PERMISSIONS_PLATFORM
}

void ShowDeviceLocationUsingIndoorPositioning::requestLocationPermissionThenSetupILDS()
{
#ifdef PERMISSIONS_PLATFORM
QLocationPermission locationPermission{};
locationPermission.setAccuracy(QLocationPermission::Accuracy::Precise);
locationPermission.setAvailability(QLocationPermission::Availability::WhenInUse);
Expand All @@ -114,10 +117,12 @@ void ShowDeviceLocationUsingIndoorPositioning::requestLocationPermissionThenSetu
checkPermissions();
setupIndoorsLocationDataSource();
});
#endif // PERMISSIONS_PLATFORM
}

void ShowDeviceLocationUsingIndoorPositioning::checkPermissions()
{
#ifdef PERMISSIONS_PLATFORM
if (qApp->checkPermission(QBluetoothPermission{}) == Qt::PermissionStatus::Denied)
{
emit bluetoothPermissionDenied();
Expand All @@ -130,6 +135,7 @@ void ShowDeviceLocationUsingIndoorPositioning::checkPermissions()
{
emit locationPermissionDenied();
}
#endif // PERMISSIONS_PLATFORM
}

// This function uses a helper class `IndoorsLocationDataSourceCreator` to construct the IndoorsLocationDataSource
Expand Down

0 comments on commit a4186d2

Please sign in to comment.