-
Notifications
You must be signed in to change notification settings - Fork 29
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
Return trash items that are created by delete #109
base: master
Are you sure you want to change the base?
Conversation
Can this be rebased so deleting files works on Universal Blue/Fedora Atomic Desktops? Thanks. |
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.
This has been a draft for a long time and to my mind, there isn't anything holding it back, generally at least.
Some concerns might be memory consumption, as I think that will be quite high with hundreds of thousands items deleted, but I suppose that's not usually what people do and it returns only the top-most level items anyway.
@sungsphinx Please feel free to open a new PR with this work rebased, superseding this one.
This is ready, provided the platform availability is okay. I can rebase it if needed |
Right, I oversaw that only free desktop is actually implemented, and that tests haven’t been updated either. |
e9fd256
to
5d7fd23
Compare
I've added a Mac's implementation with one change so far: we should return a single item when deleting a single item, not a vec, that's unexpected. And think this should also be addressed:
We could have it both with an extra argument. I think the default should be the simplest one, so I've started splitting functions in two: Though maybe the proper way is for this to be only accessible via trash context similar to how deletemethod on macs work? |
By the way, why is the original path stored in parts and requires a separate call to get to that combines sub-parts? Wouldn't it be better to have a single hashmap keyed by the original path with a Or maybe even better: this could be some trie-type structure that would allow easily answering questions like "what are all the items removed with a path that contains ~\Documents` |
This allows for restoring those files exactly, even if multiple files with the same path have been trashed. I have only implemented this for the freedesktop platform, which is why it returns an Option. Marking as a draft until all possible platforms are supported, or that is deemed unnecessary.