diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-06-09 19:32:07 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-08-07 22:18:41 +0200 |
commit | 2fe046c38035db78610ffd0db48d8163a46cb252 (patch) | |
tree | 3a7c125338a403d04c976e7d72470e51f20fbbf1 /rbutil/rbutilqt | |
parent | 729b6e4f33419489415a6111bb98e5d95221a338 (diff) |
rbutil: Drop support for libusb0.
libusb1 is maintained and stable since years. No need to keep the old
implementation around.
Change-Id: I25a4c5643fc9a88eaad3e8f2f7e1dd705be080e0
Diffstat (limited to 'rbutil/rbutilqt')
-rw-r--r-- | rbutil/rbutilqt/base/system.cpp | 52 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.pro | 8 |
2 files changed, 2 insertions, 58 deletions
diff --git a/rbutil/rbutilqt/base/system.cpp b/rbutil/rbutilqt/base/system.cpp index 55e92908ab..c33a172eeb 100644 --- a/rbutil/rbutilqt/base/system.cpp +++ b/rbutil/rbutilqt/base/system.cpp @@ -46,11 +46,7 @@ // Linux includes #if defined(Q_OS_LINUX) -#if defined(LIBUSB1) #include <libusb-1.0/libusb.h> -#else -#include <usb.h> -#endif #include <mntent.h> #endif @@ -245,7 +241,6 @@ QMap<uint32_t, QString> System::listUsbDevices(void) // usb pid detection LOG_INFO() << "Searching for USB devices"; #if defined(Q_OS_LINUX) -#if defined(LIBUSB1) libusb_device **devs; if(libusb_init(NULL) != 0) { LOG_ERROR() << "Initializing libusb-1 failed."; @@ -285,53 +280,6 @@ QMap<uint32_t, QString> System::listUsbDevices(void) libusb_free_device_list(devs, 1); libusb_exit(NULL); -#else - usb_init(); - usb_find_busses(); - usb_find_devices(); - struct usb_bus *b; - b = usb_busses; - - while(b) { - if(b->devices) { - struct usb_device *u; - u = b->devices; - while(u) { - uint32_t id; - id = u->descriptor.idVendor << 16 | u->descriptor.idProduct; - // get identification strings - usb_dev_handle *dev; - QString name; - char string[256]; - int res; - dev = usb_open(u); - if(dev) { - if(u->descriptor.iManufacturer) { - res = usb_get_string_simple(dev, u->descriptor.iManufacturer, - string, sizeof(string)); - if(res > 0) - name += QString::fromLatin1(string) + " "; - } - if(u->descriptor.iProduct) { - res = usb_get_string_simple(dev, u->descriptor.iProduct, - string, sizeof(string)); - if(res > 0) - name += QString::fromLatin1(string); - } - usb_close(dev); - } - if(name.isEmpty()) name = tr("(no description available)"); - - if(id) { - usbids.insertMulti(id, name); - LOG_INFO() << "USB:" << QString("0x%1").arg(id, 8, 16) << name; - } - u = u->next; - } - } - b = b->next; - } -#endif #endif #if defined(Q_OS_MACX) diff --git a/rbutil/rbutilqt/rbutilqt.pro b/rbutil/rbutilqt/rbutilqt.pro index 5897743199..a251db1042 100644 --- a/rbutil/rbutilqt/rbutilqt.pro +++ b/rbutil/rbutilqt/rbutilqt.pro @@ -198,18 +198,14 @@ win32 { win32:static { QMAKE_LFLAGS += -static-libgcc -static-libstdc++ } -unix:!static:!libusb0:!macx { - DEFINES += LIBUSB1 +unix:!static:!macx { LIBS += -lusb-1.0 } -unix:!static:libusb0:!macx { - LIBS += -lusb -} unix:!macx:static { # force statically linking of libusb. Libraries that are appended # later will get linked dynamically again. - LIBS += -Wl,-Bstatic -lusb -Wl,-Bdynamic + LIBS += -Wl,-Bstatic -lusb-1.0 -Wl,-Bdynamic } # if -config intel is specified use 10.5 SDK and don't build for PPC |