[gnome-power-manager/gnome-2-28] Show the device name even when using UPower



commit 02bf28813dbafba5a41386df4b40c0acaea5f9f6
Author: Richard Hughes <richard hughsie com>
Date:   Tue Jan 26 14:35:46 2010 +0000

    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;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]