-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Linux move_to_trash
wrongly reporting files as not found
#79284
Fix Linux move_to_trash
wrongly reporting files as not found
#79284
Conversation
Thank you for your work, I'll test it later. |
I can confirm the error has disappeared on my system (Linux + Gnome). |
The only Linux editor artifact I could see was the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving based on the comments above.
Oops, I missed a special use case. if I get it correctly, the godot/drivers/unix/dir_access_unix.cpp Line 75 in ef155c1
I was wondering why to use |
Thanks for testing further, that's indeed a regression compared to 4.0.3, where Changing For this PR I'll remove the check added in all platforms to handle missing files, and just let Linux behave like Windows and macOS: no validation. On my system the PR in its current state (a6e75f3) prints these errors when trying to remove a file which doesn't exist:
It's bad, but it's the same as in 4.0.3 so this still fixes the regression and should be suitable for a 4.1.1 cherry-pick. The whole |
We can't rely on the error code from `gio` or `kioclient5`, in my rudimentary testing they return `1` for both missing files and other situations like not having a Trash can on the mounted volume. Fixes godotengine#79108.
c9689d0
to
a6e75f3
Compare
OS::move_to_trash
, fix Linux regressionmove_to_trash
wrongly reporting files as not found
Yes, the error messages from gio/kioclient5 are annoying, but thankfully the method still works as properly : )
In fact, some languages like Python, have separate APIs to let users decide to choose the one they think is appropriate: |
Cherry-picked for 4.1.1. |
We can't rely on the error code from
gio
orkioclient5
, in my rudimentary testing they return1
for both missing files and other situations like not having a Trash can on the mounted volume.I added path existence checks to all platforms as that seemed useful, even if it was wrongly implemented for Linux.Edit: This would need more work, I left it out of this PR for now.
Fixes #79108.
Partially reverts #67158, but still fixes #67157.
CC @amoriqbal @romlok @starccy I only did basic tests on Linux, would appreciate you checking that it solves #79108.
You can test with CI artifacts once the build finishes.