diff options
author | António Fernandes <antoniof@gnome.org> | 2022-08-23 20:14:59 +0100 |
---|---|---|
committer | António Fernandes <antoniof@gnome.org> | 2022-08-31 01:43:50 +0100 |
commit | c87bbd97043669f508c883344740009fbf604a82 (patch) | |
tree | d377542dca9e1fb89451f97b401009292d64e9e6 | |
parent | 7854c9895bfcf4d045444fb3d4862b583032c439 (diff) | |
download | nautilus-c87bbd97043669f508c883344740009fbf604a82.tar.gz |
files-view: Reset templates model to NULL if unwanted
Otherwise the pathbar still displays the submenu in locations where
creation of new files is not supported.
Resolves https://gitlab.gnome.org/GNOME/nautilus/-/issues/2455
-rw-r--r-- | src/nautilus-files-view.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index fb2b22675..eff1fe368 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -8250,6 +8250,16 @@ update_background_menu (NautilusFilesView *view, remove_submenu = FALSE; } } + else + { + /* This is necessary because the pathbar menu relies on it being NULL + * to hide the submenu. */ + nautilus_view_set_templates_menu (NAUTILUS_VIEW (view), NULL); + + /* And this is necessary to regenerate the templates menu when we go + * back to a normal folder. */ + priv->templates_menu_updated = FALSE; + } i = nautilus_g_menu_model_find_by_string (G_MENU_MODEL (priv->background_menu_model), "nautilus-menu-item", |