Resolve cosmic-files warnings without masking
Parse text/uri-list according to the real clipboard format, make unsupported trash search explicit, and update the lockfile so the local cosmic-text patch is actually used instead of reported as unused.
This commit is contained in:
parent
338354c4d0
commit
d080bc85af
4 changed files with 17 additions and 12 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
|
@ -1494,8 +1494,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cosmic-text"
|
||||
version = "0.18.2"
|
||||
source = "git+https://github.com/pop-os/cosmic-text.git#4d74f795cc771fdcc7ea0f9cacba63fcf036fad6"
|
||||
version = "0.19.0"
|
||||
dependencies = [
|
||||
"bitflags 2.11.1",
|
||||
"fontdb",
|
||||
|
|
@ -1513,6 +1512,7 @@ dependencies = [
|
|||
"unicode-linebreak",
|
||||
"unicode-script",
|
||||
"unicode-segmentation",
|
||||
"unicode-width",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -9448,7 +9448,3 @@ dependencies = [
|
|||
"syn",
|
||||
"winnow 0.7.15",
|
||||
]
|
||||
|
||||
[[patch.unused]]
|
||||
name = "cosmic-text"
|
||||
version = "0.19.0"
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ window_clipboard = { path = "/home/lionel/Devels/window_clipboard" }
|
|||
dnd = { path = "/home/lionel/Devels/window_clipboard/dnd" }
|
||||
mime = { path = "/home/lionel/Devels/window_clipboard/mime" }
|
||||
|
||||
[patch.'https://github.com/pop-os/cosmic-text']
|
||||
[patch.'https://github.com/pop-os/cosmic-text.git']
|
||||
cosmic-text = { path = "/home/lionel/Devels/cosmic-text" }
|
||||
|
||||
[workspace]
|
||||
|
|
|
|||
|
|
@ -132,9 +132,10 @@ impl TryFrom<(Vec<u8>, String)> for ClipboardPaste {
|
|||
match mime.as_str() {
|
||||
"text/uri-list" => {
|
||||
let text = str::from_utf8(&data)?;
|
||||
let lines = text.lines();
|
||||
|
||||
for line in text.lines() {
|
||||
for line in text.lines().filter(|line| {
|
||||
let line = line.trim();
|
||||
!line.is_empty() && !line.starts_with('#')
|
||||
}) {
|
||||
let url = Url::parse(line)?;
|
||||
match url.to_file_path() {
|
||||
Ok(path) => paths.push(path),
|
||||
|
|
|
|||
12
src/trash.rs
12
src/trash.rs
|
|
@ -27,7 +27,7 @@ pub trait TrashExt {
|
|||
Vec::new()
|
||||
}
|
||||
|
||||
fn scan_search<F: Fn(SearchItem) -> bool + Sync>(callback: F, regex: &Regex) {}
|
||||
fn scan_search<F: Fn(SearchItem) -> bool + Sync>(callback: F, regex: &Regex);
|
||||
|
||||
fn icon(icon_size: u16) -> widget::icon::Handle {
|
||||
widget::icon::from_name(if Self::is_empty() {
|
||||
|
|
@ -142,4 +142,12 @@ impl TrashExt for Trash {
|
|||
not(target_os = "android")
|
||||
)
|
||||
)))]
|
||||
impl TrashExt for Trash {}
|
||||
impl TrashExt for Trash {
|
||||
fn scan_search<F: Fn(SearchItem) -> bool + Sync>(callback: F, regex: &Regex) {
|
||||
log::warn!(
|
||||
"searching trash not supported on this platform for pattern {:?}",
|
||||
regex.as_str()
|
||||
);
|
||||
drop(callback);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue