Re: [Utopia] [patch] gvm property name changes



On Wed, 2004-05-05 at 22:45 +0200, David Zeuthen wrote:
> Hi Robert,
> 
> I've just renamed some properties in hal so here is a patch that updates
> gvm to use the new property names. In the patch there's a few fixes and
> I've also made one change you might want to consider:
> 

Here is another patch against CVS to get gvm to work with the changes in
hal wrt. handling optical discs. Please apply.

Cheers,
David
? gvm-new-hal-disc-properties.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-volume-manager/ChangeLog,v
retrieving revision 1.62
diff -u -p -r1.62 ChangeLog
--- ChangeLog	11 May 2004 19:50:29 -0000	1.62
+++ ChangeLog	13 May 2004 21:27:30 -0000
@@ -1,3 +1,8 @@
+2004-05-13  David Zeuthen  <david fubar dk>
+
+	* src/manager.c (gvm_cdrom_policy): use new volume.disc properties
+	from HAL cvs
+
 2004-05-11  Robert Love  <rml ximian com>
 
 	* configure.in: bump version to 0.9.3
Index: src/manager.c
===================================================================
RCS file: /cvs/gnome/gnome-volume-manager/src/manager.c,v
retrieving revision 1.21
diff -u -p -r1.21 manager.c
--- src/manager.c	6 May 2004 16:45:56 -0000	1.21
+++ src/manager.c	13 May 2004 21:27:31 -0000
@@ -486,14 +486,17 @@ gvm_device_is_writer (const char *udi)
 static void
 gvm_cdrom_policy (const char *udi)
 {
-	char *type, *device = NULL;
+	char *device = NULL;
+	dbus_bool_t has_audio;
+	dbus_bool_t has_data;
+	dbus_bool_t is_blank;
 
-	type = hal_device_get_property_string (hal_ctx, udi,
-					       "volume.disc_type");
-	if (!type) {
-		warn ("unable to get volume.disc_type for %s\n", udi);
-		goto out;
-	}
+	has_audio = hal_device_get_property_bool (hal_ctx, udi,
+						  "volume.disc.has_audio");
+	has_data = hal_device_get_property_bool (hal_ctx, udi,
+						  "volume.disc.has_data");
+	is_blank = hal_device_get_property_bool (hal_ctx, udi,
+						  "volume.disc.is_blank");
 
 	device = hal_device_get_property_string (hal_ctx, udi, "block.device");
 	if (!device) {
@@ -501,17 +504,14 @@ gvm_cdrom_policy (const char *udi)
 		goto out;
 	}
 
-	if (!strcmp (type, "audio")) {
+	if (has_audio && (!has_data)) {
 		gvm_run_cdplayer (device, device);
-	} else if (!strcmp (type, "mixed")) {
+	} else if (has_audio && has_data) {
 		gvm_ask_mixed (udi);
-	} else if (strcmp (type, "data") == 0 ||
-		   strncmp (type, "dvd_", 4) == 0) {
-		/** @todo hmm, not sure it's sane to mount all dvd_ disc types;
-		 *  see hal spec/source for various disc types exported */
+	} else if (has_data) {
 		if (config.automount_media)
 			gvm_device_mount (device);
-	} else if (strcmp (type, "blank") == 0) {
+	} else if (is_blank) {
 		if (gvm_device_is_writer (device))
 			gvm_run_cdburner (device, device);
 	}
@@ -520,7 +520,6 @@ gvm_cdrom_policy (const char *udi)
 
 out:
 	hal_free_string (device);
-	hal_free_string (type);
 }
 
 /*


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