mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 18:47:44 +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:
parent
454bf1fde0
commit
4230dbbb21
61 changed files with 113 additions and 116 deletions
|
@ -39,7 +39,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
Config::pledge_domain("2048");
|
||||
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man6/2048.md") }));
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man6/2048.md") }));
|
||||
TRY(Desktop::Launcher::seal_allowlist());
|
||||
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd"));
|
||||
|
@ -203,7 +203,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/man6/2048.md"), "/bin/Help");
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/2048.md"), "/bin/Help");
|
||||
})));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("2048", app_icon, window)));
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
Config::pledge_domain("Chess");
|
||||
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man6/Chess.md") }));
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man6/Chess.md") }));
|
||||
TRY(Desktop::Launcher::seal_allowlist());
|
||||
|
||||
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-chess"sv));
|
||||
|
@ -177,7 +177,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/man6/Chess.md"), "/bin/Help");
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/Chess.md"), "/bin/Help");
|
||||
})));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Chess", app_icon, window)));
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
Config::pledge_domain("FlappyBug");
|
||||
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man6/FlappyBug.md") }));
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man6/FlappyBug.md") }));
|
||||
TRY(Desktop::Launcher::seal_allowlist());
|
||||
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd"));
|
||||
|
@ -62,7 +62,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/man6/FlappyBug.md"), "/bin/Help");
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/FlappyBug.md"), "/bin/Help");
|
||||
})));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Flappy Bug", app_icon, window)));
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
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/man6/GameOfLife.md") }));
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man6/GameOfLife.md") }));
|
||||
TRY(Desktop::Launcher::seal_allowlist());
|
||||
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd"));
|
||||
|
@ -140,7 +140,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/man6/GameOfLife.md"), "/bin/Help");
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/GameOfLife.md"), "/bin/Help");
|
||||
})));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Game Of Life", app_icon, window)));
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix"));
|
||||
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man6/Hearts.md") }));
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man6/Hearts.md") }));
|
||||
TRY(Desktop::Launcher::seal_allowlist());
|
||||
|
||||
TRY(Core::System::pledge("stdio recvfd sendfd rpath"));
|
||||
|
@ -101,7 +101,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/man6/Hearts.md"), "/bin/Help");
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/Hearts.md"), "/bin/Help");
|
||||
})));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Hearts", app_icon, window)));
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
Config::pledge_domain("MasterWord");
|
||||
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man6/MasterWord.md") }));
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man6/MasterWord.md") }));
|
||||
TRY(Desktop::Launcher::seal_allowlist());
|
||||
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd"));
|
||||
|
@ -133,7 +133,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/man6/MasterWord.md"), "/bin/Help");
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/MasterWord.md"), "/bin/Help");
|
||||
})));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("MasterWord", app_icon, window)));
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
Config::pledge_domain("Minesweeper");
|
||||
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man6/Minesweeper.md") }));
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man6/Minesweeper.md") }));
|
||||
TRY(Desktop::Launcher::seal_allowlist());
|
||||
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd"));
|
||||
|
@ -124,7 +124,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/man6/Minesweeper.md"), "/bin/Help");
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/Minesweeper.md"), "/bin/Help");
|
||||
})));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Minesweeper", app_icon, window)));
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
Config::pledge_domain("Snake");
|
||||
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man6/Snake.md") }));
|
||||
TRY(Desktop::Launcher::add_allowed_handler_with_only_specific_urls("/bin/Help", { URL::create_with_file_scheme("/usr/share/man/man6/Snake.md") }));
|
||||
TRY(Desktop::Launcher::seal_allowlist());
|
||||
|
||||
TRY(Core::System::pledge("stdio rpath recvfd sendfd"));
|
||||
|
@ -59,7 +59,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/man6/Snake.md"), "/bin/Help");
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man6/Snake.md"), "/bin/Help");
|
||||
})));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Snake", app_icon, window)));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue