mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:47:34 +00:00
Userland: Construct Menus with name using the non-deprecated String
This commit is contained in:
parent
c4c1df7621
commit
956f4d9205
9 changed files with 15 additions and 21 deletions
|
@ -18,14 +18,14 @@ ErrorOr<void> Menubar::try_add_menu(Badge<Window>, NonnullRefPtr<Menu> menu)
|
|||
|
||||
ErrorOr<NonnullRefPtr<Menu>> Menubar::try_add_menu(Badge<Window>, DeprecatedString name)
|
||||
{
|
||||
auto menu = TRY(try_add<Menu>(move(name)));
|
||||
auto menu = TRY(try_add<Menu>(TRY(String::from_deprecated_string(name))));
|
||||
TRY(m_menus.try_append(menu));
|
||||
return menu;
|
||||
}
|
||||
|
||||
Menu& Menubar::add_menu(Badge<Window>, DeprecatedString name)
|
||||
{
|
||||
auto& menu = add<Menu>(move(name));
|
||||
auto& menu = add<Menu>(String::from_deprecated_string(name).release_value_but_fixme_should_propagate_errors());
|
||||
m_menus.append(menu);
|
||||
return menu;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue