[PATCH] Small bugfix for desktop_volumes_visible_changed



Hi,

noticed that there is a small bug in nautilus. If the gconf key
"desktop/volumes_visible" is changed from TRUE to TRUE (yeah, I know
that pretty much never happens). Then the visibility of the icons will
effectively be toggled.

you can easily test this by running
gconftool -s /apps/nautilus/desktop/volumes_visible --type boolean true
multiple times.

The attached patch fixes this.

Benjamin
diff -rU 10 nautilus/libnautilus-private/nautilus-desktop-link-monitor.c nautilus.modified/libnautilus-private/nautilus-desktop-link-monitor.c
--- nautilus/libnautilus-private/nautilus-desktop-link-monitor.c	2005-03-25 16:15:22.000000000 +0100
+++ nautilus.modified/libnautilus-private/nautilus-desktop-link-monitor.c	2005-07-07 15:17:37.000000000 +0200
@@ -310,27 +310,29 @@
 static void
 desktop_volumes_visible_changed (gpointer callback_data)
 {
 	GnomeVFSVolumeMonitor *volume_monitor;
 	NautilusDesktopLinkMonitor *monitor;
 	GList *l, *volumes;
 	
 	volume_monitor = gnome_vfs_get_volume_monitor ();
 	monitor = NAUTILUS_DESKTOP_LINK_MONITOR (callback_data);
 
-	if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_DESKTOP_VOLUMES_VISIBLE) && monitor->details->volume_links == NULL) {
-		volumes = gnome_vfs_volume_monitor_get_mounted_volumes (volume_monitor);
-		for (l = volumes; l != NULL; l = l->next) {
-			create_volume_link (monitor, l->data);
-			gnome_vfs_volume_unref (l->data);
+	if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_DESKTOP_VOLUMES_VISIBLE)) {
+		if (monitor->details->volume_links == NULL) {
+			volumes = gnome_vfs_volume_monitor_get_mounted_volumes (volume_monitor);
+			for (l = volumes; l != NULL; l = l->next) {
+				create_volume_link (monitor, l->data);
+				gnome_vfs_volume_unref (l->data);
+			}
+			g_list_free (volumes);
 		}
-		g_list_free (volumes);
 	} else {
 		g_list_foreach (monitor->details->volume_links, (GFunc)g_object_unref, NULL);
 		g_list_free (monitor->details->volume_links);
 		monitor->details->volume_links = NULL;
 	}
 }
 
 static void
 nautilus_desktop_link_monitor_init (gpointer object, gpointer klass)
 {

Attachment: signature.asc
Description: This is a digitally signed message part



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