[nautilus/wip/oholy/hidden-template-files] files-view: Add support for hidden template files
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/oholy/hidden-template-files] files-view: Add support for hidden template files
- Date: Fri, 20 Dec 2019 09:41:51 +0000 (UTC)
commit 6473c016ec8ac4e49e41fede371b84a2f168baf6
Author: Ondrej Holy <oholy redhat com>
Date: Fri Dec 20 09:33:30 2019 +0100
files-view: Add support for hidden template files
Currently, hidden files are filtered out when looking for template files.
However, it would be nice to have a way to create hidden files from templates.
Let's offer hidden files as templates, but only when hidden files are shown.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/issues/1320
src/nautilus-files-view.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index db84bd191..0494720a7 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -2851,14 +2851,21 @@ static void
show_hidden_files_changed_callback (gpointer callback_data)
{
NautilusFilesView *view;
+ NautilusFilesViewPrivate *priv;
gboolean preference_value;
view = NAUTILUS_FILES_VIEW (callback_data);
+ priv = nautilus_files_view_get_instance_private (view);
preference_value =
g_settings_get_boolean (gtk_filechooser_preferences, NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES);
nautilus_files_view_set_show_hidden_files (view, preference_value);
+
+ if (priv->active)
+ {
+ schedule_update_context_menus (view);
+ }
}
static gboolean
@@ -5723,6 +5730,7 @@ static GMenu *
update_directory_in_templates_menu (NautilusFilesView *view,
NautilusDirectory *directory)
{
+ NautilusFilesViewPrivate *priv;
GList *file_list, *filtered, *node;
GMenu *menu, *children_menu;
GMenuItem *menu_item;
@@ -5736,8 +5744,10 @@ update_directory_in_templates_menu (NautilusFilesView *view,
g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), NULL);
g_return_val_if_fail (NAUTILUS_IS_DIRECTORY (directory), NULL);
+ priv = nautilus_files_view_get_instance_private (view);
+
file_list = nautilus_directory_get_file_list (directory);
- filtered = nautilus_file_list_filter_hidden (file_list, FALSE);
+ filtered = nautilus_file_list_filter_hidden (file_list, priv->show_hidden_files);
nautilus_file_list_free (file_list);
templates_directory_uri = nautilus_get_templates_directory_uri ();
menu = g_menu_new ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]