[nautilus/wip/csoriano/debug: 1/8] files-view: don't allow compress if no selection



commit 564930ead11e72b2ec553782fabb79034c581d98
Author: Carlos Soriano <csoriano gnome org>
Date:   Thu Sep 15 13:49:46 2016 +0200

    files-view: don't allow compress if no selection
    
    We weren't checking if there is some file selected to enable/disable
    the compress action, which was causing the context menu item be always
    displayed if we clicked an element that is not a file.
    As odd as it sounds, this happens when allow to expand folders in list
    view, since the "empty" element is selectable but not a file.
    To fix that, check whether we have a file selected or not.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771469

 src/nautilus-files-view.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index d00c5ee..8b55410 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -7036,7 +7036,8 @@ real_update_actions_state (NautilusFilesView *view)
     selection_all_in_trash = all_in_trash (selection);
 
     is_read_only = nautilus_files_view_is_read_only (view);
-    can_create_files = nautilus_files_view_supports_creating_files (view);
+    can_create_files = selection_count !=0 &&
+                       nautilus_files_view_supports_creating_files (view);
     can_delete_files =
         can_delete_all (selection) &&
         selection_count != 0 &&


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]