Added
Link Here
|
1 |
--- src/gui/osutils/nixutils/DeviceListenerLibUsb.cpp.orig 2024-05-23 07:16:45 UTC |
2 |
+++ src/gui/osutils/nixutils/DeviceListenerLibUsb.cpp |
3 |
@@ -66,7 +66,7 @@ int DeviceListenerLibUsb::registerHotplugCallback(bool |
4 |
events |= LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT; |
5 |
} |
6 |
|
7 |
- int handle = 0; |
8 |
+ Handle handle = 0; |
9 |
const QPointer that = this; |
10 |
const int ret = libusb_hotplug_register_callback( |
11 |
static_cast<libusb_context*>(m_ctx), |
12 |
@@ -84,7 +84,7 @@ int DeviceListenerLibUsb::registerHotplugCallback(bool |
13 |
return 0; |
14 |
}, |
15 |
that, |
16 |
- &handle); |
17 |
+ reinterpret_cast<libusb_hotplug_callback_handle *>(&handle)); |
18 |
if (ret != LIBUSB_SUCCESS) { |
19 |
qWarning("Failed to register USB listener callback."); |
20 |
handle = 0; |
21 |
@@ -102,12 +102,12 @@ int DeviceListenerLibUsb::registerHotplugCallback(bool |
22 |
return handle; |
23 |
} |
24 |
|
25 |
-void DeviceListenerLibUsb::deregisterHotplugCallback(int handle) |
26 |
+void DeviceListenerLibUsb::deregisterHotplugCallback(Handle handle) |
27 |
{ |
28 |
if (!m_ctx || !m_callbackHandles.contains(handle)) { |
29 |
return; |
30 |
} |
31 |
- libusb_hotplug_deregister_callback(static_cast<libusb_context*>(m_ctx), handle); |
32 |
+ libusb_hotplug_deregister_callback(static_cast<libusb_context*>(m_ctx), (libusb_hotplug_callback_handle)handle); |
33 |
m_callbackHandles.remove(handle); |
34 |
|
35 |
if (m_callbackHandles.isEmpty() && m_usbEvents.isRunning()) { |