mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:47:45 +00:00
AK+Everywhere: Change URL::path() to serialize_path()
This now defaults to serializing the path with percent decoded segments (which is what all callers expect), but has an option not to. This fixes `file://` URLs with spaces in their paths. The name has been changed to serialize_path() path to make it more clear that this method will generate a new string each call (except for the cannot_be_a_base_url() case). A few callers have then been updated to avoid repeatedly calling this function.
This commit is contained in:
parent
5acd40c525
commit
35612c6a7f
42 changed files with 131 additions and 123 deletions
|
@ -100,7 +100,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
window->move_to_front();
|
||||
|
||||
auto path = urls.first().path();
|
||||
auto path = urls.first().serialize_path();
|
||||
auto result = FileSystemAccessClient::Client::the().request_file_read_only_approved(window, path);
|
||||
if (result.is_error())
|
||||
return;
|
||||
|
@ -109,7 +109,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
widget->open_file(value.filename(), value.stream());
|
||||
|
||||
for (size_t i = 1; i < urls.size(); ++i) {
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme(urls[i].path().characters()), "/bin/ImageViewer");
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme(urls[i].serialize_path().characters()), "/bin/ImageViewer");
|
||||
}
|
||||
};
|
||||
widget->on_doubleclick = [&] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue