From 41471eb3ae54168458ec460657dbb520066a4e2e Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Mon, 18 May 2020 22:07:46 +1200 Subject: [PATCH] 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. --- Services/WindowServer/ClientConnection.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Services/WindowServer/ClientConnection.h b/Services/WindowServer/ClientConnection.h index ac62c887144..3ae22199b22 100644 --- a/Services/WindowServer/ClientConnection.h +++ b/Services/WindowServer/ClientConnection.h @@ -72,6 +72,13 @@ public: return nullptr; return const_cast(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);