mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-09-09 05:11:50 +00:00
try handle as file first
This commit is contained in:
parent
0574ab81fd
commit
93da67aa7e
@ -22,17 +22,20 @@ impl File {
|
|||||||
prelude::FileExtManual,
|
prelude::FileExtManual,
|
||||||
};
|
};
|
||||||
|
|
||||||
// try handle as directory
|
// try handle as file
|
||||||
File::for_uri(&uri.to_string()).enumerate_children_async(
|
File::for_uri(&uri.to_string()).load_contents_async(Some(&cancellable), {
|
||||||
"standard::content-type",
|
|
||||||
FileQueryInfoFlags::NONE,
|
|
||||||
Priority::DEFAULT,
|
|
||||||
Some(&cancellable),
|
|
||||||
{
|
|
||||||
let cancellable = cancellable.clone();
|
let cancellable = cancellable.clone();
|
||||||
let uri = uri.clone();
|
let uri = uri.clone();
|
||||||
let _page = self.page.clone();
|
let _page = self.page.clone();
|
||||||
move |result| match result {
|
move |result| match result {
|
||||||
|
Ok(_) => todo!(),
|
||||||
|
// is not a file, try handle as directory
|
||||||
|
Err(_) => File::for_uri(&uri.to_string()).enumerate_children_async(
|
||||||
|
"standard::content-type",
|
||||||
|
FileQueryInfoFlags::NONE,
|
||||||
|
Priority::DEFAULT,
|
||||||
|
Some(&cancellable),
|
||||||
|
|result| match result {
|
||||||
Ok(file_enumerator) => {
|
Ok(file_enumerator) => {
|
||||||
for entry in file_enumerator {
|
for entry in file_enumerator {
|
||||||
match entry {
|
match entry {
|
||||||
@ -50,16 +53,11 @@ impl File {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// is not a directory, try handle as file
|
|
||||||
Err(_) => File::for_uri(&uri.to_string()).load_contents_async(
|
|
||||||
Some(&cancellable),
|
|
||||||
|result| match result {
|
|
||||||
Ok(_) => todo!(),
|
|
||||||
Err(_) => todo!(),
|
Err(_) => todo!(),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user