fix: handle slight delay in availability of clipboard data
a better fix in the future would probably be an event indicating availability of the data.
This commit is contained in:
parent
175f8ba724
commit
cf328771c3
2 changed files with 36 additions and 10 deletions
|
|
@ -133,9 +133,7 @@ impl TryFrom<(Vec<u8>, String)> for ClipboardPaste {
|
|||
"text/uri-list" => {
|
||||
let text = str::from_utf8(&data)?;
|
||||
let lines = text.lines();
|
||||
if text.is_empty() || lines.count() == 0 {
|
||||
Err(format!("Empty file url"))?;
|
||||
}
|
||||
|
||||
for line in text.lines() {
|
||||
let url = Url::parse(line)?;
|
||||
match url.to_file_path() {
|
||||
|
|
@ -146,10 +144,7 @@ impl TryFrom<(Vec<u8>, String)> for ClipboardPaste {
|
|||
}
|
||||
"x-special/gnome-copied-files" => {
|
||||
let text = str::from_utf8(&data)?;
|
||||
let lines = text.lines();
|
||||
if text.is_empty() || lines.count() == 0 {
|
||||
Err(format!("Empty file url"))?;
|
||||
}
|
||||
|
||||
for (i, line) in text.lines().enumerate() {
|
||||
if i == 0 {
|
||||
kind = match line {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue