mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
2447917ac7
commit
e8d7716df3
2 changed files with 11 additions and 16 deletions
|
|
@ -26,13 +26,11 @@ syntect = "^5"
|
|||
tokio = { version = "^1", features = [ "parking_lot", "macros", "rt-multi-thread", "sync", "time", "fs", "process", "io-std", "io-util" ] }
|
||||
tokio-stream = "^0"
|
||||
tracing = "^0"
|
||||
trash = { version = "^3", optional = true }
|
||||
unicode-width = "^0"
|
||||
yazi-prebuild = "^0"
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
clipboard-win = "^4"
|
||||
|
||||
[features]
|
||||
trash_bin = [ "trash" ]
|
||||
default = [ "trash_bin" ]
|
||||
[target.'cfg(not(target_os = "netbsd"))'.dependencies]
|
||||
trash = "^3"
|
||||
|
|
|
|||
|
|
@ -152,19 +152,16 @@ impl File {
|
|||
self.sch.send(TaskOp::Adv(task.id, 1, task.length))?
|
||||
}
|
||||
FileOp::Trash(task) => {
|
||||
#[cfg(feature = "trash_bin")]
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
use trash::{macos::{DeleteMethod, TrashContextExtMacos}, TrashContext};
|
||||
let mut ctx = TrashContext::default();
|
||||
ctx.set_delete_method(DeleteMethod::NsFileManager);
|
||||
ctx.delete(&task.target)?;
|
||||
}
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
{
|
||||
trash::delete(&task.target)?;
|
||||
}
|
||||
use trash::{macos::{DeleteMethod, TrashContextExtMacos}, TrashContext};
|
||||
let mut ctx = TrashContext::default();
|
||||
ctx.set_delete_method(DeleteMethod::NsFileManager);
|
||||
ctx.delete(&task.target)?;
|
||||
}
|
||||
#[cfg(not(target_os = "netbsd"))]
|
||||
{
|
||||
trash::delete(&task.target)?;
|
||||
}
|
||||
self.sch.send(TaskOp::Adv(task.id, 1, task.length))?;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue