chore: clean feature-gated warnings
This commit is contained in:
parent
35e115fdb5
commit
6f3adcd993
5 changed files with 15 additions and 24 deletions
20
src/app.rs
20
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;
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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<String> {
|
||||
fn get_desktop_file_display_name(_path: &Path) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
|
|
@ -597,7 +598,7 @@ fn get_desktop_file_display_name(path: &Path) -> Option<String> {
|
|||
}
|
||||
|
||||
#[cfg(not(feature = "desktop"))]
|
||||
fn get_desktop_file_icon(path: &Path) -> Option<String> {
|
||||
fn get_desktop_file_icon(_path: &Path) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue