diff --git a/Userland/Applets/ClipboardHistory/main.cpp b/Userland/Applets/ClipboardHistory/main.cpp index 72054011086..f3e705ae354 100644 --- a/Userland/Applets/ClipboardHistory/main.cpp +++ b/Userland/Applets/ClipboardHistory/main.cpp @@ -18,7 +18,7 @@ ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio recvfd sendfd rpath unix")); - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); Config::pledge_domain("ClipboardHistory"); Config::monitor_domain("ClipboardHistory"); diff --git a/Userland/Applets/ResourceGraph/main.cpp b/Userland/Applets/ResourceGraph/main.cpp index 6b897b6df8e..e63a162cbc8 100644 --- a/Userland/Applets/ResourceGraph/main.cpp +++ b/Userland/Applets/ResourceGraph/main.cpp @@ -269,7 +269,7 @@ ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio recvfd sendfd proc exec rpath unix")); - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); TRY(Core::System::pledge("stdio recvfd sendfd proc exec rpath")); diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp index e27246411be..f4a2475c1e2 100644 --- a/Userland/Applications/3DFileViewer/main.cpp +++ b/Userland/Applications/3DFileViewer/main.cpp @@ -356,7 +356,7 @@ bool GLContextWidget::load_file(Core::File& file) ErrorOr serenity_main(Main::Arguments arguments) { - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); TRY(Core::System::pledge("stdio thread recvfd sendfd rpath unix prot_exec")); diff --git a/Userland/Applications/Assistant/main.cpp b/Userland/Applications/Assistant/main.cpp index 0b3c149287d..d05a2d2efd8 100644 --- a/Userland/Applications/Assistant/main.cpp +++ b/Userland/Applications/Assistant/main.cpp @@ -207,7 +207,7 @@ ErrorOr serenity_main(Main::Arguments arguments) return 0; } - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); auto window = GUI::Window::construct(); window->set_minimizable(false); diff --git a/Userland/Applications/Browser/main.cpp b/Userland/Applications/Browser/main.cpp index 4c6839c8c28..3d4665c2093 100644 --- a/Userland/Applications/Browser/main.cpp +++ b/Userland/Applications/Browser/main.cpp @@ -66,7 +66,7 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_positional_argument(specified_url, "URL to open", "url", Core::ArgsParser::Required::No); args_parser.parse(arguments); - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); Config::pledge_domain("Browser"); Config::monitor_domain("Browser"); diff --git a/Userland/Applications/KeyboardMapper/main.cpp b/Userland/Applications/KeyboardMapper/main.cpp index e532fb9d0c6..c421aec6c0f 100644 --- a/Userland/Applications/KeyboardMapper/main.cpp +++ b/Userland/Applications/KeyboardMapper/main.cpp @@ -25,7 +25,7 @@ ErrorOr serenity_main(Main::Arguments arguments) TRY(Core::System::pledge("stdio getkeymap thread rpath cpath wpath recvfd sendfd unix")); - auto app = GUI::Application::construct(arguments.argc, arguments.argv); + auto app = TRY(GUI::Application::try_create(arguments)); TRY(Core::System::pledge("stdio getkeymap thread rpath cpath wpath recvfd sendfd")); diff --git a/Userland/Applications/Magnifier/main.cpp b/Userland/Applications/Magnifier/main.cpp index 8cc721886af..ad93313ad11 100644 --- a/Userland/Applications/Magnifier/main.cpp +++ b/Userland/Applications/Magnifier/main.cpp @@ -18,7 +18,7 @@ ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd unix")); - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd")); TRY(Core::System::unveil("/res", "r")); diff --git a/Userland/Applications/Mail/main.cpp b/Userland/Applications/Mail/main.cpp index a0a4384a4e9..4e8c5e3895e 100644 --- a/Userland/Applications/Mail/main.cpp +++ b/Userland/Applications/Mail/main.cpp @@ -20,7 +20,7 @@ ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio recvfd sendfd rpath unix inet")); - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); Config::pledge_domain("Mail"); diff --git a/Userland/Applications/Piano/main.cpp b/Userland/Applications/Piano/main.cpp index 5093de32b9f..6f579472236 100644 --- a/Userland/Applications/Piano/main.cpp +++ b/Userland/Applications/Piano/main.cpp @@ -29,7 +29,7 @@ ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio thread rpath cpath wpath recvfd sendfd unix")); - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); TrackManager track_manager; diff --git a/Userland/Applications/PixelPaint/main.cpp b/Userland/Applications/PixelPaint/main.cpp index 71ba88cf138..47cf207c3fa 100644 --- a/Userland/Applications/PixelPaint/main.cpp +++ b/Userland/Applications/PixelPaint/main.cpp @@ -23,7 +23,7 @@ ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio thread recvfd sendfd rpath unix wpath cpath")); - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); Config::pledge_domain("PixelPaint"); char const* image_file = nullptr; diff --git a/Userland/Applications/SpaceAnalyzer/main.cpp b/Userland/Applications/SpaceAnalyzer/main.cpp index 560c7d9e4e8..04864c2265f 100644 --- a/Userland/Applications/SpaceAnalyzer/main.cpp +++ b/Userland/Applications/SpaceAnalyzer/main.cpp @@ -302,7 +302,7 @@ static String get_absolute_path_to_selected_node(SpaceAnalyzer::TreeMapWidget co ErrorOr serenity_main(Main::Arguments arguments) { - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); RefPtr tree = adopt_ref(*new Tree("")); diff --git a/Userland/Applications/Spreadsheet/main.cpp b/Userland/Applications/Spreadsheet/main.cpp index 657f6b25e37..25e03aad3dc 100644 --- a/Userland/Applications/Spreadsheet/main.cpp +++ b/Userland/Applications/Spreadsheet/main.cpp @@ -28,7 +28,7 @@ ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio recvfd sendfd rpath fattr unix cpath wpath thread")); - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); char const* filename = nullptr; diff --git a/Userland/Applications/ThemeEditor/main.cpp b/Userland/Applications/ThemeEditor/main.cpp index 9149e5285b7..7e068bfe6c9 100644 --- a/Userland/Applications/ThemeEditor/main.cpp +++ b/Userland/Applications/ThemeEditor/main.cpp @@ -161,7 +161,7 @@ ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio recvfd sendfd thread rpath cpath wpath unix")); - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); char const* file_to_edit = nullptr; diff --git a/Userland/DevTools/HackStudio/main.cpp b/Userland/DevTools/HackStudio/main.cpp index 9473fcdc4d3..94fb9d2880f 100644 --- a/Userland/DevTools/HackStudio/main.cpp +++ b/Userland/DevTools/HackStudio/main.cpp @@ -38,7 +38,7 @@ ErrorOr serenity_main(Main::Arguments arguments) { TRY(Core::System::pledge("stdio recvfd sendfd tty rpath cpath wpath proc exec unix fattr thread ptrace")); - auto app = GUI::Application::construct(arguments.argc, arguments.argv); + auto app = TRY(GUI::Application::try_create(arguments)); Config::pledge_domains({ "HackStudio", "Terminal" }); auto window = GUI::Window::construct(); diff --git a/Userland/Services/FileSystemAccessServer/main.cpp b/Userland/Services/FileSystemAccessServer/main.cpp index 8a1476d6883..5556104df26 100644 --- a/Userland/Services/FileSystemAccessServer/main.cpp +++ b/Userland/Services/FileSystemAccessServer/main.cpp @@ -14,7 +14,7 @@ ErrorOr serenity_main(Main::Arguments) { TRY(Core::System::pledge("stdio recvfd sendfd rpath cpath wpath unix thread")); - auto app = GUI::Application::construct(0, nullptr); + auto app = TRY(GUI::Application::try_create(0, nullptr)); app->set_quit_when_last_window_deleted(false); auto client = TRY(IPC::take_over_accepted_client_from_system_server()); diff --git a/Userland/Services/LoginServer/main.cpp b/Userland/Services/LoginServer/main.cpp index 8c49eaa813f..77fc8fbad4e 100644 --- a/Userland/Services/LoginServer/main.cpp +++ b/Userland/Services/LoginServer/main.cpp @@ -54,7 +54,7 @@ static void login(Core::Account const& account, LoginWindow& window) ErrorOr serenity_main(Main::Arguments arguments) { - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); TRY(Core::System::pledge("stdio recvfd sendfd rpath exec proc id")); TRY(Core::System::unveil("/home", "r")); diff --git a/Userland/Utilities/chres.cpp b/Userland/Utilities/chres.cpp index 3f27e0b029c..4bfc5f48b6a 100644 --- a/Userland/Utilities/chres.cpp +++ b/Userland/Utilities/chres.cpp @@ -26,7 +26,7 @@ ErrorOr serenity_main(Main::Arguments arguments) // A Core::EventLoop is all we need, but ConnectionToWindowServer needs a full Application object. char* dummy_argv[] = { arguments.argv[0] }; - auto app = GUI::Application::construct(1, dummy_argv); + auto app = TRY(GUI::Application::try_create(1, dummy_argv)); auto screen_layout = GUI::ConnectionToWindowServer::the().get_screen_layout(); if (screen < 0 || (size_t)screen >= screen_layout.screens.size()) { warnln("invalid screen index: {}", screen); diff --git a/Userland/Utilities/copy.cpp b/Userland/Utilities/copy.cpp index 04562db98e3..cb4a2229299 100644 --- a/Userland/Utilities/copy.cpp +++ b/Userland/Utilities/copy.cpp @@ -64,7 +64,7 @@ static Options parse_options(Main::Arguments arguments) ErrorOr serenity_main(Main::Arguments arguments) { - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); Options options = parse_options(arguments); diff --git a/Userland/Utilities/pape.cpp b/Userland/Utilities/pape.cpp index bbeb27b1477..f3f28a2e883 100644 --- a/Userland/Utilities/pape.cpp +++ b/Userland/Utilities/pape.cpp @@ -28,7 +28,7 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_positional_argument(path, "Wallpaper to set", "path", Core::ArgsParser::Required::No); args_parser.parse(arguments); - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); if (show_all) { Core::DirIterator wallpapers_directory_iterator("/res/wallpapers", Core::DirIterator::SkipDots); diff --git a/Userland/Utilities/paste.cpp b/Userland/Utilities/paste.cpp index 4083ef02079..20e9db0b2db 100644 --- a/Userland/Utilities/paste.cpp +++ b/Userland/Utilities/paste.cpp @@ -62,7 +62,7 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_positional_argument(watch_command, "Command to run in watch mode", "command", Core::ArgsParser::Required::No); args_parser.parse(arguments); - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); auto& clipboard = GUI::Clipboard::the(); diff --git a/Userland/Utilities/shot.cpp b/Userland/Utilities/shot.cpp index 7c7223c4d28..399954fe0c3 100644 --- a/Userland/Utilities/shot.cpp +++ b/Userland/Utilities/shot.cpp @@ -109,7 +109,7 @@ ErrorOr serenity_main(Main::Arguments arguments) output_path = Core::DateTime::now().to_string("screenshot-%Y-%m-%d-%H-%M-%S.png"); } - auto app = GUI::Application::construct(arguments.argc, arguments.argv); + auto app = TRY(GUI::Application::try_create(arguments)); Optional crop_region; if (select_region) { auto window = GUI::Window::construct(); diff --git a/Userland/Utilities/wsctl.cpp b/Userland/Utilities/wsctl.cpp index 29c8b7480e9..71cdc5bb727 100644 --- a/Userland/Utilities/wsctl.cpp +++ b/Userland/Utilities/wsctl.cpp @@ -10,7 +10,7 @@ ErrorOr serenity_main(Main::Arguments arguments) { - auto app = GUI::Application::construct(arguments); + auto app = TRY(GUI::Application::try_create(arguments)); int flash_flush = -1; Core::ArgsParser args_parser;