mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 17:40:08 +01:00
Currently if we have two paired bluetooth devices,
nm_device_disambiguate_names() will disambiguate them by their hardware address. This is not very helpful, so detect this case and use the Bluetooth device name instead. This function is used by System Settings when showing the list of network devices. https://bugzilla.gnome.org/show_bug.cgi?id=740553 (Port of a libnm-gtk patch written by Ryan Lortie.)
This commit is contained in:
parent
9d3e0cff9f
commit
8bbda5cdff
1 changed files with 19 additions and 0 deletions
|
|
@ -1813,6 +1813,25 @@ nm_device_disambiguate_names (NMDevice **devices,
|
|||
if (!find_duplicates (names, duplicates, num_devices))
|
||||
goto done;
|
||||
|
||||
/* If dealing with Bluetooth devices, try to distinguish them by
|
||||
* device name.
|
||||
*/
|
||||
for (i = 0; i < num_devices; i++) {
|
||||
if (duplicates[i] && NM_IS_DEVICE_BT (devices[i])) {
|
||||
const char *devname = nm_device_bt_get_name (NM_DEVICE_BT (devices[i]));
|
||||
|
||||
if (!devname)
|
||||
continue;
|
||||
|
||||
g_free (names[i]);
|
||||
names[i] = g_strdup_printf ("%s (%s)",
|
||||
get_device_type_name_with_iface (devices[i]),
|
||||
devname);
|
||||
}
|
||||
}
|
||||
if (!find_duplicates (names, duplicates, num_devices))
|
||||
goto done;
|
||||
|
||||
/* We have multiple identical network cards, so we have to differentiate
|
||||
* them by interface name.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue