diff --git a/src/app.rs b/src/app.rs index 8adb742..34d230c 100644 --- a/src/app.rs +++ b/src/app.rs @@ -61,9 +61,11 @@ use std::{ path::{Path, PathBuf}, pin::Pin, process, - sync::{Arc, LazyLock, Mutex}, + sync::{Arc, LazyLock}, time::{self, Duration, Instant}, }; +#[cfg(feature = "notify")] +use std::sync::Mutex; use tokio::sync::mpsc; use trash::TrashItem; #[cfg(all(feature = "wayland", feature = "desktop-applet"))] @@ -85,7 +87,7 @@ use crate::{ key_bind::key_binds, localize::LANGUAGE_SORTER, menu, - mime_app::{self, MimeApp, MimeAppCache}, + mime_app::{MimeApp, MimeAppCache}, mime_icon, mounter::{MOUNTERS, MounterAuth, MounterItem, MounterItems, MounterKey, MounterMessage}, operation::{ @@ -1027,7 +1029,7 @@ impl App { for path in paths.iter().map(AsRef::as_ref) { match DesktopEntry::from_path::<&str>(path, None) { Ok(entry) => match entry.exec() { - Some(exec) => match mime_app::exec_to_command(exec, &[] as &[&str; 0]) { + Some(exec) => match crate::mime_app::exec_to_command(exec, &[] as &[&str; 0]) { Some(commands) => { let cwd_opt = entry.desktop_entry("Path"); @@ -1252,30 +1254,18 @@ impl App { if tl && !(tr || bl) { *top += min_dim.1; *left += min_dim.0; - - size.height -= min_dim.1; - size.width -= min_dim.0; } if tr && !(tl || br) { *top += min_dim.1; *right += min_dim.0; - - size.height -= min_dim.1; - size.width -= min_dim.0; } if bl && !(br || tl) { *bottom += min_dim.1; *left += min_dim.0; - - size.height -= min_dim.1; - size.width -= min_dim.0; } if br && !(bl || tr) { *bottom += min_dim.1; *right += min_dim.0; - - size.height -= min_dim.1; - size.width -= min_dim.0; } } self.margin = overlaps; diff --git a/src/menu.rs b/src/menu.rs index 89e4a02..9de9af4 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -14,6 +14,7 @@ use cosmic::{ responsive_menu_bar, space, text, }, }; +#[cfg(feature = "desktop")] use i18n_embed::LanguageLoader; use mime_guess::Mime; use std::{collections::HashMap, sync::LazyLock}; @@ -196,11 +197,11 @@ pub fn context_menu<'a>( if !Trash::is_empty() { children.push(menu_item(fl!("empty-trash"), Action::EmptyTrash).into()); } - } else if let Some(entry) = selected_desktop_entry { + } else if let Some(_entry) = selected_desktop_entry { children.push(menu_item(fl!("open"), Action::Open).into()); #[cfg(feature = "desktop")] { - children.extend(entry.desktop_actions.into_iter().enumerate().map( + children.extend(_entry.desktop_actions.into_iter().enumerate().map( |(i, action)| menu_item(action.name, Action::ExecEntryAction(i)).into(), )); } diff --git a/src/mime_app.rs b/src/mime_app.rs index b8985ce..a9bf63e 100644 --- a/src/mime_app.rs +++ b/src/mime_app.rs @@ -6,13 +6,12 @@ use cosmic::desktop; use cosmic::widget; pub use mime_guess::Mime; use rustc_hash::FxHashMap; +#[cfg(feature = "desktop")] +use std::{cmp::Ordering, fs, io, time::Instant}; use std::{ - cmp::Ordering, ffi::OsStr, - fs, io, path::{Path, PathBuf}, process, - time::Instant, }; // Supported exec key field codes diff --git a/src/tab.rs b/src/tab.rs index 641239f..653dabf 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -28,6 +28,7 @@ use cosmic::{ space, }, }; +#[cfg(feature = "desktop")] use i18n_embed::LanguageLoader; use icu::{ datetime::{ @@ -578,7 +579,7 @@ pub fn fs_kind(_metadata: &Metadata) -> FsKind { } #[cfg(not(feature = "desktop"))] -fn get_desktop_file_display_name(path: &Path) -> Option { +fn get_desktop_file_display_name(_path: &Path) -> Option { None } @@ -597,7 +598,7 @@ fn get_desktop_file_display_name(path: &Path) -> Option { } #[cfg(not(feature = "desktop"))] -fn get_desktop_file_icon(path: &Path) -> Option { +fn get_desktop_file_icon(_path: &Path) -> Option { None } diff --git a/src/thumbnailer.rs b/src/thumbnailer.rs index f7786ed..8e61447 100644 --- a/src/thumbnailer.rs +++ b/src/thumbnailer.rs @@ -5,12 +5,12 @@ use cosmic::desktop::fde::GenericEntry; use mime_guess::Mime; use rustc_hash::FxHashMap; +#[cfg(feature = "desktop")] +use std::{fs, time::Instant}; use std::{ - fs, path::Path, process, sync::{LazyLock, Mutex}, - time::Instant, }; #[derive(Clone, Debug)]