diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-12-26 21:45:46 -0500 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-12-26 21:45:46 -0500 |
commit | 2b2672123d31bdcfd579916fa3fdc6cd961008a3 (patch) | |
tree | 3537f86ff7e4eb7b0851db7974138edc3e105556 /src/config | |
parent | 883a20d31a05ca0b3eac09ee1952904ec0b2131a (diff) |
add support for trashing files instead of permanently deleting
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/config.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/config/config.rs b/src/config/config.rs index c4a3fcc..0604123 100644 --- a/src/config/config.rs +++ b/src/config/config.rs @@ -69,6 +69,8 @@ pub struct JoshutoRawConfig { collapse_preview: bool, #[serde(default)] xdg_open: bool, + #[serde(default = "default_true")] + use_trash: bool, #[serde(default = "default_max_preview_size")] max_preview_size: u64, column_ratio: Option<[usize; 3]>, @@ -99,6 +101,7 @@ impl Flattenable<JoshutoConfig> for JoshutoRawConfig { show_preview: self.show_preview, collapse_preview: self.collapse_preview, xdg_open: self.xdg_open, + use_trash: self.use_trash, max_preview_size: self.max_preview_size, column_ratio, sort_option, @@ -113,6 +116,7 @@ pub struct JoshutoConfig { pub show_preview: bool, pub collapse_preview: bool, pub xdg_open: bool, + pub use_trash: bool, pub max_preview_size: u64, pub sort_option: sort::SortOption, pub column_ratio: (usize, usize, usize), @@ -135,6 +139,7 @@ impl std::default::Default for JoshutoConfig { show_preview: true, collapse_preview: true, xdg_open: false, + use_trash: true, max_preview_size: default_max_preview_size(), sort_option, column_ratio: default_column_ratio(), |