mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-18 01:22:38 -05:00
Handle multiple devices with identical USB IDs correctly when listing.
Use insertMulti() instead of insert() when adding found USB devices to the list. This means the keys of the list will now be ambiguous. This is not a problem since the value is only used to display the user a nice string. Previously we'd loose two identical devices attached to the system since the second one would overwrite the first. This does not apply for Windows, since Windows will list each function of a composite device. This results in a device running Rockbox (with HID enabled) showing up twice, which isn't wanted. Change-Id: I1306b71122a210c55871ff8e14d2b5a04012cc4e
This commit is contained in:
parent
935c7fbff7
commit
f3b56eba58
1 changed files with 3 additions and 3 deletions
|
|
@ -276,7 +276,7 @@ QMap<uint32_t, QString> System::listUsbDevices(void)
|
|||
if(name.isEmpty())
|
||||
name = tr("(no description available)");
|
||||
if(id) {
|
||||
usbids.insert(id, name);
|
||||
usbids.insertMulti(id, name);
|
||||
qDebug("[System] USB: 0x%08x, %s", id, name.toLocal8Bit().data());
|
||||
}
|
||||
}
|
||||
|
|
@ -322,7 +322,7 @@ QMap<uint32_t, QString> System::listUsbDevices(void)
|
|||
if(name.isEmpty()) name = tr("(no description available)");
|
||||
|
||||
if(id) {
|
||||
usbids.insert(id, name);
|
||||
usbids.insertMulti(id, name);
|
||||
qDebug() << "[System] USB:" << QString("0x%1").arg(id, 8, 16) << name;
|
||||
}
|
||||
u = u->next;
|
||||
|
|
@ -403,7 +403,7 @@ QMap<uint32_t, QString> System::listUsbDevices(void)
|
|||
}
|
||||
|
||||
if(id) {
|
||||
usbids.insert(id, name);
|
||||
usbids.insertMulti(id, name);
|
||||
qDebug() << "[System] USB:" << QString("0x%1").arg(id, 8, 16) << name;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue