Sophie

Sophie

distrib > Mandriva > 2009.0 > x86_64 > media > main-testing-src > by-pkgid > 285d2147a4002f1ad8650cc2bf5b79c2 > files > 3

gnome-volume-manager-2.24.0-3mdv2009.0.src.rpm

--- gnome-volume-manager-2.15.0/src/manager.c.hint	2006-07-31 22:37:36.000000000 +0200
+++ gnome-volume-manager-2.15.0/src/manager.c	2006-08-01 08:36:58.000000000 +0200
@@ -708,6 +708,31 @@
 	to_be_or_not_to_be ();
 }
 
+static gboolean
+gvm_should_mount (const char *udi, gboolean default_value) {
+	char *parent_udi;
+	gboolean retval;
+
+	if (default_value == FALSE)
+		return FALSE;
+
+	retval = default_value;
+
+	/* check if automount_enabled_hint is not set */
+	parent_udi = libhal_device_get_property_string (hal_ctx, udi, "info.parent", NULL);
+
+	if ((libhal_device_property_exists (hal_ctx, parent_udi, "storage.automount_enabled_hint", NULL) &&
+		 libhal_device_get_property_bool (hal_ctx, parent_udi,
+					  "storage.automount_enabled_hint", NULL) == FALSE) ||
+	   (libhal_device_property_exists (hal_ctx, parent_udi, "storage.policy.should_mount", NULL) &&
+		 libhal_device_get_property_bool (hal_ctx, parent_udi,
+					  "storage.policy.should_mount", NULL) == FALSE))
+		retval = FALSE;
+
+	libhal_free_string (parent_udi);
+	return retval;
+}
+
 /*
  * gvm_init_config - initialize gconf client and load config data
  */
@@ -2134,7 +2159,7 @@
 			if (config.autoplay_cda)
 				gvm_run_cdplayer (udi, device, NULL);
 		} else if (has_data) {
-			if (config.automount_media && !gvm_udi_is_subfs_mount (udi))
+			if (gvm_should_mount (udi, config.automount_media) && !gvm_udi_is_subfs_mount (udi))
 				gvm_device_mount (udi, TRUE);
 		}
 	}
@@ -2859,10 +2884,14 @@
 		/* check our mounting policy */
 		if (!(drive = libhal_device_get_property_string (ctx, udi, "info.parent", NULL)))
 			continue;
+
+		
+		if (!gvm_should_mount (udi, TRUE))
+			continue;
 		
 		if (libhal_device_property_exists (ctx, drive, "storage.hotpluggable", NULL)
 		    && libhal_device_get_property_bool (ctx, drive, "storage.hotpluggable", NULL))
-			mount = config.automount_drives;
+			mount = gvm_should_mount (udi, config.automount_drives);
 		else if (libhal_device_property_exists (ctx, drive, "storage.removable", NULL)
 			 && libhal_device_get_property_bool (ctx, drive, "storage.removable", NULL))
 			mount = config.automount_media;