mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:17:35 +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
1 changed files with 7 additions and 0 deletions
|
@ -72,6 +72,13 @@ public:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
return const_cast<Menu*>(menu.value().ptr());
|
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>);
|
void notify_display_link(Badge<Compositor>);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue