1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 08:28:11 +00:00

LibGUI: Remove Menubar::try_add_menu()

And fall back to the infallible add_menu().
This commit is contained in:
Andreas Kling 2023-08-14 10:22:49 +02:00
parent 94cd272ac0
commit 5300896095
4 changed files with 8 additions and 17 deletions

View file

@ -10,20 +10,12 @@
namespace GUI {
ErrorOr<void> Menubar::try_add_menu(Badge<Window>, NonnullRefPtr<Menu> menu)
void Menubar::add_menu(Badge<Window>, NonnullRefPtr<Menu> menu)
{
TRY(m_menus.try_append(menu));
return {};
m_menus.append(menu);
}
ErrorOr<NonnullRefPtr<Menu>> Menubar::try_add_menu(Badge<Window>, String name)
{
auto menu = TRY(try_add<Menu>(move(name)));
TRY(m_menus.try_append(menu));
return menu;
}
Menu& Menubar::add_menu(Badge<Window>, String name)
NonnullRefPtr<Menu> Menubar::add_menu(Badge<Window>, String name)
{
auto& menu = add<Menu>(move(name));
m_menus.append(menu);