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

Userland: Prefer non-fallible construction for LibGUI objects

This commit is contained in:
Tim Ledbetter 2023-09-18 06:00:51 +01:00 committed by Andreas Kling
parent a4a94de942
commit a6f6a1afd2
54 changed files with 69 additions and 70 deletions

View file

@ -23,7 +23,7 @@ ErrorOr<NonnullRefPtr<LinkLabel>> LinkLabel::try_create(String text)
{
auto label = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) LinkLabel(move(text))));
TRY(label->create_actions());
TRY(label->create_menus());
label->create_menus();
return label;
}
@ -47,13 +47,12 @@ ErrorOr<void> LinkLabel::create_actions()
return {};
}
ErrorOr<void> LinkLabel::create_menus()
void LinkLabel::create_menus()
{
m_context_menu = TRY(Menu::try_create());
m_context_menu = Menu::construct();
m_context_menu->add_action(*m_open_action);
m_context_menu->add_separator();
m_context_menu->add_action(*m_copy_action);
return {};
}
void LinkLabel::set_hovered(bool hover)