1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:28:11 +00:00

AK+Everywhere: Replace "protocol" with "scheme" url helpers

URL had properly named replacements for protocol(), set_protocol() and
create_with_file_protocol() already. This patch removes these function
and updates all call sites to use the functions named according to the
specification.

See https://url.spec.whatwg.org/#concept-url-scheme
This commit is contained in:
networkException 2022-09-29 01:30:58 +02:00 committed by Linus Groh
parent 454bf1fde0
commit 4230dbbb21
61 changed files with 113 additions and 116 deletions

View file

@ -660,7 +660,7 @@ void BarewordLiteral::highlight_in_editor(Line::Editor& editor, Shell& shell, Hi
}
if (Core::File::exists(m_text)) {
auto realpath = shell.resolve_path(m_text);
auto url = URL::create_with_file_protocol(realpath);
auto url = URL::create_with_file_scheme(realpath);
url.set_host(shell.hostname);
editor.stylize({ m_position.start_offset, m_position.end_offset }, { Line::Style::Hyperlink(url.to_string()) });
}
@ -2496,7 +2496,7 @@ void PathRedirectionNode::highlight_in_editor(Line::Editor& editor, Shell& shell
auto& path = path_text[0];
if (!path.starts_with('/'))
path = String::formatted("{}/{}", shell.cwd, path);
auto url = URL::create_with_file_protocol(path);
auto url = URL::create_with_file_scheme(path);
url.set_host(shell.hostname);
editor.stylize({ position.start_offset, position.end_offset }, { Line::Style::Hyperlink(url.to_string()) });
}
@ -3058,7 +3058,7 @@ void Juxtaposition::highlight_in_editor(Line::Editor& editor, Shell& shell, High
if (Core::File::exists(path)) {
auto realpath = shell.resolve_path(path);
auto url = URL::create_with_file_protocol(realpath);
auto url = URL::create_with_file_scheme(realpath);
url.set_host(shell.hostname);
editor.stylize({ m_position.start_offset, m_position.end_offset }, { Line::Style::Hyperlink(url.to_string()) });
}