From a520e270488a3782cfda56318bfda55ad377d14c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Tue, 26 Oct 2021 17:05:31 +0100 Subject: [PATCH] files-view: Clear :templates-menu if it should not be used If the templates dir is set to Home, then it should not be used. We set the priv->templates_present boolean to FALSE in that case, but forget to set the :templates-menu property to NULL too. Fix that corner case issue. Also, drop the useless boolean and just check directly whether the menu is present (i.e. not NULL). --- src/nautilus-files-view.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index 4e57ae61e..8f7c1586b 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -220,7 +220,6 @@ typedef struct * after it finishes loading the directory and its view. */ gboolean loading; - gboolean templates_present; gboolean scripts_present; gboolean in_destruction; @@ -5895,7 +5894,7 @@ update_templates_menu (NautilusFilesView *view, } else { - priv->templates_present = FALSE; + nautilus_view_set_templates_menu (NAUTILUS_VIEW (view), NULL); return; } @@ -5929,8 +5928,6 @@ update_templates_menu (NautilusFilesView *view, nautilus_directory_unref (directory); - priv->templates_present = submenu != NULL; - g_free (templates_directory_uri); } @@ -7967,7 +7964,7 @@ real_update_actions_state (NautilusFilesView *view) can_create_files && !selection_contains_recent && !selection_contains_starred && - priv->templates_present); + priv->templates_menu != NULL); /* Actions that are related to the clipboard need request, request the data * and update them once we have the data */