diff options
Diffstat (limited to 'rbutil')
-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 @@ | |||
46 | 46 | ||
47 | // Linux includes | 47 | // Linux includes |
48 | #if defined(Q_OS_LINUX) | 48 | #if defined(Q_OS_LINUX) |
49 | #if defined(LIBUSB1) | ||
50 | #include <libusb-1.0/libusb.h> | 49 | #include <libusb-1.0/libusb.h> |
51 | #else | ||
52 | #include <usb.h> | ||
53 | #endif | ||
54 | #include <mntent.h> | 50 | #include <mntent.h> |
55 | #endif | 51 | #endif |
56 | 52 | ||
@@ -245,7 +241,6 @@ QMap<uint32_t, QString> System::listUsbDevices(void) | |||
245 | // usb pid detection | 241 | // usb pid detection |
246 | LOG_INFO() << "Searching for USB devices"; | 242 | LOG_INFO() << "Searching for USB devices"; |
247 | #if defined(Q_OS_LINUX) | 243 | #if defined(Q_OS_LINUX) |
248 | #if defined(LIBUSB1) | ||
249 | libusb_device **devs; | 244 | libusb_device **devs; |
250 | if(libusb_init(NULL) != 0) { | 245 | if(libusb_init(NULL) != 0) { |
251 | LOG_ERROR() << "Initializing libusb-1 failed."; | 246 | LOG_ERROR() << "Initializing libusb-1 failed."; |
@@ -285,53 +280,6 @@ QMap<uint32_t, QString> System::listUsbDevices(void) | |||
285 | 280 | ||
286 | libusb_free_device_list(devs, 1); | 281 | libusb_free_device_list(devs, 1); |
287 | libusb_exit(NULL); | 282 | libusb_exit(NULL); |
288 | #else | ||
289 | usb_init(); | ||
290 | usb_find_busses(); | ||
291 | usb_find_devices(); | ||
292 | struct usb_bus *b; | ||
293 | b = usb_busses; | ||
294 | |||
295 | while(b) { | ||
296 | if(b->devices) { | ||
297 | struct usb_device *u; | ||
298 | u = b->devices; | ||
299 | while(u) { | ||
300 | uint32_t id; | ||
301 | id = u->descriptor.idVendor << 16 | u->descriptor.idProduct; | ||
302 | // get identification strings | ||
303 | usb_dev_handle *dev; | ||
304 | QString name; | ||
305 | char string[256]; | ||
306 | int res; | ||
307 | dev = usb_open(u); | ||
308 | if(dev) { | ||
309 | if(u->descriptor.iManufacturer) { | ||
310 | res = usb_get_string_simple(dev, u->descriptor.iManufacturer, | ||
311 | string, sizeof(string)); | ||
312 | if(res > 0) | ||
313 | name += QString::fromLatin1(string) + " "; | ||
314 | } | ||
315 | if(u->descriptor.iProduct) { | ||
316 | res = usb_get_string_simple(dev, u->descriptor.iProduct, | ||
317 | string, sizeof(string)); | ||
318 | if(res > 0) | ||
319 | name += QString::fromLatin1(string); | ||
320 | } | ||
321 | usb_close(dev); | ||
322 | } | ||
323 | if(name.isEmpty()) name = tr("(no description available)"); | ||
324 | |||
325 | if(id) { | ||
326 | usbids.insertMulti(id, name); | ||
327 | LOG_INFO() << "USB:" << QString("0x%1").arg(id, 8, 16) << name; | ||
328 | } | ||
329 | u = u->next; | ||
330 | } | ||
331 | } | ||
332 | b = b->next; | ||
333 | } | ||
334 | #endif | ||
335 | #endif | 283 | #endif |
336 | 284 | ||
337 | #if defined(Q_OS_MACX) | 285 | #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 { | |||
198 | win32:static { | 198 | win32:static { |
199 | QMAKE_LFLAGS += -static-libgcc -static-libstdc++ | 199 | QMAKE_LFLAGS += -static-libgcc -static-libstdc++ |
200 | } | 200 | } |
201 | unix:!static:!libusb0:!macx { | 201 | unix:!static:!macx { |
202 | DEFINES += LIBUSB1 | ||
203 | LIBS += -lusb-1.0 | 202 | LIBS += -lusb-1.0 |
204 | } | 203 | } |
205 | unix:!static:libusb0:!macx { | ||
206 | LIBS += -lusb | ||
207 | } | ||
208 | 204 | ||
209 | unix:!macx:static { | 205 | unix:!macx:static { |
210 | # force statically linking of libusb. Libraries that are appended | 206 | # force statically linking of libusb. Libraries that are appended |
211 | # later will get linked dynamically again. | 207 | # later will get linked dynamically again. |
212 | LIBS += -Wl,-Bstatic -lusb -Wl,-Bdynamic | 208 | LIBS += -Wl,-Bstatic -lusb-1.0 -Wl,-Bdynamic |
213 | } | 209 | } |
214 | 210 | ||
215 | # if -config intel is specified use 10.5 SDK and don't build for PPC | 211 | # if -config intel is specified use 10.5 SDK and don't build for PPC |