diff options
author | Havoc Pennington <hp@pobox.com> | 2002-03-23 01:44:45 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2002-03-23 01:44:45 +0000 |
commit | 3d60b12c762930b0d696a07e381a1e3e07244ed4 (patch) | |
tree | fce96408067bb3e16452ef51f1068efd3faca2bd | |
parent | edb2f1aa19fa9c0e9dfba97ecd1f6862029bd965 (diff) | |
download | nautilus-3d60b12c762930b0d696a07e381a1e3e07244ed4.tar.gz |
set up an auto variable for the /desktop/gnome/sound/enable_esd setting,
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.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/file-manager/fm-icon-view.c | 19 |
2 files changed, 15 insertions, 10 deletions
@@ -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-22 Dave Camp <dave@ximian.com> * src/file-manager/fm-properties-window.c: (create_emblems_page): diff --git a/src/file-manager/fm-icon-view.c b/src/file-manager/fm-icon-view.c index 48f929879..82943344a 100644 --- a/src/file-manager/fm-icon-view.c +++ b/src/file-manager/fm-icon-view.c @@ -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, NautilusFile *file, gboolean start_flag) } 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 *icon_view) 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; } |