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>
This commit is contained in:
Milan Bouchet-Valat 2009-06-11 19:58:51 -05:00 committed by Federico Mena Quintero
parent de280cc5c8
commit a27e748586
3 changed files with 9 additions and 7 deletions

View File

@ -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);

View File

@ -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 &&

View File

@ -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);