mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-28 21:32:39 +00:00
Convert URLs to paths returned from NSOpenPanel
using [Url path]
This commit is contained in:
parent
3ba22230dc
commit
39d3b21780
1 changed files with 2 additions and 5 deletions
|
@ -283,13 +283,10 @@ impl platform::Platform for MacPlatform {
|
||||||
let urls = panel.URLs();
|
let urls = panel.URLs();
|
||||||
for i in 0..urls.count() {
|
for i in 0..urls.count() {
|
||||||
let url = urls.objectAtIndex(i);
|
let url = urls.objectAtIndex(i);
|
||||||
let string = url.absoluteString();
|
let path = std::ffi::CStr::from_ptr(url.path().UTF8String())
|
||||||
let string = std::ffi::CStr::from_ptr(string.UTF8String())
|
|
||||||
.to_string_lossy()
|
.to_string_lossy()
|
||||||
.to_string();
|
.to_string();
|
||||||
if let Some(path) = string.strip_prefix("file://") {
|
result.push(PathBuf::from(path));
|
||||||
result.push(PathBuf::from(path));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Some(result)
|
Some(result)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue