gnome-volume-manager r1351 - in trunk: . src



Author: fejj
Date: Mon Mar 31 17:16:15 2008
New Revision: 1351
URL: http://svn.gnome.org/viewvc/gnome-volume-manager?rev=1351&view=rev

Log:
2008-03-31  Jeffrey Stedfast  <fejj novell com>

	* src/manager.c (enum): Add AUTOKEYBOARD and
	AUTOKEYBOARD_COMMAND. Fixes bug #525345.
	(gvm_run_scanner): If we can't get the scanner.device property,
	try getting the parent's linux.device_file property. Loosely based
	on Martin Pitt's Ubuntu patch. Fixes bug #525353.



Modified:
   trunk/ChangeLog
   trunk/src/manager.c

Modified: trunk/src/manager.c
==============================================================================
--- trunk/src/manager.c	(original)
+++ trunk/src/manager.c	Mon Mar 31 17:16:15 2008
@@ -1193,18 +1193,29 @@
 static void
 gvm_run_scanner (const char *udi)
 {
+	char *device, *parent;
 	DBusError error;
-	char *device;
 	
 	if (config.autoscanner_command == NULL)
 		return;
 	
 	dbus_error_init (&error);
 	if (!(device = libhal_device_get_property_string (hal_ctx, udi, "scanner.device", &error))) {
-		warn ("cannot get scanner.device property: %s", error.message);
-		if (dbus_error_is_set (&error))
-			dbus_error_free (&error);
-		return;
+		/* check parent's linux.device_file */
+		if ((parent = libhal_device_get_property_string (hal_ctx, udi, "info.parent", NULL))) {
+			if (dbus_error_is_set (&error))
+				dbus_error_free (&error);
+			dbus_error_init (&error);
+                        device = libhal_device_get_property_string (hal_ctx, parent, "linux.device_file", &error);
+			libhal_free_string (parent);
+		}
+		
+		if (!device) {
+			warn ("cannot get scanner.device property: %s", error.message);
+			if (dbus_error_is_set (&error))
+				dbus_error_free (&error);
+			return;
+		}
 	}
 	
 	gvm_run_command (config.autoscanner_command, udi, device, NULL);



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