From 97f6548cf76d2b5270d94a69c0a3cd1cef8a69f1 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Tue, 26 Jan 2010 14:35:46 +0000 Subject: [PATCH] Show the device name even when using UPower --- src/gpm-statistics.c | 14 +++----------- 1 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/gpm-statistics.c b/src/gpm-statistics.c index ce1731c..c36a90f 100644 --- a/src/gpm-statistics.c +++ b/src/gpm-statistics.c @@ -308,22 +308,14 @@ gpm_stats_bool_to_text (gboolean ret) static gchar * gpm_stats_get_printable_device_path (DkpDevice *device) { - const gchar *prefix = "/org/freedesktop/DeviceKit/Power/devices/"; const gchar *object_path; gchar *device_path = NULL; - guint len; /* get object path */ object_path = dkp_device_get_object_path (device); - if (object_path == NULL) - goto out; - if (!g_str_has_prefix (object_path, prefix)) - goto out; + if (object_path != NULL) + device_path = g_filename_display_basename (object_path); - /* trim */ - len = strlen (prefix); - device_path = g_strdup (object_path+len); -out: return device_path; } -- 1.6.5.8