Skip to content

Commit

Permalink
Fix #1315: trying to remove folder with completely hidden .thumbnails…
Browse files Browse the repository at this point in the history
… folder silently fails

#1315

When attempting to delete a directory, if Preferences/File Filter/ is
enabled and any hidden files exist, the user will not see them in the
dialog and the program will refuse to delete the directory.

Temporarily disable the file filter when deleting a directory. The
hidden files will be displayed in the dialog and the directory can be
deleted.
  • Loading branch information
caclark committed Nov 21, 2024
1 parent 284a28a commit d0bae03
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/utilops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3153,7 +3153,20 @@ void file_util_start_filter_from_filelist(const gchar *key, GList *list, const g

void file_util_delete_dir(FileData *fd, GtkWidget *parent)
{
gboolean file_filter_disable_status;

/* If the file filter is enabled and there are hidden files, the directory
* cannot be deleted but the dialog does not show to the user those files.
* It is better to temporarily disable the file filter so that the user
* can see the entire contents of the directory about to be deleted.
*/
file_filter_disable_status = options->file_filter.disable;
options->file_filter.disable = TRUE;

file_util_delete_dir_full(fd, parent, UTILITY_PHASE_START);

options->file_filter.disable = file_filter_disable_status;

}

void file_util_create_dir(const gchar *path, GtkWidget *parent, FileUtilDoneFunc done_func, gpointer done_data)
Expand Down

0 comments on commit d0bae03

Please sign in to comment.