Fix compilation without desktop feature

This commit is contained in:
Jeremy Soller 2024-11-11 11:38:07 -07:00
parent e4a37273fd
commit 63126810b1
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
3 changed files with 13 additions and 2 deletions

View file

@ -115,6 +115,7 @@ pub fn context_menu<'a>(
selected_types.dedup();
selected_trash_only = selected_trash_only && selected == 1;
// Parse the desktop entry if it is the only selection
#[cfg(feature = "desktop")]
let selected_desktop_entry = selected_desktop_entry.and_then(|path| {
if selected == 1 {
let lang_id = crate::localize::LANGUAGE_LOADER.current_language();
@ -139,8 +140,11 @@ pub fn context_menu<'a>(
}
} else if let Some(entry) = selected_desktop_entry {
children.push(menu_item(fl!("open"), Action::Open).into());
for (i, action) in entry.desktop_actions.into_iter().enumerate() {
children.push(menu_item(action.name, Action::ExecEntryAction(i)).into())
#[cfg(feature = "desktop")]
{
for (i, action) in entry.desktop_actions.into_iter().enumerate() {
children.push(menu_item(action.name, Action::ExecEntryAction(i)).into())
}
}
children.push(divider::horizontal::light().into());
children.push(menu_item(fl!("rename"), Action::Rename).into());