Refactor trash handling to improve portability

This commit is contained in:
Jeremy Soller 2026-04-17 12:01:28 -06:00
parent 33890633b5
commit 9c0eb63b82
7 changed files with 173 additions and 166 deletions

View file

@ -23,6 +23,7 @@ use crate::{
config::{Config, ContextActionPreset},
fl,
tab::{self, HeadingOptions, Location, LocationMenuAction, SearchLocation, Tab},
trash::{Trash, TrashExt},
};
static MENU_ID: LazyLock<cosmic::widget::Id> =
@ -192,7 +193,7 @@ pub fn context_menu<'a>(
) => {
if selected_trash_only {
children.push(menu_item(fl!("open"), Action::Open).into());
if !trash::os_limited::is_empty().unwrap_or(true) {
if !Trash::is_empty() {
children.push(menu_item(fl!("empty-trash"), Action::EmptyTrash).into());
}
} else if let Some(entry) = selected_desktop_entry {