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

Userland: Construct Menus with name using the non-deprecated String

This commit is contained in:
Karol Kosek 2023-04-15 17:18:45 +02:00 committed by Andreas Kling
parent c4c1df7621
commit 956f4d9205
9 changed files with 15 additions and 21 deletions

View file

@ -38,11 +38,6 @@ Menu::Menu(String name)
{
}
Menu::Menu(DeprecatedString name)
: m_name(String::from_deprecated_string(name).release_value_but_fixme_should_propagate_errors())
{
}
Menu::~Menu()
{
unrealize_menu();
@ -119,7 +114,7 @@ ErrorOr<NonnullRefPtr<Menu>> Menu::try_add_submenu(DeprecatedString name)
// NOTE: We grow the vector first, to get allocation failure handled immediately.
TRY(m_items.try_ensure_capacity(m_items.size() + 1));
auto submenu = TRY(Menu::try_create(name));
auto submenu = TRY(Menu::try_create(TRY(String::from_deprecated_string(name))));
auto item = TRY(adopt_nonnull_own_or_enomem(new (nothrow) MenuItem(m_menu_id, submenu)));
submenu->set_parent(*this, m_items.size());