Skip to content

Commit

Permalink
Show device model even if vendor is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
Zenkibou authored and rbuj committed Mar 21, 2022
1 parent ba901df commit 0931455
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gpm-statistics.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
3 changes: 3 additions & 0 deletions src/gpm-tray-icon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0931455

Please sign in to comment.