[gnome-software] fwupd: Prepend the vendor name to the device name if not included
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] fwupd: Prepend the vendor name to the device name if not included
- Date: Mon, 11 Dec 2017 15:30:34 +0000 (UTC)
commit 8ccb7f3b02b25fd06053c35c5b5f7ec7ad955897
Author: Richard Hughes <richard hughsie com>
Date: Mon Dec 11 14:21:42 2017 +0000
fwupd: Prepend the vendor name to the device name if not included
This makes it show a sensible thing in the GsAppRow
plugins/fwupd/gs-fwupd-app.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/plugins/fwupd/gs-fwupd-app.c b/plugins/fwupd/gs-fwupd-app.c
index 43d4a99..1efead4 100644
--- a/plugins/fwupd/gs-fwupd-app.c
+++ b/plugins/fwupd/gs-fwupd-app.c
@@ -95,8 +95,16 @@ gs_fwupd_app_set_from_device (GsApp *app, FwupdDevice *dev)
gs_app_set_metadata (app, "fwupd::Guid", guid_str);
}
if (fwupd_device_get_name (dev) != NULL) {
- gs_app_set_name (app, GS_APP_QUALITY_NORMAL,
- fwupd_device_get_name (dev));
+ g_autofree gchar *vendor_name = NULL;
+ if (g_str_has_prefix (fwupd_device_get_name (dev),
+ fwupd_device_get_vendor (dev))) {
+ vendor_name = g_strdup (fwupd_device_get_name (dev));
+ } else {
+ vendor_name = g_strdup_printf ("%s %s",
+ fwupd_device_get_vendor (dev),
+ fwupd_device_get_name (dev));
+ }
+ gs_app_set_name (app, GS_APP_QUALITY_NORMAL, vendor_name);
}
if (fwupd_device_get_summary (dev) != NULL) {
gs_app_set_summary (app, GS_APP_QUALITY_NORMAL,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]