Update view after permanent delete of folder containing files #2624
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2623
This issue is rooted in the way the C library handles permanent deletions (which differs from trashing) which makes the handling of file removal notifications in Directory.vala fail as it is based on the (in this case incorrect) assumption that each batch of removed files have the same parent. The C library was sending the same signal for the directory as for its children.
Rather than make substantial changes to the spaghetti that is the C library, I have introduced a separate category of file change for deletion of a folder (only used in the case of permanent deletion). This makes the Directory handle that change separately, which fixes the issue.
This is a long outstanding issue (it occurs at least as far back as v6.4 and probably well before that since the C library is rarely touched).
Since the new function is only called in one place during permanent deletion of a folder, and
Directory.vala
is not touched, these changes should not impact any other file operation.