mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 02:42:50 +00:00
kcontrol: pass descriptor by reference to libusb_get_device_descriptor()
for some reason passing a plain pointer causes a crash now, it did not when I tested it before, oh joy Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
e6e289c342
commit
9dce7fc273
1 changed files with 4 additions and 10 deletions
|
@ -360,20 +360,14 @@ MouseConfig::MouseConfig(QWidget *parent, const QVariantList &args)
|
||||||
|
|
||||||
if (cnt >= 0) {
|
if (cnt >= 0) {
|
||||||
for (int i = 0; i < cnt; i++) {
|
for (int i = 0; i < cnt; i++) {
|
||||||
libusb_device_descriptor *descriptor;
|
libusb_device_descriptor descriptor;
|
||||||
|
|
||||||
libusb_device *device = list[i];
|
libusb_device *device = list[i];
|
||||||
libusb_get_device_descriptor(device, descriptor);
|
libusb_get_device_descriptor(device, &descriptor);
|
||||||
|
|
||||||
// the docs state that libusb_device_descriptor() always successeds in libusb-1.0.16
|
|
||||||
// and newer but you never know how successfull that can be when the system is
|
|
||||||
// running out of memory for an example
|
|
||||||
if (!descriptor)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
for (int n = 0; device_table[n].idVendor; n++) {
|
for (int n = 0; device_table[n].idVendor; n++) {
|
||||||
if ( (device_table[n].idVendor == descriptor->idVendor) &&
|
if ( (device_table[n].idVendor == descriptor.idVendor) &&
|
||||||
(device_table[n].idProduct == descriptor->idProduct) ) {
|
(device_table[n].idProduct == descriptor.idProduct) ) {
|
||||||
// OK, we have a device that appears to be one of the ones we support
|
// OK, we have a device that appears to be one of the ones we support
|
||||||
LogitechMouse *mouse = new LogitechMouse( device, device_table[n].flags, this, device_table[n].Name );
|
LogitechMouse *mouse = new LogitechMouse( device, device_table[n].flags, this, device_table[n].Name );
|
||||||
settings->logitechMouseList.append(mouse);
|
settings->logitechMouseList.append(mouse);
|
||||||
|
|
Loading…
Add table
Reference in a new issue