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
parent fdef74de
......@@ -206,6 +206,13 @@
<attribute name="hidden-when">action-disabled</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Remove from Recent</attribute>
<attribute name="action">view.remove-from-recent</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
</section>
<section>
<attribute name="id">extensions</attribute>
</section>
......
......@@ -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),
......
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