mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:57:44 +00:00
LibDesktop: Make allowlist APIs return ErrorOr<void>
This makes it very smooth to use TRY() when setting up these lists, as you can see in the rest of this commit. :^)
This commit is contained in:
parent
4a64bb80ea
commit
b6f49924be
8 changed files with 34 additions and 76 deletions
|
@ -78,13 +78,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto window = TRY(GUI::Window::try_create());
|
||||
|
||||
if (!Desktop::Launcher::add_allowed_handler_with_only_specific_urls(
|
||||
"/bin/Help",
|
||||
{ URL::create_with_file_protocol("/usr/share/man/man1/Profiler.md") })
|
||||
|| !Desktop::Launcher::seal_allowlist()) {
|
||||
warnln("Failed to set up allowed launch URLs");
|
||||
return 1;
|
||||
}
|
||||
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::seal_allowlist());
|
||||
|
||||
window->set_title("Profiler");
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue