[Nautilus-list] small patch



Hi,

Pretty self-explanatory.

Havoc

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.5150
diff -u -p -u -r1.5150 ChangeLog
--- ChangeLog	21 Mar 2002 00:03:23 -0000	1.5150
+++ ChangeLog	22 Mar 2002 16:01:56 -0000
@@ -1,3 +1,9 @@
+2002-03-22  Havoc Pennington  <hp pobox com>
+
+	* src/file-manager/fm-icon-view.c (should_preview_sound): set up
+	an auto variable for the /desktop/gnome/sound/enable_esd setting,
+	to avoid remote gconf query on every icon mouseover.
+
 2002-03-20  Michael Meeks  <michael ximian com>
 
 	* src/nautilus-zoom-control.c (draw_number): revert
Index: src/file-manager/fm-icon-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-icon-view.c,v
retrieving revision 1.252
diff -u -p -u -r1.252 fm-icon-view.c
--- src/file-manager/fm-icon-view.c	11 Mar 2002 10:17:49 -0000	1.252
+++ src/file-manager/fm-icon-view.c	22 Mar 2002 16:01:56 -0000
@@ -181,6 +181,7 @@ static const SortCriterion sort_criteria
 
 static gboolean default_sort_in_reverse_order = FALSE;
 static int preview_sound_auto_value;
+static gboolean gnome_esd_enabled_auto_value;
 
 static void                 fm_icon_view_set_directory_sort_by                 (FMIconView           *icon_view,
 										NautilusFile         *file,
@@ -1656,17 +1657,10 @@ preview_audio (FMIconView *icon_view, Na
 }
 
 static gboolean
-should_preview_sound (NautilusFile *file) {
-
-	GConfClient *client;
-	gboolean enable_esd = FALSE;
-        
-	client = gconf_client_get_default ();
-	enable_esd = gconf_client_get_bool (client, "/desktop/gnome/sound/enable_esd", NULL);
-	g_object_unref (client);
-
+should_preview_sound (NautilusFile *file)
+{
 	/* Check gnome config sound preference */
-	if (!enable_esd) {
+	if (!gnome_esd_enabled_auto_value) {
 		return FALSE;
 	}
 
@@ -2684,6 +2678,11 @@ fm_icon_view_instance_init (FMIconView *
 	if (!setup_sound_preview) {
 		eel_preferences_add_auto_enum (NAUTILUS_PREFERENCES_PREVIEW_SOUND,
 					       &preview_sound_auto_value);
+
+		eel_preferences_monitor_directory ("/desktop/gnome/sound");
+		eel_preferences_add_auto_boolean ("/desktop/gnome/sound/enable_esd",
+						  &gnome_esd_enabled_auto_value);
+		
 		setup_sound_preview = TRUE;
 	}
 




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