summaryrefslogtreecommitdiff
path: root/src/nautilus-view.c
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2015-05-13 14:41:18 +0200
committerCarlos Soriano <csoriano@gnome.org>2015-05-13 14:48:30 +0200
commitfd7cd39414e4f2eeb069c2b7d848f39c7626d996 (patch)
tree0b7c394b8f716dd58eb436d80ec3a00529dc0ba7 /src/nautilus-view.c
parentfdef74de4d6966cb86563a8710d863138bd9eaa8 (diff)
downloadnautilus-fd7cd39414e4f2eeb069c2b7d848f39c7626d996.tar.gz
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
Diffstat (limited to 'src/nautilus-view.c')
-rw-r--r--src/nautilus-view.c17
1 files changed, 17 insertions, 0 deletions
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
@@ -1144,6 +1144,17 @@ action_move_to_trash (GSimpleAction *action,
}
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)
{
GList *selection;
@@ -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},
@@ -6251,6 +6263,11 @@ real_update_actions_state (NautilusView *view)
!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),
can_move_files && !selection_contains_recent);