forked from qt-creator/qt-creator
Ios: Fix compiler warnings
- avoid deprecated API - remove unused variable Change-Id: I33850ea2dda523900ead191542eadf65338d5210 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -486,7 +486,12 @@ void IosDeviceManager::monitorAvailableDevices()
|
||||
CFRelease( cfProductIdMaskValue );
|
||||
}
|
||||
|
||||
IONotificationPortRef notificationPort = IONotificationPortCreate(kIOMasterPortDefault);
|
||||
#if QT_MACOS_DEPLOYMENT_TARGET_BELOW(120000)
|
||||
const mach_port_t port = kIOMasterPortDefault; // deprecated in macOS 12
|
||||
#else
|
||||
const mach_port_t port = kIOMainPortDefault; // available since macOS 12
|
||||
#endif
|
||||
IONotificationPortRef notificationPort = IONotificationPortCreate(port);
|
||||
CFRunLoopSourceRef runLoopSource = IONotificationPortGetRunLoopSource(notificationPort);
|
||||
|
||||
CFRunLoopAddSource(CFRunLoopGetCurrent(), runLoopSource, kCFRunLoopDefaultMode);
|
||||
@@ -495,16 +500,14 @@ void IosDeviceManager::monitorAvailableDevices()
|
||||
CFRetain(matchingDictionary);
|
||||
|
||||
// Now set up a notification to be called when a device is first matched by I/O Kit.
|
||||
kern_return_t kr;
|
||||
kr = IOServiceAddMatchingNotification(notificationPort,
|
||||
IOServiceAddMatchingNotification(notificationPort,
|
||||
kIOMatchedNotification,
|
||||
matchingDictionary,
|
||||
deviceConnectedCallback,
|
||||
NULL,
|
||||
&gAddedIter);
|
||||
|
||||
|
||||
kr = IOServiceAddMatchingNotification(notificationPort,
|
||||
IOServiceAddMatchingNotification(notificationPort,
|
||||
kIOTerminatedNotification,
|
||||
matchingDictionary,
|
||||
deviceDisconnectedCallback,
|
||||
|
Reference in New Issue
Block a user