[gtk+] bgo#355851 - Hide backup files in the file chooser



commit a27e748586a007910aac394d891b40bb5325456e
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Thu Jun 11 19:58:51 2009 -0500

    bgo#355851 - Hide backup files in the file chooser
    
    Backup files are hidden along with dotfiles, just like Nautilus.
    
    Signed-off-by: Federico Mena Quintero <federico novell com>

 gtk/gtkfilechooserdefault.c |    7 ++++---
 gtk/gtkfilesystemmodel.c    |    3 ++-
 gtk/gtkpathbar.c            |    6 +++---
 3 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index bcfdef1..416ed64 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -1746,7 +1746,7 @@ shortcuts_insert_file (GtkFileChooserDefault *impl,
           gtk_tree_path_free (p);
 
           cancellable = _gtk_file_system_get_info (request->impl->file_system, request->file,
-						   "standard::is-hidden,standard::display-name,standard::icon",
+						   "standard::is-hidden,standard::is-backup,standard::display-name,standard::icon",
 						   get_file_info_finished, request);
 
           gtk_list_store_set (impl->shortcuts_model, &iter,
@@ -6511,7 +6511,8 @@ show_and_select_files_finished_loading (GtkFolder *folder,
       if (info)
 	{
 	  if (!have_hidden)
-	    have_hidden = g_file_info_get_is_hidden (info);
+	    have_hidden = g_file_info_get_is_hidden (info)
+	                    || g_file_info_get_is_backup (info);
 
 	  if (!have_filtered)
 	    have_filtered = (! _gtk_file_info_consider_as_directory (info)) &&
@@ -6614,7 +6615,7 @@ show_and_select_files (GtkFileChooserDefault *impl,
 
   impl->show_and_select_files_cancellable =
     _gtk_file_system_get_folder (impl->file_system, parent_file,
- 				 "standard::is-hidden,standard::type,standard::name,standard::content-type",
+ 				 "standard::is-hidden,standard::is-backup,standard::type,standard::name,standard::content-type",
 			         show_and_select_files_get_folder_cb, info);
 
   profile_end ("end", NULL);
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index 79eb10c..1d0b736 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -1336,7 +1336,8 @@ file_model_node_is_visible (GtkFileSystemModel *model,
 	  model->show_folders != is_folder)
 	return FALSE;
 
-      if (!model->show_hidden && g_file_info_get_is_hidden (info))
+      if (!model->show_hidden &&
+          (g_file_info_get_is_hidden (info) || g_file_info_get_is_backup (info)))
 	return FALSE;
 
       if (model->filter_func &&
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 621d487..a9d2da3 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -1661,7 +1661,7 @@ gtk_path_bar_get_info_callback (GCancellable *cancellable,
     }
 
   display_name = g_file_info_get_display_name (info);
-  is_hidden = g_file_info_get_is_hidden (info);
+  is_hidden = g_file_info_get_is_hidden (info) || g_file_info_get_is_backup (info);
 
   gtk_widget_push_composite_child ();
   button_data = make_directory_button (file_info->path_bar, display_name,
@@ -1689,7 +1689,7 @@ gtk_path_bar_get_info_callback (GCancellable *cancellable,
   file_info->path_bar->get_info_cancellable =
     _gtk_file_system_get_info (file_info->path_bar->file_system,
 			       file_info->file,
-			       "standard::display-name,standard::is-hidden",
+			       "standard::display-name,standard::is-hidden,standard::is-backup",
 			       gtk_path_bar_get_info_callback,
 			       file_info);
 }
@@ -1727,7 +1727,7 @@ _gtk_path_bar_set_file (GtkPathBar         *path_bar,
   path_bar->get_info_cancellable =
     _gtk_file_system_get_info (path_bar->file_system,
 			       info->file,
-			       "standard::display-name,standard::is-hidden",
+			       "standard::display-name,standard::is-hidden,standard::is-backup",
 			       gtk_path_bar_get_info_callback,
 			       info);
 



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