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},
|
path::{Path, PathBuf},
|
||||||
pin::Pin,
|
pin::Pin,
|
||||||
process,
|
process,
|
||||||
sync::{Arc, LazyLock, Mutex},
|
sync::{Arc, LazyLock},
|
||||||
time::{self, Duration, Instant},
|
time::{self, Duration, Instant},
|
||||||
};
|
};
|
||||||
|
#[cfg(feature = "notify")]
|
||||||
|
use std::sync::Mutex;
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
use trash::TrashItem;
|
use trash::TrashItem;
|
||||||
#[cfg(all(feature = "wayland", feature = "desktop-applet"))]
|
#[cfg(all(feature = "wayland", feature = "desktop-applet"))]
|
||||||
|
|
@ -85,7 +87,7 @@ use crate::{
|
||||||
key_bind::key_binds,
|
key_bind::key_binds,
|
||||||
localize::LANGUAGE_SORTER,
|
localize::LANGUAGE_SORTER,
|
||||||
menu,
|
menu,
|
||||||
mime_app::{self, MimeApp, MimeAppCache},
|
mime_app::{MimeApp, MimeAppCache},
|
||||||
mime_icon,
|
mime_icon,
|
||||||
mounter::{MOUNTERS, MounterAuth, MounterItem, MounterItems, MounterKey, MounterMessage},
|
mounter::{MOUNTERS, MounterAuth, MounterItem, MounterItems, MounterKey, MounterMessage},
|
||||||
operation::{
|
operation::{
|
||||||
|
|
@ -1027,7 +1029,7 @@ impl App {
|
||||||
for path in paths.iter().map(AsRef::as_ref) {
|
for path in paths.iter().map(AsRef::as_ref) {
|
||||||
match DesktopEntry::from_path::<&str>(path, None) {
|
match DesktopEntry::from_path::<&str>(path, None) {
|
||||||
Ok(entry) => match entry.exec() {
|
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) => {
|
Some(commands) => {
|
||||||
let cwd_opt = entry.desktop_entry("Path");
|
let cwd_opt = entry.desktop_entry("Path");
|
||||||
|
|
||||||
|
|
@ -1252,30 +1254,18 @@ impl App {
|
||||||
if tl && !(tr || bl) {
|
if tl && !(tr || bl) {
|
||||||
*top += min_dim.1;
|
*top += min_dim.1;
|
||||||
*left += min_dim.0;
|
*left += min_dim.0;
|
||||||
|
|
||||||
size.height -= min_dim.1;
|
|
||||||
size.width -= min_dim.0;
|
|
||||||
}
|
}
|
||||||
if tr && !(tl || br) {
|
if tr && !(tl || br) {
|
||||||
*top += min_dim.1;
|
*top += min_dim.1;
|
||||||
*right += min_dim.0;
|
*right += min_dim.0;
|
||||||
|
|
||||||
size.height -= min_dim.1;
|
|
||||||
size.width -= min_dim.0;
|
|
||||||
}
|
}
|
||||||
if bl && !(br || tl) {
|
if bl && !(br || tl) {
|
||||||
*bottom += min_dim.1;
|
*bottom += min_dim.1;
|
||||||
*left += min_dim.0;
|
*left += min_dim.0;
|
||||||
|
|
||||||
size.height -= min_dim.1;
|
|
||||||
size.width -= min_dim.0;
|
|
||||||
}
|
}
|
||||||
if br && !(bl || tr) {
|
if br && !(bl || tr) {
|
||||||
*bottom += min_dim.1;
|
*bottom += min_dim.1;
|
||||||
*right += min_dim.0;
|
*right += min_dim.0;
|
||||||
|
|
||||||
size.height -= min_dim.1;
|
|
||||||
size.width -= min_dim.0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.margin = overlaps;
|
self.margin = overlaps;
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ use cosmic::{
|
||||||
responsive_menu_bar, space, text,
|
responsive_menu_bar, space, text,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
#[cfg(feature = "desktop")]
|
||||||
use i18n_embed::LanguageLoader;
|
use i18n_embed::LanguageLoader;
|
||||||
use mime_guess::Mime;
|
use mime_guess::Mime;
|
||||||
use std::{collections::HashMap, sync::LazyLock};
|
use std::{collections::HashMap, sync::LazyLock};
|
||||||
|
|
@ -196,11 +197,11 @@ pub fn context_menu<'a>(
|
||||||
if !Trash::is_empty() {
|
if !Trash::is_empty() {
|
||||||
children.push(menu_item(fl!("empty-trash"), Action::EmptyTrash).into());
|
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());
|
children.push(menu_item(fl!("open"), Action::Open).into());
|
||||||
#[cfg(feature = "desktop")]
|
#[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(),
|
|(i, action)| menu_item(action.name, Action::ExecEntryAction(i)).into(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,12 @@ use cosmic::desktop;
|
||||||
use cosmic::widget;
|
use cosmic::widget;
|
||||||
pub use mime_guess::Mime;
|
pub use mime_guess::Mime;
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
|
#[cfg(feature = "desktop")]
|
||||||
|
use std::{cmp::Ordering, fs, io, time::Instant};
|
||||||
use std::{
|
use std::{
|
||||||
cmp::Ordering,
|
|
||||||
ffi::OsStr,
|
ffi::OsStr,
|
||||||
fs, io,
|
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
process,
|
process,
|
||||||
time::Instant,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Supported exec key field codes
|
// Supported exec key field codes
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ use cosmic::{
|
||||||
space,
|
space,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
#[cfg(feature = "desktop")]
|
||||||
use i18n_embed::LanguageLoader;
|
use i18n_embed::LanguageLoader;
|
||||||
use icu::{
|
use icu::{
|
||||||
datetime::{
|
datetime::{
|
||||||
|
|
@ -578,7 +579,7 @@ pub fn fs_kind(_metadata: &Metadata) -> FsKind {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "desktop"))]
|
#[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
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -597,7 +598,7 @@ fn get_desktop_file_display_name(path: &Path) -> Option<String> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "desktop"))]
|
#[cfg(not(feature = "desktop"))]
|
||||||
fn get_desktop_file_icon(path: &Path) -> Option<String> {
|
fn get_desktop_file_icon(_path: &Path) -> Option<String> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,12 @@
|
||||||
use cosmic::desktop::fde::GenericEntry;
|
use cosmic::desktop::fde::GenericEntry;
|
||||||
use mime_guess::Mime;
|
use mime_guess::Mime;
|
||||||
use rustc_hash::FxHashMap;
|
use rustc_hash::FxHashMap;
|
||||||
|
#[cfg(feature = "desktop")]
|
||||||
|
use std::{fs, time::Instant};
|
||||||
use std::{
|
use std::{
|
||||||
fs,
|
|
||||||
path::Path,
|
path::Path,
|
||||||
process,
|
process,
|
||||||
sync::{LazyLock, Mutex},
|
sync::{LazyLock, Mutex},
|
||||||
time::Instant,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue