mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
WindowServer: Add const version of Menu::find_menu_by_id(int menu_id)
It's a little sad having two diferent versions of this function, but I don't know of any better way to do it. This also gets rid of some const casts down the line.
This commit is contained in:
parent
08064ed219
commit
41471eb3ae
Notes:
sideshowbarker
2024-07-19 06:31:23 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/41471eb3ae5 Pull-request: https://github.com/SerenityOS/serenity/pull/2282
1 changed files with 7 additions and 0 deletions
|
@ -72,6 +72,13 @@ public:
|
|||
return nullptr;
|
||||
return const_cast<Menu*>(menu.value().ptr());
|
||||
}
|
||||
const Menu* find_menu_by_id(int menu_id) const
|
||||
{
|
||||
auto menu = m_menus.get(menu_id);
|
||||
if (!menu.has_value())
|
||||
return nullptr;
|
||||
return menu.value().ptr();
|
||||
}
|
||||
|
||||
void notify_display_link(Badge<Compositor>);
|
||||
|
||||
|
|
Loading…
Reference in a new issue