summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2019-10-15 14:13:18 +0200
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2019-10-20 20:56:12 +0200
commit8475d40d80eb3dac1b881410785c7276f839f0c8 (patch)
tree5f219a5a209eb90d73e60a050a78e7a28c615d1f
parentc0678181cd1a573c0e8af8e7c4e82c9fd03aa6cf (diff)
CoreBluetooth: get rid of outdated ifdefs
SDK >= 10.13 is required now, so we can get rid of ifdefs/dead code (old, deprecated constants). Change-Id: I98e8e22e1d707ccfc93c18773fb371767ea82f49 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--src/bluetooth/darwin/btcentralmanager.mm21
-rw-r--r--src/bluetooth/darwin/btledeviceinquiry.mm8
2 files changed, 1 insertions, 28 deletions
diff --git a/src/bluetooth/darwin/btcentralmanager.mm b/src/bluetooth/darwin/btcentralmanager.mm
index dd3cbb73..894243dc 100644
--- a/src/bluetooth/darwin/btcentralmanager.mm
+++ b/src/bluetooth/darwin/btcentralmanager.mm
@@ -1229,13 +1229,7 @@ QT_USE_NAMESPACE
#pragma clang diagnostic ignored "-Wunguarded-availability-new"
const auto state = central.state;
-#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13)
- if (state == CBManagerStateUnknown
- || state == CBManagerStateResetting) {
-#else
- if (state == CBCentralManagerStateUnknown
- || state == CBCentralManagerStateResetting) {
-#endif
+ if (state == CBManagerStateUnknown || state == CBManagerStateResetting) {
// We still have to wait, docs say:
// "The current state of the central manager is unknown;
// an update is imminent." or
@@ -1245,11 +1239,7 @@ QT_USE_NAMESPACE
}
// Let's check some states we do not like first:
-#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13)
if (state == CBManagerStateUnsupported || state == CBManagerStateUnauthorized) {
-#else
- if (state == CBCentralManagerStateUnsupported || state == CBCentralManagerStateUnauthorized) {
-#endif
if (managerState == CentralManagerUpdating) {
// We tried to connect just to realize, LE is not supported. Report this.
managerState = CentralManagerIdle;
@@ -1266,12 +1256,7 @@ QT_USE_NAMESPACE
return;
}
-#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13)
if (state == CBManagerStatePoweredOff) {
-#else
- if (state == CBCentralManagerStatePoweredOff) {
-#endif
-
if (managerState == CentralManagerUpdating) {
managerState = CentralManagerIdle;
// I've seen this instead of Unsupported on OS X.
@@ -1288,11 +1273,7 @@ QT_USE_NAMESPACE
return;
}
-#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13)
if (state == CBManagerStatePoweredOn) {
-#else
- if (state == CBCentralManagerStatePoweredOn) {
-#endif
if (managerState == CentralManagerUpdating && !disconnectPending) {
managerState = CentralManagerIdle;
[self retrievePeripheralAndConnect];
diff --git a/src/bluetooth/darwin/btledeviceinquiry.mm b/src/bluetooth/darwin/btledeviceinquiry.mm
index b3f29035..0f9f02b8 100644
--- a/src/bluetooth/darwin/btledeviceinquiry.mm
+++ b/src/bluetooth/darwin/btledeviceinquiry.mm
@@ -220,11 +220,7 @@ QT_USE_NAMESPACE
[manager scanForPeripheralsWithServices:nil options:nil];
} // Else we ignore.
-#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13)
} else if (state == CBManagerStateUnsupported || state == CBManagerStateUnauthorized) {
-#else
- } else if (state == CBCentralManagerStateUnsupported || state == CBCentralManagerStateUnauthorized) {
-#endif
if (internalState == InquiryActive) {
[self stopScanSafe];
// Not sure how this is possible at all,
@@ -237,11 +233,7 @@ QT_USE_NAMESPACE
}
[manager setDelegate:nil];
-#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_10_0) || QT_OSX_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_13)
} else if (state == CBManagerStatePoweredOff) {
-#else
- } else if (state == CBCentralManagerStatePoweredOff) {
-#endif
#ifndef Q_OS_MACOS
if (internalState == InquiryStarting) {