Disable code using trash::os_limited as it isn't available on macos

This commit is contained in:
Bjorn Ove Hay Andersen 2024-06-14 12:54:13 +02:00 committed by Jeremy Soller
parent 428279540d
commit 553c11deb3
2 changed files with 9 additions and 0 deletions

View file

@ -288,6 +288,12 @@ impl Operation {
.send(Message::PendingProgress(id, 100.0))
.await;
}
#[cfg(target_os = "macos")]
Self::Restore { .. } => {
// TODO: add support for macos
return Err("Restoring from trash is not supported on macos".to_string());
}
#[cfg(not(target_os = "macos"))]
Self::Restore { paths } => {
let total = paths.len();
let mut count = 0;

View file

@ -147,6 +147,9 @@ pub fn folder_icon_symbolic(path: &PathBuf, icon_size: u16) -> widget::icon::Han
}
pub fn trash_icon_symbolic(icon_size: u16) -> widget::icon::Handle {
#[cfg(target_os = "macos")]
let full = false; // TODO: add support for macos
#[cfg(not(target_os = "macos"))]
let full = match trash::os_limited::list() {
Ok(entries) => !entries.is_empty(),
Err(_err) => false,