Davejkane / riv

Riv - The Rust Image Viewer
MIT License
99 stars 10 forks source link

Add Trash Support for all supported platforms #93

Closed gurgalex closed 5 years ago

gurgalex commented 5 years ago

One piece at a time.

In pursuit of #66

Currently only correctly moves files/directories and updates the trash info in $XDG_DATA_HOME/Trash directory. Supports non-utf8 file paths.

It does not implement anything else from the spec. https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html

gurgalex commented 5 years ago

@Davejkane

All that's left is MacOS trash support, which seems like it may be the most difficult to get bindings working for. Could default to just moving files to a user specified folder as a stopgap.

gurgalex commented 5 years ago

@Davejkane

I've got OS specifc trash support implemented for Linux, Windows, and Mac OS.

Do we still need the cli arg for specifying a trash folder?

Davejkane commented 5 years ago

@gurgalex Sorry I've been on vacation. Still am actually. But having a look at this now.

gurgalex commented 5 years ago

@Davejkane I went with an error message while trying to trash a file.

With this method, no crash will occur if the trash binary is moved or deleted while riv is running. Plus, riv doesn't need to be restarted to get trash support working again.