[nautilus/hide-properties-menu-option-on-search] files-view: Hide "current-dir-properties" option when searching




commit 5079a921cedef0663af1996735174aa279c2d4e0
Author: Felipe Borges <felipeborges gnome org>
Date:   Sun Aug 22 11:20:34 2021 +0200

    files-view: Hide "current-dir-properties" option when searching
    
    Clicking the "Properties" option in the right-click menu during
    a search causes Nautilus to crash since the Properties dialog
    handles files and directories, not search-view-directories.
    
    Lets disable the "Properties" option when in search view.
    
    Fixes #1491

 src/nautilus-files-view.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index f013fa68c..7e6dd8bd0 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -7948,6 +7948,10 @@ real_update_actions_state (NautilusFilesView *view)
                                          "properties");
     g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
                                  TRUE);
+    action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group),
+                                         "current-directory-properties");
+    g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
+                                 !selection_contains_search);
     action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group),
                                          "new-document");
     g_simple_action_set_enabled (G_SIMPLE_ACTION (action),


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