From 8475d40d80eb3dac1b881410785c7276f839f0c8 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Tue, 15 Oct 2019 14:13:18 +0200 Subject: 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 --- src/bluetooth/darwin/btcentralmanager.mm | 21 +-------------------- src/bluetooth/darwin/btledeviceinquiry.mm | 8 -------- 2 files changed, 1 insertion(+), 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) { -- cgit v1.2.3