diff options
author | António Fernandes <antoniof@gnome.org> | 2021-10-26 17:05:31 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2021-10-30 06:33:25 +0000 |
commit | a520e270488a3782cfda56318bfda55ad377d14c (patch) | |
tree | b68a9871cf60046a0ae7fde303ea4bd724f2b2d4 | |
parent | 6afce418af083dae49dcbf4143383f8baddc3ecd (diff) | |
download | nautilus-a520e270488a3782cfda56318bfda55ad377d14c.tar.gz |
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).
-rw-r--r-- | src/nautilus-files-view.c | 7 |
1 files 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 */ |