summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2018-02-23 14:52:06 +0100
committerLubomir Rintel <lkundrak@v3.sk>2018-02-23 19:47:19 +0100
commite4430e09697bc0bf5b1182732077422092a26521 (patch)
tree6aec8b705165f50e93a438a546b0b9b1e7cfc2bd
parentc17155b1b9092302187e4b6eca74b825f1806e01 (diff)
downloadNetworkManager-lr/ugly-descriptions.tar.gz
libnm/device: use the type name for description if the product is emptylr/ugly-descriptions
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.
-rw-r--r--libnm/nm-device.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libnm/nm-device.c b/libnm/nm-device.c
index 3a74c4a60a..6d01ec3b10 100644
--- a/libnm/nm-device.c
+++ b/libnm/nm-device.c
@@ -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.
*/