summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Thébault <[email protected]>2022-02-16 22:28:57 +0100
committerRobert Antoni Buj Gelonch <[email protected]>2022-03-21 12:41:09 +0100
commit09314551f4d36a6f92c44546929ffb499d4bff87 (patch)
tree615abc644b7749c583690c302dee97cd28f14e76
parentba901df1519c14267208d0c0eeec1a022c711d7e (diff)
downloadmate-power-manager-09314551f4d36a6f92c44546929ffb499d4bff87.tar.bz2
mate-power-manager-09314551f4d36a6f92c44546929ffb499d4bff87.tar.xz
Show device model even if vendor is not available
-rw-r--r--src/gpm-statistics.c3
-rw-r--r--src/gpm-tray-icon.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c
index 0f6ad66..0b7b9fc 100644
--- a/src/gpm-statistics.c
+++ b/src/gpm-statistics.c
@@ -920,6 +920,9 @@ gpm_stats_add_device (UpDevice *device, GPtrArray *devices)
if ((vendor != NULL && strlen(vendor) != 0) && (model != NULL && strlen(model) != 0)) {
label = g_strdup_printf ("%s %s", vendor, model);
}
+ else if((vendor == NULL || strlen(vendor) == 0) && (model != NULL && strlen(model) != 0)) {
+ label = g_strdup_printf ("%s", model);
+ }
else {
label = g_strdup_printf ("%s", gpm_device_kind_to_localised_string (kind, 1));
}
diff --git a/src/gpm-tray-icon.c b/src/gpm-tray-icon.c
index 6ace66c..9f5fe38 100644
--- a/src/gpm-tray-icon.c
+++ b/src/gpm-tray-icon.c
@@ -269,6 +269,9 @@ gpm_tray_icon_add_device (GpmTrayIcon *icon, GtkMenu *menu, const GPtrArray *arr
if ((vendor != NULL && strlen(vendor) != 0) && (model != NULL && strlen(model) != 0)) {
label = g_strdup_printf ("%s %s (%.1f%%)", vendor, model, percentage);
}
+ else if((vendor == NULL || strlen(vendor) == 0) && (model != NULL && strlen(model) != 0)) {
+ label = g_strdup_printf ("%s (%.1f%%)", model, percentage);
+ }
else {
label = g_strdup_printf ("%s (%.1f%%)", gpm_device_kind_to_localised_string (kind, 1), percentage);
}