summaryrefslogtreecommitdiff
path: root/src/gpm-statistics.c
diff options
context:
space:
mode:
authorClement Lefebvre <[email protected]>2015-09-04 18:38:52 +0100
committerClement Lefebvre <[email protected]>2015-09-04 18:38:52 +0100
commitefd226f094d55b85f335b35e863cb487f0ae3292 (patch)
tree5ae5fa99ff3f55411c83fb52717f649d2cb8f990 /src/gpm-statistics.c
parent74f1af8766f91cadf87d976cf43a7006a7ab9132 (diff)
downloadmate-power-manager-efd226f094d55b85f335b35e863cb487f0ae3292.tar.bz2
mate-power-manager-efd226f094d55b85f335b35e863cb487f0ae3292.tar.xz
Show vendor/model information
Diffstat (limited to 'src/gpm-statistics.c')
-rw-r--r--src/gpm-statistics.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c
index a9436bd..f800cef 100644
--- a/src/gpm-statistics.c
+++ b/src/gpm-statistics.c
@@ -1216,6 +1216,7 @@ gpm_stats_add_device (UpDevice *device)
const gchar *text;
const gchar *icon;
UpDeviceKind kind;
+ gchar *label, *vendor, *model;
#if UP_CHECK_VERSION(0, 99, 0)
if (devices != NULL)
@@ -1228,17 +1229,27 @@ gpm_stats_add_device (UpDevice *device)
/* get device properties */
g_object_get (device,
"kind", &kind,
+ "vendor", &vendor,
+ "model", &model,
NULL);
id = up_device_get_object_path (device);
- text = gpm_device_kind_to_localised_text (kind, 1);
+ if ((vendor != NULL && strlen(vendor) != 0) && (model != NULL && strlen(model) != 0)) {
+ label = g_strdup_printf ("%s %s", vendor, model);
+ }
+ else {
+ label = g_strdup_printf ("%s", gpm_device_kind_to_localised_text (kind, 1));
+ }
icon = gpm_upower_get_device_icon (device);
gtk_list_store_append (list_store_devices, &iter);
gtk_list_store_set (list_store_devices, &iter,
GPM_DEVICES_COLUMN_ID, id,
- GPM_DEVICES_COLUMN_TEXT, text,
+ GPM_DEVICES_COLUMN_TEXT, label,
GPM_DEVICES_COLUMN_ICON, icon, -1);
+ g_free (label);
+ g_free (vendor);
+ g_free (model);
}
/**