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:
Shannon Booth 2020-05-18 22:07:46 +12:00 committed by Andreas Kling
parent 08064ed219
commit 41471eb3ae
Notes: sideshowbarker 2024-07-19 06:31:23 +09:00

View file

@ -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>);