Commit b4ad42af authored by Cosimo Cecchi's avatar Cosimo Cecchi

places-sidebar: follow the remember-recent-files GSetting

https://bugzilla.gnome.org/show_bug.cgi?id=693705
parent 500770e8
......@@ -77,4 +77,5 @@ nautilus_global_preferences_init (void)
gnome_lockdown_preferences = g_settings_new("org.gnome.desktop.lockdown");
gnome_background_preferences = g_settings_new("org.gnome.desktop.background");
gnome_interface_preferences = g_settings_new ("org.gnome.desktop.interface");
gnome_privacy_preferences = g_settings_new ("org.gnome.desktop.privacy");
}
......@@ -157,6 +157,9 @@ typedef enum
/* Desktop background */
#define NAUTILUS_PREFERENCES_SHOW_DESKTOP "show-desktop-icons"
/* Recent files */
#define NAUTILUS_PREFERENCES_RECENT_FILES_ENABLED "remember-recent-files"
void nautilus_global_preferences_init (void);
char *nautilus_global_preferences_get_default_folder_viewer_preference_as_iid (void);
......@@ -170,6 +173,7 @@ GSettings *gtk_filechooser_preferences;
GSettings *gnome_lockdown_preferences;
GSettings *gnome_background_preferences;
GSettings *gnome_interface_preferences;
GSettings *gnome_privacy_preferences;
G_END_DECLS
......
......@@ -360,8 +360,16 @@ static gboolean
recent_is_supported (void)
{
const char * const *supported;
gboolean enabled;
int i;
enabled = g_settings_get_boolean (gnome_privacy_preferences,
NAUTILUS_PREFERENCES_RECENT_FILES_ENABLED);
if (!enabled) {
return FALSE;
}
supported = g_vfs_get_supported_uri_schemes (g_vfs_get_default ());
if (!supported) {
return FALSE;
......@@ -995,16 +1003,6 @@ clicked_eject_button (NautilusPlacesSidebar *sidebar,
return FALSE;
}
static void
desktop_setting_changed_callback (gpointer user_data)
{
NautilusPlacesSidebar *sidebar;
sidebar = NAUTILUS_PLACES_SIDEBAR (user_data);
update_places (sidebar);
}
static void
update_current_uri (NautilusPlacesSidebar *sidebar)
{
......@@ -3388,7 +3386,10 @@ nautilus_places_sidebar_init (NautilusPlacesSidebar *sidebar)
gtk_tree_view_set_activate_on_single_click (sidebar->tree_view, TRUE);
g_signal_connect_swapped (gnome_background_preferences, "changed::" NAUTILUS_PREFERENCES_SHOW_DESKTOP,
G_CALLBACK(desktop_setting_changed_callback),
G_CALLBACK (update_places),
sidebar);
g_signal_connect_swapped (gnome_privacy_preferences, "changed::" NAUTILUS_PREFERENCES_RECENT_FILES_ENABLED,
G_CALLBACK (update_places),
sidebar);
sidebar->hostname = g_strdup (_("Computer"));
......@@ -3443,7 +3444,11 @@ nautilus_places_sidebar_dispose (GObject *object)
sidebar);
g_signal_handlers_disconnect_by_func (gnome_background_preferences,
desktop_setting_changed_callback,
update_places,
sidebar);
g_signal_handlers_disconnect_by_func (gnome_privacy_preferences,
update_places,
sidebar);
if (sidebar->volume_monitor != NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment