mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 23:30:28 +01:00
libnm/device: use the type name for description if the product is empty
It's very likely that the product said something that was filtered out by the fixup, such as "PCI Ethernet" or "Wi-Fi Adapter". Use a generic type name in place of it.
This commit is contained in:
parent
c17155b1b9
commit
e4430e0969
1 changed files with 5 additions and 2 deletions
|
|
@ -1583,12 +1583,15 @@ ensure_description (NMDevice *device)
|
|||
g_clear_pointer (&priv->description, g_free);
|
||||
}
|
||||
|
||||
if ( !priv->short_vendor
|
||||
|| !(short_product = nm_utils_fixup_product_string (nm_device_get_product (device)))) {
|
||||
if (!priv->short_vendor) {
|
||||
priv->description = g_strdup (nm_device_get_iface (device) ?: "");
|
||||
return;
|
||||
}
|
||||
|
||||
short_product = nm_utils_fixup_product_string (nm_device_get_product (device));
|
||||
if (short_product == NULL)
|
||||
short_product = g_strdup (get_type_name (device));
|
||||
|
||||
/* Another quick hack; if all of the fixed up vendor string
|
||||
* is found in product, ignore the vendor.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue