In preparation for a different SpiceUsbDevice. With the new SpiceUsbDeviceInfo, <vid,pid> will be provided by SpiceUsbDevice, and not by the device_descriptor (from libusb) --- gtk/usb-device-manager.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c index 9f29c76..04c3169 100644 --- a/gtk/usb-device-manager.c +++ b/gtk/usb-device-manager.c @@ -1031,25 +1031,30 @@ gchar *spice_usb_device_get_description(SpiceUsbDevice *_device, const gchar *fo #ifdef USE_USBREDIR libusb_device *device = (libusb_device *)_device; struct libusb_device_descriptor desc; - int bus, address; + int bus, address, vid, pid; gchar *description, *descriptor, *manufacturer = NULL, *product = NULL; g_return_val_if_fail(device != NULL, NULL); bus = libusb_get_bus_number(device); address = libusb_get_device_address(device); + vid = -1; + pid = -1; if (libusb_get_device_descriptor(device, &desc) == LIBUSB_SUCCESS) { - spice_usb_util_get_device_strings(bus, address, - desc.idVendor, desc.idProduct, - &manufacturer, &product); + vid = desc.idVendor; + pid = desc.idProduct; + } + + if ((vid > 0) && (pid > 0)) { descriptor = g_strdup_printf("[%04x:%04x]", desc.idVendor, desc.idProduct); } else { - spice_usb_util_get_device_strings(bus, address, -1, -1, - &manufacturer, &product); descriptor = g_strdup(""); } + spice_usb_util_get_device_strings(bus, address, vid, pid, + &manufacturer, &product); + if (!format) format = _("%s %s %s at %d-%d"); -- 1.7.1 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel