hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Tue Jan 29 09:00:56 PST 2008


 hald/linux/device.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 3543df3ea534f9e197cc766ac106561f59f821d3
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Tue Jan 29 18:00:01 2008 +0100

    fixed power_supply_compute_udi() to generate useful UDIs
    
    Fixed power_supply_compute_udi() to generate useful UDIs, including
    (if available) power_supply-type and ID of the device.

diff --git a/hald/linux/device.c b/hald/linux/device.c
index 3c5a136..93147db 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -3301,9 +3301,18 @@ power_supply_compute_udi (HalDevice *d)
 	dir = hal_device_property_get_string (d, "linux.sysfs_path");
 
 	name = hal_util_get_last_element(dir);
-	hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
-			      "%s_power_supply",
-			      hal_device_property_get_string (d, "info.parent"));
+	if (name) 
+		hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
+				      "%s_power_supply_%s_%s",
+				      hal_device_property_get_string (d, "info.parent"),
+				      hal_device_property_get_string (d, "info.category"),
+				      name);
+	else
+		hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
+				      "%s_power_supply_%s",
+				      hal_device_property_get_string (d, "info.parent"),
+				      hal_device_property_get_string (d, "info.category"));
+		
 	hal_device_set_udi (d, udi);
 	hal_device_property_set_string (d, "info.udi", udi);
 	return TRUE;


More information about the hal-commit mailing list