Spider: Replace construct() with TRY(try_create()) pattern

This commit is contained in:
Pedro Pereira 2021-11-24 00:39:32 +00:00 committed by Andreas Kling
parent 302784ebf8
commit 2efec90fb7
Notes: sideshowbarker 2024-07-18 00:44:44 +09:00

View File

@ -41,7 +41,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{ {
TRY(Core::System::pledge("stdio recvfd sendfd rpath unix", nullptr)); TRY(Core::System::pledge("stdio recvfd sendfd rpath unix", nullptr));
auto app = GUI::Application::construct(arguments); auto app = TRY(GUI::Application::try_create(arguments));
auto app_icon = GUI::Icon::default_icon("app-spider"); auto app_icon = GUI::Icon::default_icon("app-spider");
Config::pledge_domains("Spider"); Config::pledge_domains("Spider");
@ -51,7 +51,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil("/res", "r"));
TRY(Core::System::unveil(nullptr, nullptr)); TRY(Core::System::unveil(nullptr, nullptr));
auto window = GUI::Window::construct(); auto window = TRY(GUI::Window::try_create());
window->set_title("Spider"); window->set_title("Spider");
auto mode = static_cast<Spider::Mode>(Config::read_i32("Spider", "Settings", "Mode", static_cast<int>(Spider::Mode::SingleSuit))); auto mode = static_cast<Spider::Mode>(Config::read_i32("Spider", "Settings", "Mode", static_cast<int>(Spider::Mode::SingleSuit)));