105105
106106typedef enum {
107107 SHOW_HIDDEN = 1 << 0 ,
108+ SHOW_BACKUP = 1 << 1 ,
108109} FilterOptions ;
109110
110111typedef void (* ModifyListFunction ) (GList * * list , CajaFile * file );
@@ -2094,7 +2095,7 @@ update_info_internal (CajaFile *file,
20942095{
20952096 GList * node ;
20962097 gboolean changed ;
2097- gboolean is_symlink , is_hidden , is_mountpoint ;
2098+ gboolean is_symlink , is_hidden , is_backup , is_mountpoint ;
20982099 gboolean has_permissions ;
20992100 guint32 permissions ;
21002101 gboolean can_read , can_write , can_execute , can_delete , can_trash , can_rename , can_mount , can_unmount , can_eject ;
@@ -2185,12 +2186,15 @@ update_info_internal (CajaFile *file,
21852186 }
21862187 file -> details -> is_symlink = is_symlink ;
21872188
2188- is_hidden = g_file_info_get_is_hidden (info ) || g_file_info_get_is_backup (info );
2189- if (file -> details -> is_hidden != is_hidden ) {
2189+ is_hidden = g_file_info_get_is_hidden (info );
2190+ is_backup = g_file_info_get_is_backup (info );
2191+ if (file -> details -> is_hidden != is_hidden ||
2192+ file -> details -> is_backup != is_backup ) {
21902193 changed = TRUE;
21912194 }
21922195 file -> details -> is_hidden = is_hidden ;
2193-
2196+ file -> details -> is_backup = is_backup ;
2197+
21942198 is_mountpoint = g_file_info_get_attribute_boolean (info , G_FILE_ATTRIBUTE_UNIX_IS_MOUNTPOINT );
21952199 if (file -> details -> is_mountpoint != is_mountpoint ) {
21962200 changed = TRUE;
@@ -3627,6 +3631,7 @@ caja_file_is_hidden_file (CajaFile *file)
36273631 * caja_file_should_show:
36283632 * @file: the file to check.
36293633 * @show_hidden: whether we want to show hidden files or not.
3634+ * @show_backup: whether we want to show backup files or not.
36303635 *
36313636 * Determines if a #CajaFile should be shown. Note that when browsing
36323637 * a trash directory, this function will always return %TRUE.
@@ -3635,14 +3640,16 @@ caja_file_is_hidden_file (CajaFile *file)
36353640 */
36363641gboolean
36373642caja_file_should_show (CajaFile * file ,
3638- gboolean show_hidden ,
3639- gboolean show_foreign )
3643+ gboolean show_hidden ,
3644+ gboolean show_foreign ,
3645+ gboolean show_backup )
36403646{
36413647 /* Never hide any files in trash. */
36423648 if (caja_file_is_in_trash (file )) {
36433649 return TRUE;
36443650 } else {
36453651 return (show_hidden || !caja_file_is_hidden_file (file )) &&
3652+ (show_backup || !caja_file_is_backup_file (file )) &&
36463653 (show_foreign || !(caja_file_is_in_desktop (file ) && caja_file_is_foreign_link (file )));
36473654 }
36483655}
@@ -3671,6 +3678,12 @@ caja_file_is_in_desktop (CajaFile *file)
36713678
36723679}
36733680
3681+ gboolean
3682+ caja_file_is_backup_file (CajaFile * file )
3683+ {
3684+ return file -> details -> is_backup ;
3685+ }
3686+
36743687static gboolean
36753688filter_hidden_partition_callback (gpointer data ,
36763689 gpointer callback_data )
@@ -3682,8 +3695,9 @@ filter_hidden_partition_callback (gpointer data,
36823695 options = GPOINTER_TO_INT (callback_data );
36833696
36843697 return caja_file_should_show (file ,
3685- options & SHOW_HIDDEN ,
3686- TRUE);
3698+ options & SHOW_HIDDEN ,
3699+ TRUE,
3700+ options & SHOW_BACKUP );
36873701}
36883702
36893703GList *
0 commit comments