1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:47:35 +00:00

Applets/Network: Propagate errors with try_set_main_widget

Use try_set_main_widget instead of set_main_widget.
This commit is contained in:
creator1creeper1 2021-12-25 13:31:15 +01:00 committed by Andreas Kling
parent 43ecf1d429
commit f125d52622

View file

@ -183,8 +183,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_window_type(GUI::WindowType::Applet); window->set_window_type(GUI::WindowType::Applet);
window->set_has_alpha_channel(true); window->set_has_alpha_channel(true);
window->resize(16, 16); window->resize(16, 16);
auto& icon = window->set_main_widget<NetworkWidget>(display_notifications); auto icon = TRY(window->try_set_main_widget<NetworkWidget>(display_notifications));
icon.load_from_file("/res/icons/16x16/network.png"); icon->load_from_file("/res/icons/16x16/network.png");
window->resize(16, 16); window->resize(16, 16);
window->show(); window->show();