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



Author: fejj
Date: Tue Sep 23 21:49:06 2008
New Revision: 1409
URL: http://svn.gnome.org/viewvc/gnome-volume-manager?rev=1409&view=rev

Log:
2008-09-23  Jeffrey Stedfast  <fejj novell com>

	Based on the patch by Herbert PÃtzl

	* src/manager.c (unmount_all): Don't unmount any volumes that have
	become marked with volume.ignore.
	(gvm_device_mounted): If a volume marked for ignore gets mounted,
	don't prompt the user for anything.



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

Modified: trunk/src/manager.c
==============================================================================
--- trunk/src/manager.c	(original)
+++ trunk/src/manager.c	Tue Sep 23 21:49:06 2008
@@ -1912,6 +1912,10 @@
 	GvmPromptCtx *ctx;
 	DBusError error;
 	
+	/* no-op for ignored volumes */
+	if (libhal_device_get_property_bool (hal_ctx, udi, "volume.ignore", NULL))
+		return;
+	
 	dbus_error_init (&error);
 	if (!(device = libhal_device_get_property_string (hal_ctx, udi, "block.device", &error))) {
 		warn ("cannot get block.device: %s", error.message);
@@ -3117,6 +3121,10 @@
 	GSList *l, *n;
 #endif
 	
+	/* don't add ignored volumes to our mounted_volumes list */
+	if (libhal_device_get_property_bool (hal_ctx, udi, "volume.ignore", NULL))
+		return;
+	
 	if (strcmp (key, "volume.is_mounted") != 0)
 		return;
 	
@@ -3164,7 +3172,7 @@
 #ifdef ENABLE_AUTOMOUNT
 		g_hash_table_remove (device_table, udi);
 		
-		/* unmount all volumes mounted during lifetime */
+		/* remove the volume from our mounted_volumes list if present */
 		for (l = mounted_volumes; l != NULL; l = n) {
 			n = l->next;
 			if (strcmp (udi, (const char *) l->data) == 0) {
@@ -3213,6 +3221,12 @@
 		}
 	}
 	
+#if 0
+	/* don't handle ejects of ignored volumes */
+	if (libhal_device_get_property_bool (hal_ctx, volume, "volume.ignore", NULL))
+		goto done;
+#endif
+	
 	dbg ("ejecting %s...\n", volume);
 	
 	if (!gnome_mount || access (gnome_mount, F_OK | R_OK | X_OK) != 0) {
@@ -3550,7 +3564,9 @@
 		const char *udi = l->data;
 		
 		dbg ("unmount_all: unmounting %s...\n", udi);
-		gvm_device_unmount (udi);
+		
+		if (!libhal_device_get_property_bool (hal_ctx, udi, "volume.ignore", NULL))
+			gvm_device_unmount (udi);
 	}
 }
 #endif /* ENABLE_AUTOMOUNT */



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