diff --git a/Userland/Applications/Calendar/AddEventWidget.cpp b/Userland/Applications/Calendar/AddEventWidget.cpp index 9c2c22b5a5..38dbea3995 100644 --- a/Userland/Applications/Calendar/AddEventWidget.cpp +++ b/Userland/Applications/Calendar/AddEventWidget.cpp @@ -26,7 +26,7 @@ ErrorOr> AddEventWidget::create(AddEventDialog* wi widget->m_start_date_box = *widget->find_descendant_of_type_named("start_date"); - auto calendar_date_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/calendar-date.png"sv).release_value_but_fixme_should_propagate_errors(); + auto calendar_date_icon = TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/calendar-date.png"sv)); auto& pick_start_date_button = *widget->find_descendant_of_type_named("pick_start_date"); pick_start_date_button.set_icon(calendar_date_icon); diff --git a/Userland/Applications/HexEditor/HexEditorWidget.cpp b/Userland/Applications/HexEditor/HexEditorWidget.cpp index b5cd648ea7..df7ceead6b 100644 --- a/Userland/Applications/HexEditor/HexEditorWidget.cpp +++ b/Userland/Applications/HexEditor/HexEditorWidget.cpp @@ -149,7 +149,7 @@ ErrorOr HexEditorWidget::setup() m_editor->update(); }; - m_new_action = GUI::Action::create("New...", { Mod_Ctrl, Key_N }, Gfx::Bitmap::load_from_file("/res/icons/16x16/new.png"sv).release_value_but_fixme_should_propagate_errors(), [this](const GUI::Action&) { + m_new_action = GUI::Action::create("New...", { Mod_Ctrl, Key_N }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/new.png"sv)), [this](const GUI::Action&) { String value; if (request_close() && GUI::InputBox::show(window(), value, "Enter a size:"sv, "New File"sv, GUI::InputType::NonemptyText) == GUI::InputBox::ExecResult::OK) { auto file_size = AK::StringUtils::convert_to_uint(value); @@ -208,7 +208,7 @@ ErrorOr HexEditorWidget::setup() dbgln("Wrote document to {}", file.filename()); }); - m_open_annotations_action = GUI::Action::create("Load Annotations...", Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { + m_open_annotations_action = GUI::Action::create("Load Annotations...", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/open.png"sv)), [this](auto&) { auto response = FileSystemAccessClient::Client::the().open_file(window(), { .window_title = "Load annotations file"sv, .requested_access = Core::File::OpenMode::Read, @@ -225,7 +225,7 @@ ErrorOr HexEditorWidget::setup() }); m_open_annotations_action->set_status_tip("Load annotations from a file"_string); - m_save_annotations_action = GUI::Action::create("Save Annotations", Gfx::Bitmap::load_from_file("/res/icons/16x16/save.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) { + m_save_annotations_action = GUI::Action::create("Save Annotations", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/save.png"sv)), [&](auto&) { if (m_annotations_path.is_empty()) return m_save_annotations_as_action->activate(); @@ -239,7 +239,7 @@ ErrorOr HexEditorWidget::setup() }); m_save_annotations_action->set_status_tip("Save annotations to a file"_string); - m_save_annotations_as_action = GUI::Action::create("Save Annotations As...", Gfx::Bitmap::load_from_file("/res/icons/16x16/save-as.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) { + m_save_annotations_as_action = GUI::Action::create("Save Annotations As...", TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/save-as.png"sv)), [&](auto&) { auto response = FileSystemAccessClient::Client::the().save_file(window(), m_name, "annotations"sv, Core::File::OpenMode::Write | Core::File::OpenMode::Truncate); if (response.is_error()) return; @@ -260,7 +260,7 @@ ErrorOr HexEditorWidget::setup() }); m_redo_action->set_enabled(false); - m_find_action = GUI::Action::create("&Find...", { Mod_Ctrl, Key_F }, Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) { + m_find_action = GUI::Action::create("&Find...", { Mod_Ctrl, Key_F }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/find.png"sv)), [&](const GUI::Action&) { auto old_buffer = m_search_buffer; bool find_all = false; if (FindDialog::show(window(), m_search_text, m_search_buffer, find_all) == GUI::InputBox::ExecResult::OK) { @@ -297,7 +297,7 @@ ErrorOr HexEditorWidget::setup() } }); - m_goto_offset_action = GUI::Action::create("&Go to Offset...", { Mod_Ctrl, Key_G }, Gfx::Bitmap::load_from_file("/res/icons/16x16/go-to.png"sv).release_value_but_fixme_should_propagate_errors(), [this](const GUI::Action&) { + m_goto_offset_action = GUI::Action::create("&Go to Offset...", { Mod_Ctrl, Key_G }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/go-to.png"sv)), [this](const GUI::Action&) { int new_offset; auto result = GoToOffsetDialog::show( window(), @@ -326,17 +326,17 @@ ErrorOr HexEditorWidget::setup() Config::write_bool("HexEditor"sv, "Layout"sv, "ShowSearchResults"sv, action.is_checked()); }); - m_copy_hex_action = GUI::Action::create("Copy &Hex", { Mod_Ctrl, Key_C }, Gfx::Bitmap::load_from_file("/res/icons/16x16/hex.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) { + m_copy_hex_action = GUI::Action::create("Copy &Hex", { Mod_Ctrl, Key_C }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/hex.png"sv)), [&](const GUI::Action&) { m_editor->copy_selected_hex_to_clipboard(); }); m_copy_hex_action->set_enabled(false); - m_copy_text_action = GUI::Action::create("Copy &Text", { Mod_Ctrl | Mod_Shift, Key_C }, Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) { + m_copy_text_action = GUI::Action::create("Copy &Text", { Mod_Ctrl | Mod_Shift, Key_C }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/edit-copy.png"sv)), [&](const GUI::Action&) { m_editor->copy_selected_text_to_clipboard(); }); m_copy_text_action->set_enabled(false); - m_copy_as_c_code_action = GUI::Action::create("Copy as &C Code", { Mod_Alt | Mod_Shift, Key_C }, Gfx::Bitmap::load_from_file("/res/icons/16x16/c.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) { + m_copy_as_c_code_action = GUI::Action::create("Copy as &C Code", { Mod_Alt | Mod_Shift, Key_C }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/c.png"sv)), [&](const GUI::Action&) { m_editor->copy_selected_hex_to_clipboard_as_c_code(); }); m_copy_as_c_code_action->set_enabled(false); @@ -563,7 +563,7 @@ ErrorOr HexEditorWidget::initialize_menubar(GUI::Window& window) edit_menu->add_separator(); edit_menu->add_action(GUI::Action::create( "Add Annotation", - Gfx::Bitmap::load_from_file("/res/icons/16x16/annotation-add.png"sv).release_value_but_fixme_should_propagate_errors(), + TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/annotation-add.png"sv)), [this](GUI::Action&) { m_editor->show_create_annotation_dialog(); }, this)); edit_menu->add_separator(); diff --git a/Userland/Applications/TerminalSettings/MainWidget.cpp b/Userland/Applications/TerminalSettings/MainWidget.cpp index 694ee734dc..c4ba4865e9 100644 --- a/Userland/Applications/TerminalSettings/MainWidget.cpp +++ b/Userland/Applications/TerminalSettings/MainWidget.cpp @@ -30,7 +30,7 @@ namespace TerminalSettings { ErrorOr> MainWidget::create() { - auto widget = MainWidget::try_create().release_value_but_fixme_should_propagate_errors(); + auto widget = TRY(MainWidget::try_create()); TRY(widget->setup()); return widget; } diff --git a/Userland/Demos/ModelGallery/GalleryWidget.cpp b/Userland/Demos/ModelGallery/GalleryWidget.cpp index 55c6002b94..8de3d89644 100644 --- a/Userland/Demos/ModelGallery/GalleryWidget.cpp +++ b/Userland/Demos/ModelGallery/GalleryWidget.cpp @@ -46,8 +46,8 @@ ErrorOr GalleryWidget::load_basic_model_tab() m_add_new_item = *tab.find_descendant_of_type_named("add_new_item"); m_remove_selected_item = *tab.find_descendant_of_type_named("remove_selected_item"); - m_add_new_item->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/plus.png"sv).release_value_but_fixme_should_propagate_errors()); - m_remove_selected_item->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/minus.png"sv).release_value_but_fixme_should_propagate_errors()); + m_add_new_item->set_icon(TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/plus.png"sv))); + m_remove_selected_item->set_icon(TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/minus.png"sv))); m_new_item_name->on_return_pressed = [&] { add_textbox_contents_to_basic_model(); }; m_add_new_item->on_click = [&](auto) { add_textbox_contents_to_basic_model(); }; diff --git a/Userland/DevTools/Profiler/main.cpp b/Userland/DevTools/Profiler/main.cpp index 0d2d43caf6..00df1388b0 100644 --- a/Userland/DevTools/Profiler/main.cpp +++ b/Userland/DevTools/Profiler/main.cpp @@ -172,12 +172,12 @@ ErrorOr serenity_main(Main::Arguments arguments) update_source_model(); }; - auto disassembly_action = GUI::Action::create_checkable("Show &Disassembly", { Mod_Ctrl, Key_D }, Gfx::Bitmap::load_from_file("/res/icons/16x16/x86.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto& action) { + auto disassembly_action = GUI::Action::create_checkable("Show &Disassembly", { Mod_Ctrl, Key_D }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/x86.png"sv)), [&](auto& action) { disassembly_view.set_visible(action.is_checked()); update_disassembly_model(); }); - auto source_action = GUI::Action::create_checkable("Show &Source", { Mod_Ctrl, Key_S }, Gfx::Bitmap::load_from_file("/res/icons/16x16/x86.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto& action) { + auto source_action = GUI::Action::create_checkable("Show &Source", { Mod_Ctrl, Key_S }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/x86.png"sv)), [&](auto& action) { source_view.set_visible(action.is_checked()); update_source_model(); }); diff --git a/Userland/Services/RequestServer/ConnectionCache.h b/Userland/Services/RequestServer/ConnectionCache.h index 9e4beacc0f..2a3af7da87 100644 --- a/Userland/Services/RequestServer/ConnectionCache.h +++ b/Userland/Services/RequestServer/ConnectionCache.h @@ -37,14 +37,14 @@ struct Proxy { ErrorOr> tunnel(URL const& url, Args&&... args) { if (data.type == Core::ProxyData::Direct) { - return TRY(SocketType::connect(url.serialized_host().release_value_but_fixme_should_propagate_errors().to_byte_string(), url.port_or_default(), forward(args)...)); + return TRY(SocketType::connect(TRY(url.serialized_host()).to_byte_string(), url.port_or_default(), forward(args)...)); } if (data.type == Core::ProxyData::SOCKS5) { if constexpr (requires { SocketType::connect(declval(), *proxy_client_storage, forward(args)...); }) { - proxy_client_storage = TRY(Core::SOCKSProxyClient::connect(data.host_ipv4, data.port, Core::SOCKSProxyClient::Version::V5, url.serialized_host().release_value_but_fixme_should_propagate_errors().to_byte_string(), url.port_or_default())); - return TRY(SocketType::connect(url.serialized_host().release_value_but_fixme_should_propagate_errors().to_byte_string(), *proxy_client_storage, forward(args)...)); + proxy_client_storage = TRY(Core::SOCKSProxyClient::connect(data.host_ipv4, data.port, Core::SOCKSProxyClient::Version::V5, TRY(url.serialized_host()).to_byte_string(), url.port_or_default())); + return TRY(SocketType::connect(TRY(url.serialized_host()).to_byte_string(), *proxy_client_storage, forward(args)...)); } else if constexpr (IsSame) { - return TRY(Core::SOCKSProxyClient::connect(data.host_ipv4, data.port, Core::SOCKSProxyClient::Version::V5, url.serialized_host().release_value_but_fixme_should_propagate_errors().to_byte_string(), url.port_or_default())); + return TRY(Core::SOCKSProxyClient::connect(data.host_ipv4, data.port, Core::SOCKSProxyClient::Version::V5, TRY(url.serialized_host()).to_byte_string(), url.port_or_default())); } else { return Error::from_string_literal("SOCKS5 not supported for this socket type"); }