1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

AK: Add missing GenericTraits<NonnullRefPtr>

This enables us to use keys of type NonnullRefPtr in HashMaps and
HashTables.

This commit also includes fixes in various places that used
HashMap<T, NonnullRefPtr<U>>::get() and expected to get an
Optional<NonnullRefPtr<U>> and now get an Optional<U*>.
This commit is contained in:
Itamar 2021-05-08 12:27:12 +03:00 committed by Andreas Kling
parent 1da0d402b7
commit 8a01167c7d
Notes: sideshowbarker 2024-07-18 18:30:35 +09:00
6 changed files with 20 additions and 7 deletions

View file

@ -144,7 +144,7 @@ NonnullRefPtr<GUI::Menu> build_system_menu()
dbgln("App {} has icon with size {}", app.name, icon->size());
}
auto parent_menu = app_category_menus.get(app.category).value_or(*system_menu);
auto parent_menu = app_category_menus.get(app.category).value_or(system_menu.ptr());
parent_menu->add_action(GUI::Action::create(app.name, icon, [app_identifier](auto&) {
dbgln("Activated app with ID {}", app_identifier);
const auto& bin = g_apps[app_identifier].executable;