diff options
author | António Fernandes <antoniof@gnome.org> | 2018-07-26 16:38:14 +0100 |
---|---|---|
committer | Carlos Soriano <csoriano1618@gmail.com> | 2018-07-27 15:01:38 +0000 |
commit | ee75ea771763b4a7fcef5fd61d3c790e688d88e5 (patch) | |
tree | cf129f0de1c24fdf019d0dbc5f9ff535f662c847 /src/nautilus-files-view.c | |
parent | 5e8e63eff9ee92c3b8660ad1ba89f2ee08307175 (diff) | |
download | nautilus-ee75ea771763b4a7fcef5fd61d3c790e688d88e5.tar.gz |
files-view: Streamline properties actions paths
The view.properties action opens the current directory properties when
the selection is NULL, which we assume to be the case when opening the
background context menu.
Instead of relying on this assumption, make the background context menu
use the view.current-directory-properties action which is used by the
current location menu in the pathbar. Also, rename view.properties to
view.selection-properties and specialize it.
Diffstat (limited to 'src/nautilus-files-view.c')
-rw-r--r-- | src/nautilus-files-view.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index d5cdc838b..cd905628f 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -2471,35 +2471,23 @@ action_new_folder_with_selection (GSimpleAction *action, } static void -action_properties (GSimpleAction *action, - GVariant *state, - gpointer user_data) +action_selection_properties (GSimpleAction *action, + GVariant *state, + gpointer user_data) { NautilusFilesView *view; NautilusFilesViewPrivate *priv; g_autolist (NautilusFile) selection = NULL; - GList *files; g_assert (NAUTILUS_IS_FILES_VIEW (user_data)); view = NAUTILUS_FILES_VIEW (user_data); priv = nautilus_files_view_get_instance_private (view); selection = nautilus_view_get_selection (NAUTILUS_VIEW (view)); - if (g_list_length (selection) == 0) - { - if (priv->directory_as_file != NULL) - { - files = g_list_append (NULL, nautilus_file_ref (priv->directory_as_file)); - nautilus_properties_window_present (files, GTK_WIDGET (view), NULL); + g_return_if_fail (selection != NULL); - nautilus_file_list_free (files); - } - } - else - { - nautilus_properties_window_present (selection, GTK_WIDGET (view), NULL); - } + nautilus_properties_window_present (selection, GTK_WIDGET (view), NULL); } static void @@ -6999,7 +6987,7 @@ const GActionEntry view_entries[] = { "extract-here", action_extract_here }, { "extract-to", action_extract_to }, { "compress", action_compress }, - { "properties", action_properties}, + { "selection-properties", action_selection_properties}, { "current-directory-properties", action_current_dir_properties}, { "set-as-wallpaper", action_set_as_wallpaper }, { "mount-volume", action_mount_volume }, |