summaryrefslogtreecommitdiff
path: root/Userland/Applications/Browser/BrowserWindow.cpp
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2023-01-06 16:48:37 +0000
committerAndrew Kaster <andrewdkaster@gmail.com>2023-01-06 13:36:02 -0700
commit0c24522635ec7f07e1fb69d9e1cd350d81e2248f (patch)
tree391782374bada7ee7a986674229551c2ec21f75a /Userland/Applications/Browser/BrowserWindow.cpp
parentd223477bc650e271008ccc339fc1e2c0fcc079e7 (diff)
downloadserenity-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/Applications/Browser/BrowserWindow.cpp')
-rw-r--r--Userland/Applications/Browser/BrowserWindow.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp
index c7029a3384..f11b259814 100644
--- a/Userland/Applications/Browser/BrowserWindow.cpp
+++ b/Userland/Applications/Browser/BrowserWindow.cpp
@@ -73,12 +73,12 @@ BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url)
set_icon(app_icon.bitmap_for_size(16));
set_title("Browser");
- auto& widget = set_main_widget<GUI::Widget>();
- widget.load_from_gml(browser_window_gml);
+ auto widget = set_main_widget<GUI::Widget>().release_value_but_fixme_should_propagate_errors();
+ widget->load_from_gml(browser_window_gml);
- auto& top_line = *widget.find_descendant_of_type_named<GUI::HorizontalSeparator>("top_line");
+ auto& top_line = *widget->find_descendant_of_type_named<GUI::HorizontalSeparator>("top_line");
- m_tab_widget = *widget.find_descendant_of_type_named<GUI::TabWidget>("tab_widget");
+ m_tab_widget = *widget->find_descendant_of_type_named<GUI::TabWidget>("tab_widget");
m_tab_widget->on_tab_count_change = [&top_line](size_t tab_count) {
top_line.set_visible(tab_count > 1);
};