diff --git a/Cargo.lock b/Cargo.lock index 3f5452c..76b9418 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5975,8 +5975,7 @@ dependencies = [ [[package]] name = "trash" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d8fbfb70b1fad5c0b788f9b2e1bf4d04e5ac6efa828f1ed9ee462c50ff9cf05" +source = "git+https://github.com/jackpot51/trash-rs.git?branch=delete-info#e9fd256298bf9873a794dfe60a2261d1ed41674c" dependencies = [ "chrono", "libc", diff --git a/Cargo.toml b/Cargo.toml index 8c37daa..ef7078e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ regex = "1" serde = { version = "1", features = ["serde_derive"] } shlex = { version = "1.3" } tokio = { version = "1", features = ["sync"] } -trash = "5.0" +trash = { git = "https://github.com/jackpot51/trash-rs.git", branch = "delete-info" } xdg = { version = "2.5.2", optional = true } xdg-mime = "0.3" url = "2.5" diff --git a/src/operation.rs b/src/operation.rs index 5dfdc2e..9605e6d 100644 --- a/src/operation.rs +++ b/src/operation.rs @@ -307,7 +307,7 @@ impl Operation { pub fn toast(&self) -> Option { match self { - Self::Delete { paths } => Some(self.completed_text()), + Self::Delete { .. } => Some(self.completed_text()), //TODO: more toasts _ => None, } @@ -432,10 +432,11 @@ impl Operation { let total = paths.len(); let mut count = 0; for path in paths { - tokio::task::spawn_blocking(|| trash::delete(path)) + let items_opt = tokio::task::spawn_blocking(|| trash::delete(path)) .await .map_err(err_str)? .map_err(err_str)?; + //TODO: items_opt allows for easy restore count += 1; let _ = msg_tx .lock()