hal/hald/linux block_class_device.c,1.78,1.79

David Zeuthen david at freedesktop.org
Fri Sep 24 15:27:22 PDT 2004


Update of /cvs/hal/hal/hald/linux
In directory gabe:/tmp/cvs-serv16023/hald/linux

Modified Files:
	block_class_device.c 
Log Message:
2004-09-25  David Zeuthen  <david at fubar.dk>

	* configure.in: Added fr to ALL_LINGUAS

	* po/fr.op: Added french translations from Jérôme Lodewyck 
	<lodewyck at clipper.ens.fr>

	* libhal-storage/libhal-storage.h: Add prototypes for new functions
	hal_drive_(requires_eject|get_dedication_icon_(drive|volume)).

	* libhal-storage/libhal-storage.c (hal_storage_policy_lookup_icon): 
	Remove printf debug statement.
	(hal_drive_get_dedicated_icon_drive): New function
	(hal_drive_get_dedicated_icon_volume): New function
	(hal_drive_from_udi): Read storage.icon.* and storage.requires_eject
	(hal_drive_requires_eject): New function

	* hald/linux/block_class_device.c (block_class_pre_process): Add
	and set boolean property storage.requires_eject; right now we
	only add it for optical drives. Interestingly enough, my iPod Mini
	requires to be ejected as well (see RH bug #132195 for some
	discussion). 

	* doc/spec/hal-spec.xml.in: Add docs for storage.requires_eject, 
	storage.icon.drive and storage.icon.volume



Index: block_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/block_class_device.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- block_class_device.c	24 Sep 2004 06:19:42 -0000	1.78
+++ block_class_device.c	24 Sep 2004 22:27:20 -0000	1.79
@@ -1112,6 +1112,7 @@
 	const char *device_file;
 	dbus_bool_t has_removable_media = FALSE;
 	dbus_bool_t is_hotpluggable = FALSE;
+	dbus_bool_t requires_eject = FALSE;
 	char attr_path[SYSFS_PATH_MAX];
 	struct sysfs_attribute *attr;
 
@@ -1588,26 +1589,24 @@
 	hal_device_property_set_bool (stordev, "storage.removable", has_removable_media);
 
 	if (hal_device_has_property (stordev, "storage.drive_type") &&
-	    strcmp (hal_device_property_get_string (stordev, "storage.drive_type"), 
-		    "cdrom") == 0) {
+	    strcmp (hal_device_property_get_string (stordev, "storage.drive_type"), "cdrom") == 0) {
 		cdrom_get_properties (stordev, device_file);
 		hal_device_add_capability (stordev, "storage.cdrom");
 		hal_device_property_set_bool (stordev, "storage.no_partitions_hint", TRUE);
+		requires_eject = TRUE;
 	}
 
 
 	if (hal_device_has_property (stordev, "storage.drive_type") &&
-	    strcmp (hal_device_property_get_string (stordev, "storage.drive_type"), 
-		    "floppy") == 0) {
+	    strcmp (hal_device_property_get_string (stordev, "storage.drive_type"), "floppy") == 0) {
 		hal_device_property_set_bool (stordev, "storage.no_partitions_hint", TRUE);
 	}
 
 	hal_device_property_set_string (stordev, "info.category", "storage");
 	hal_device_add_capability (stordev, "storage");
 
-	hal_device_property_set_bool (stordev, "storage.hotpluggable",
-				      is_hotpluggable);
-
+	hal_device_property_set_bool (stordev, "storage.hotpluggable", is_hotpluggable);
+	hal_device_property_set_bool (stordev, "storage.requires_eject", requires_eject);
 	hal_device_property_set_bool (stordev, "block.no_partitions", 
 				      hal_device_property_get_bool (
 					      stordev, "storage.no_partitions_hint"));




More information about the hal-commit mailing list