Decode URL encoded recents bookmark

File paths are URL encoded in the recently-used.xbel file. Paths with
spaces (or whatever) need to be decoded or else the Recents tab skips
those entries.
This commit is contained in:
Josh Megnauth 2025-07-28 00:46:20 -04:00 committed by Jeremy Soller
parent dfb2ca7443
commit 64c8506dd2

View file

@ -1138,8 +1138,14 @@ pub fn scan_trash(sizes: IconSizes) -> Vec<Item> {
}
fn uri_to_path(uri: String) -> Option<PathBuf> {
//TODO support for external drive or cloud?
uri.strip_prefix("file://").map(PathBuf::from)
uri.parse::<url::Url>().ok().and_then(|url| {
//TODO support for external drive or cloud?
if url.scheme() == "file" {
url.to_file_path().ok()
} else {
None
}
})
}
pub fn scan_recents(sizes: IconSizes) -> Vec<Item> {