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:
parent
dfb2ca7443
commit
64c8506dd2
1 changed files with 8 additions and 2 deletions
10
src/tab.rs
10
src/tab.rs
|
|
@ -1138,8 +1138,14 @@ pub fn scan_trash(sizes: IconSizes) -> Vec<Item> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn uri_to_path(uri: String) -> Option<PathBuf> {
|
fn uri_to_path(uri: String) -> Option<PathBuf> {
|
||||||
//TODO support for external drive or cloud?
|
uri.parse::<url::Url>().ok().and_then(|url| {
|
||||||
uri.strip_prefix("file://").map(PathBuf::from)
|
//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> {
|
pub fn scan_recents(sizes: IconSizes) -> Vec<Item> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue