From fd7cd39414e4f2eeb069c2b7d848f39c7626d996 Mon Sep 17 00:00:00 2001 From: Carlos Soriano Date: Wed, 13 May 2015 14:41:18 +0200 Subject: nautilus-view: restore "Remove from Recent" We removed it accidentally in the port to GAction due to the bad naming of the functions. Add a TODO for implement a better named functions to not be confused again. https://bugzilla.gnome.org/show_bug.cgi?id=746392 --- src/nautilus-view.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/nautilus-view.c') diff --git a/src/nautilus-view.c b/src/nautilus-view.c index c786886a0..ecef39de5 100644 --- a/src/nautilus-view.c +++ b/src/nautilus-view.c @@ -1143,6 +1143,17 @@ action_move_to_trash (GSimpleAction *action, trash_or_delete_selected_files (NAUTILUS_VIEW (user_data)); } +static void +action_remove_from_recent (GSimpleAction *action, + GVariant *state, + gpointer user_data) +{ + /* TODO:implement a set of functions for this, is very confusing to + * call trash_or_delete_file to remove from recent, even if it does like + * that not deleting/moving the files to trash */ + trash_or_delete_selected_files (NAUTILUS_VIEW (user_data)); +} + static void delete_selected_files (NautilusView *view) { @@ -5829,6 +5840,7 @@ const GActionEntry view_entries[] = { * shortcut. */ { "delete-permanently-shortcut", action_delete }, { "delete-permanently-menu-item", action_delete }, + { "remove-from-recent", action_remove_from_recent }, { "restore-from-trash", action_restore_from_trash}, { "paste-into", action_paste_files_into }, { "rename", action_rename}, @@ -6250,6 +6262,11 @@ real_update_actions_state (NautilusView *view) can_delete_files && !can_trash_files && !selection_all_in_trash && !selection_contains_recent); + action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group), + "remove-from-recent"); + g_simple_action_set_enabled (G_SIMPLE_ACTION (action), + selection_contains_recent && selection_count > 0); + action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group), "cut"); g_simple_action_set_enabled (G_SIMPLE_ACTION (action), -- cgit v1.2.1