diff options
author | networkException <git@nwex.de> | 2022-09-29 01:30:58 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-09-29 09:39:04 +0100 |
commit | 4230dbbb21ec68cbb9844130d5e90276c96d16c2 (patch) | |
tree | a2586bed833a3577a997d2e8cd5e7df232978bc1 /Userland/DevTools | |
parent | 454bf1fde054591d1215404617126ce31b281171 (diff) | |
download | serenity-4230dbbb21ec68cbb9844130d5e90276c96d16c2.zip |
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
Diffstat (limited to 'Userland/DevTools')
-rw-r--r-- | Userland/DevTools/GMLPlayground/main.cpp | 4 | ||||
-rw-r--r-- | Userland/DevTools/HackStudio/HackStudioWidget.cpp | 2 | ||||
-rw-r--r-- | Userland/DevTools/Inspector/main.cpp | 4 | ||||
-rw-r--r-- | Userland/DevTools/Profiler/main.cpp | 4 | ||||
-rw-r--r-- | Userland/DevTools/SQLStudio/MainWidget.cpp | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/Userland/DevTools/GMLPlayground/main.cpp b/Userland/DevTools/GMLPlayground/main.cpp index 6a49c51cf0..9530a76c47 100644 --- a/Userland/DevTools/GMLPlayground/main.cpp +++ b/Userland/DevTools/GMLPlayground/main.cpp @@ -67,7 +67,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) TRY(Core::System::pledge("stdio thread recvfd sendfd cpath rpath wpath unix")); auto app = TRY(GUI::Application::try_create(arguments)); - TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man1/GMLPlayground.md") })); + TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man1/GMLPlayground.md") })); TRY(Desktop::Launcher::seal_allowlist()); TRY(Core::System::pledge("stdio thread recvfd sendfd rpath cpath wpath")); @@ -248,7 +248,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto help_menu = TRY(window->try_add_menu("&Help")); TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) { - Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/GMLPlayground.md"), "/bin/Help"); + Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/GMLPlayground.md"), "/bin/Help"); }))); TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("GML Playground", app_icon, window))); diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp index bd935fb676..30bb875ef3 100644 --- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp +++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp @@ -606,7 +606,7 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_show_in_file_manager_action( auto show_in_file_manager_action = GUI::Action::create("Show in File &Manager", [this](const GUI::Action&) { auto files = selected_file_paths(); for (auto& file : files) - Desktop::Launcher::open(URL::create_with_file_protocol(m_project->root_path(), file)); + Desktop::Launcher::open(URL::create_with_file_scheme(m_project->root_path(), file)); }); show_in_file_manager_action->set_enabled(true); show_in_file_manager_action->set_icon(GUI::Icon::default_icon("app-file-manager"sv).bitmap_for_size(16)); diff --git a/Userland/DevTools/Inspector/main.cpp b/Userland/DevTools/Inspector/main.cpp index cedb75537f..9cefbcac5b 100644 --- a/Userland/DevTools/Inspector/main.cpp +++ b/Userland/DevTools/Inspector/main.cpp @@ -79,7 +79,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) } } - TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man1/Inspector.md") })); + TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man1/Inspector.md") })); TRY(Desktop::Launcher::seal_allowlist()); window->set_title("Inspector"); @@ -91,7 +91,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto& help_menu = window->add_menu("&Help"); help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) { - Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/Inspector.md"), "/bin/Help"); + Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Inspector.md"), "/bin/Help"); })); help_menu.add_action(GUI::CommonActions::make_about_action("Inspector", app_icon, window)); diff --git a/Userland/DevTools/Profiler/main.cpp b/Userland/DevTools/Profiler/main.cpp index 92c934b1de..37c0d6dc64 100644 --- a/Userland/DevTools/Profiler/main.cpp +++ b/Userland/DevTools/Profiler/main.cpp @@ -79,7 +79,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto window = TRY(GUI::Window::try_create()); - TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man1/Profiler.md") })); + TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man1/Profiler.md") })); TRY(Desktop::Launcher::seal_allowlist()); window->set_title("Profiler"); @@ -301,7 +301,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) auto help_menu = TRY(window->try_add_menu("&Help")); TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) { - Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/Profiler.md"), "/bin/Help"); + Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Profiler.md"), "/bin/Help"); }))); TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Profiler", app_icon, window))); diff --git a/Userland/DevTools/SQLStudio/MainWidget.cpp b/Userland/DevTools/SQLStudio/MainWidget.cpp index 7245277f4d..1c8e8ccc5b 100644 --- a/Userland/DevTools/SQLStudio/MainWidget.cpp +++ b/Userland/DevTools/SQLStudio/MainWidget.cpp @@ -265,7 +265,7 @@ void MainWidget::initialize_menu(GUI::Window* window) auto& help_menu = window->add_menu("&Help"); help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) { - Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/SQLStudio.md"), "/bin/Help"); + Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/SQLStudio.md"), "/bin/Help"); })); help_menu.add_action(GUI::CommonActions::make_about_action("SQL Studio", GUI::Icon::default_icon("app-sql-studio"sv), window)); } |