diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-01-06 16:48:37 +0000 |
---|---|---|
committer | Andrew Kaster <andrewdkaster@gmail.com> | 2023-01-06 13:36:02 -0700 |
commit | 0c24522635ec7f07e1fb69d9e1cd350d81e2248f (patch) | |
tree | 391782374bada7ee7a986674229551c2ec21f75a /Userland/Libraries/LibGUI/EmojiInputDialog.cpp | |
parent | d223477bc650e271008ccc339fc1e2c0fcc079e7 (diff) | |
download | serenity-0c24522635ec7f07e1fb69d9e1cd350d81e2248f.zip |
LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^)
Rip that bandaid off!
This does the following, in one big, awkward jump:
- Replace all uses of `set_main_widget<Foo>()` with the `try` version.
- Remove `set_main_widget<Foo>()`.
- Rename the `try` version to just be `set_main_widget` because it's now
the only one.
The majority of places that call `set_main_widget<Foo>()` are inside
constructors, so this unfortunately gives us a big batch of new
`release_value_but_fixme_should_propagate_errors()` calls.
Diffstat (limited to 'Userland/Libraries/LibGUI/EmojiInputDialog.cpp')
-rw-r--r-- | Userland/Libraries/LibGUI/EmojiInputDialog.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp index 1cc0dff127..f4d99562d5 100644 --- a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp +++ b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp @@ -92,8 +92,8 @@ EmojiInputDialog::EmojiInputDialog(Window* parent_window) : Dialog(parent_window) , m_category_action_group(make<ActionGroup>()) { - auto& main_widget = set_main_widget<Frame>(); - if (!main_widget.load_from_gml(emoji_input_dialog_gml)) + auto main_widget = set_main_widget<Frame>().release_value_but_fixme_should_propagate_errors(); + if (!main_widget->load_from_gml(emoji_input_dialog_gml)) VERIFY_NOT_REACHED(); set_window_type(GUI::WindowType::Popup); @@ -101,10 +101,10 @@ EmojiInputDialog::EmojiInputDialog(Window* parent_window) set_blocks_emoji_input(true); resize(400, 300); - auto& scrollable_container = *main_widget.find_descendant_of_type_named<GUI::ScrollableContainerWidget>("scrollable_container"sv); - m_search_box = main_widget.find_descendant_of_type_named<GUI::TextBox>("search_box"sv); - m_toolbar = main_widget.find_descendant_of_type_named<GUI::Toolbar>("toolbar"sv); - m_emojis_widget = main_widget.find_descendant_of_type_named<GUI::Widget>("emojis"sv); + auto& scrollable_container = *main_widget->find_descendant_of_type_named<GUI::ScrollableContainerWidget>("scrollable_container"sv); + m_search_box = main_widget->find_descendant_of_type_named<GUI::TextBox>("search_box"sv); + m_toolbar = main_widget->find_descendant_of_type_named<GUI::Toolbar>("toolbar"sv); + m_emojis_widget = main_widget->find_descendant_of_type_named<GUI::Widget>("emojis"sv); m_emojis = supported_emoji(); m_category_action_group->set_exclusive(true); |