mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 16:37:47 +00:00
AK: Make "foo"_string infallible
Stop worrying about tiny OOMs. Work towards #20405.
This commit is contained in:
parent
db2a8725c6
commit
34344120f2
181 changed files with 626 additions and 630 deletions
|
@ -265,7 +265,7 @@ void BookmarksBarWidget::update_content_size()
|
|||
} else {
|
||||
// hide all items > m_last_visible_index and create new bookmarks menu for them
|
||||
m_additional->set_visible(true);
|
||||
m_additional_menu = GUI::Menu::construct("Additional Bookmarks"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_additional_menu = GUI::Menu::construct("Additional Bookmarks"_string);
|
||||
m_additional->set_menu(m_additional_menu);
|
||||
for (size_t i = m_last_visible_index; i < m_bookmarks.size(); ++i) {
|
||||
auto& bookmark = m_bookmarks.at(i);
|
||||
|
|
|
@ -215,9 +215,9 @@ void BrowserWindow::build_menus()
|
|||
m_go_back_action = GUI::CommonActions::make_go_back_action([this](auto&) { active_tab().go_back(); }, this);
|
||||
m_go_forward_action = GUI::CommonActions::make_go_forward_action([this](auto&) { active_tab().go_forward(); }, this);
|
||||
m_go_home_action = GUI::CommonActions::make_go_home_action([this](auto&) { active_tab().load(Browser::url_from_user_input(g_home_url)); }, this);
|
||||
m_go_home_action->set_status_tip("Go to home page"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_go_home_action->set_status_tip("Go to home page"_string);
|
||||
m_reload_action = GUI::CommonActions::make_reload_action([this](auto&) { active_tab().reload(); }, this);
|
||||
m_reload_action->set_status_tip("Reload current page"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_reload_action->set_status_tip("Reload current page"_string);
|
||||
|
||||
auto& go_menu = add_menu("&Go"_short_string);
|
||||
go_menu.add_action(*m_go_back_action);
|
||||
|
@ -242,23 +242,23 @@ void BrowserWindow::build_menus()
|
|||
active_tab().view().get_source();
|
||||
},
|
||||
this);
|
||||
m_view_source_action->set_status_tip("View source code of the current page"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_view_source_action->set_status_tip("View source code of the current page"_string);
|
||||
|
||||
m_inspect_dom_tree_action = GUI::Action::create(
|
||||
"Inspect &DOM Tree", { Mod_None, Key_F12 }, g_icon_bag.dom_tree, [this](auto&) {
|
||||
active_tab().show_inspector_window(Tab::InspectorTarget::Document);
|
||||
},
|
||||
this);
|
||||
m_inspect_dom_tree_action->set_status_tip("Open inspector window for this page"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_inspect_dom_tree_action->set_status_tip("Open inspector window for this page"_string);
|
||||
|
||||
m_inspect_dom_node_action = GUI::Action::create(
|
||||
"&Inspect Element", g_icon_bag.inspect, [this](auto&) {
|
||||
active_tab().show_inspector_window(Tab::InspectorTarget::HoveredElement);
|
||||
},
|
||||
this);
|
||||
m_inspect_dom_node_action->set_status_tip("Open inspector for this element"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_inspect_dom_node_action->set_status_tip("Open inspector for this element"_string);
|
||||
|
||||
auto& inspect_menu = add_menu("&Inspect"_string.release_value_but_fixme_should_propagate_errors());
|
||||
auto& inspect_menu = add_menu("&Inspect"_string);
|
||||
inspect_menu.add_action(*m_view_source_action);
|
||||
inspect_menu.add_action(*m_inspect_dom_tree_action);
|
||||
|
||||
|
@ -267,7 +267,7 @@ void BrowserWindow::build_menus()
|
|||
active_tab().show_console_window();
|
||||
},
|
||||
this);
|
||||
js_console_action->set_status_tip("Open JavaScript console for this page"_string.release_value_but_fixme_should_propagate_errors());
|
||||
js_console_action->set_status_tip("Open JavaScript console for this page"_string);
|
||||
inspect_menu.add_action(js_console_action);
|
||||
|
||||
auto storage_window_action = GUI::Action::create(
|
||||
|
@ -275,7 +275,7 @@ void BrowserWindow::build_menus()
|
|||
active_tab().show_storage_inspector();
|
||||
},
|
||||
this);
|
||||
storage_window_action->set_status_tip("Show Storage inspector for this page"_string.release_value_but_fixme_should_propagate_errors());
|
||||
storage_window_action->set_status_tip("Show Storage inspector for this page"_string);
|
||||
inspect_menu.add_action(storage_window_action);
|
||||
|
||||
auto history_window_action = GUI::Action::create(
|
||||
|
@ -283,10 +283,10 @@ void BrowserWindow::build_menus()
|
|||
active_tab().show_history_inspector();
|
||||
},
|
||||
this);
|
||||
storage_window_action->set_status_tip("Show History inspector for this tab"_string.release_value_but_fixme_should_propagate_errors());
|
||||
storage_window_action->set_status_tip("Show History inspector for this tab"_string);
|
||||
inspect_menu.add_action(history_window_action);
|
||||
|
||||
auto& settings_menu = add_menu("&Settings"_string.release_value_but_fixme_should_propagate_errors());
|
||||
auto& settings_menu = add_menu("&Settings"_string);
|
||||
|
||||
m_change_homepage_action = GUI::Action::create(
|
||||
"Set Homepage URL...", g_icon_bag.go_home, [this](auto&) {
|
||||
|
@ -309,7 +309,7 @@ void BrowserWindow::build_menus()
|
|||
dbgln("Failed to open search-engines file: {}", load_search_engines_result.error());
|
||||
}
|
||||
|
||||
auto& color_scheme_menu = settings_menu.add_submenu("&Color Scheme"_string.release_value_but_fixme_should_propagate_errors());
|
||||
auto& color_scheme_menu = settings_menu.add_submenu("&Color Scheme"_string);
|
||||
color_scheme_menu.set_icon(g_icon_bag.color_chooser);
|
||||
{
|
||||
auto current_setting = Web::CSS::preferred_color_scheme_from_string(Config::read_string("Browser"sv, "Preferences"sv, "ColorScheme"sv, Browser::default_color_scheme));
|
||||
|
@ -400,7 +400,7 @@ void BrowserWindow::build_menus()
|
|||
}));
|
||||
|
||||
m_user_agent_spoof_actions.set_exclusive(true);
|
||||
auto& spoof_user_agent_menu = debug_menu.add_submenu("Spoof &User Agent"_string.release_value_but_fixme_should_propagate_errors());
|
||||
auto& spoof_user_agent_menu = debug_menu.add_submenu("Spoof &User Agent"_string);
|
||||
m_disable_user_agent_spoofing = GUI::Action::create_checkable("Disabled", [this](auto&) {
|
||||
active_tab().view().debug_request("spoof-user-agent", Web::default_user_agent);
|
||||
});
|
||||
|
@ -470,7 +470,7 @@ void BrowserWindow::build_menus()
|
|||
ErrorOr<void> BrowserWindow::load_search_engines(GUI::Menu& settings_menu)
|
||||
{
|
||||
m_search_engine_actions.set_exclusive(true);
|
||||
auto& search_engine_menu = settings_menu.add_submenu("&Search Engine"_string.release_value_but_fixme_should_propagate_errors());
|
||||
auto& search_engine_menu = settings_menu.add_submenu("&Search Engine"_string);
|
||||
search_engine_menu.set_icon(g_icon_bag.find);
|
||||
bool search_engine_set = false;
|
||||
|
||||
|
|
|
@ -46,9 +46,9 @@ ErrorOr<String> CookiesModel::column_name(int column) const
|
|||
case Column::Value:
|
||||
return "Value"_short_string;
|
||||
case Column::ExpiryTime:
|
||||
return TRY("Expiry time"_string);
|
||||
return "Expiry time"_string;
|
||||
case Column::SameSite:
|
||||
return TRY("SameSite"_string);
|
||||
return "SameSite"_string;
|
||||
case Column::__Count:
|
||||
return String {};
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ DownloadWidget::DownloadWidget(const URL& url)
|
|||
destination_label.set_fixed_height(16);
|
||||
destination_label.set_text_wrapping(Gfx::TextWrapping::DontWrap);
|
||||
|
||||
m_close_on_finish_checkbox = add<GUI::CheckBox>("Close when finished"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_close_on_finish_checkbox = add<GUI::CheckBox>("Close when finished"_string);
|
||||
m_close_on_finish_checkbox->set_checked(close_on_finish);
|
||||
|
||||
m_close_on_finish_checkbox->on_checked = [&](bool checked) {
|
||||
|
@ -156,7 +156,7 @@ void DownloadWidget::did_finish(bool success)
|
|||
m_browser_image->load_from_file("/res/graphics/download-finished.gif"sv);
|
||||
window()->set_title("Download finished!");
|
||||
m_close_button->set_enabled(true);
|
||||
m_cancel_button->set_text("Open in Folder"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_cancel_button->set_text("Open in Folder"_string);
|
||||
m_cancel_button->on_click = [this](auto) {
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme(Core::StandardPaths::downloads_directory(), m_url.basename()));
|
||||
window()->close();
|
||||
|
|
|
@ -92,7 +92,7 @@ InspectorWidget::InspectorWidget()
|
|||
set_selection(index);
|
||||
};
|
||||
|
||||
auto& accessibility_tree_container = top_tab_widget.add_tab<GUI::Widget>("Accessibility"_string.release_value_but_fixme_should_propagate_errors());
|
||||
auto& accessibility_tree_container = top_tab_widget.add_tab<GUI::Widget>("Accessibility"_string);
|
||||
accessibility_tree_container.set_layout<GUI::VerticalBoxLayout>(4);
|
||||
m_accessibility_tree_view = accessibility_tree_container.add<GUI::TreeView>();
|
||||
m_accessibility_tree_view->on_selection_change = [this] {
|
||||
|
@ -102,24 +102,24 @@ InspectorWidget::InspectorWidget()
|
|||
|
||||
auto& bottom_tab_widget = splitter.add<GUI::TabWidget>();
|
||||
|
||||
auto& computed_style_table_container = bottom_tab_widget.add_tab<GUI::Widget>("Computed"_string.release_value_but_fixme_should_propagate_errors());
|
||||
auto& computed_style_table_container = bottom_tab_widget.add_tab<GUI::Widget>("Computed"_string);
|
||||
computed_style_table_container.set_layout<GUI::VerticalBoxLayout>(4);
|
||||
m_computed_style_table_view = computed_style_table_container.add<GUI::TableView>();
|
||||
|
||||
auto& resolved_style_table_container = bottom_tab_widget.add_tab<GUI::Widget>("Resolved"_string.release_value_but_fixme_should_propagate_errors());
|
||||
auto& resolved_style_table_container = bottom_tab_widget.add_tab<GUI::Widget>("Resolved"_string);
|
||||
resolved_style_table_container.set_layout<GUI::VerticalBoxLayout>(4);
|
||||
m_resolved_style_table_view = resolved_style_table_container.add<GUI::TableView>();
|
||||
|
||||
auto& custom_properties_table_container = bottom_tab_widget.add_tab<GUI::Widget>("Variables"_string.release_value_but_fixme_should_propagate_errors());
|
||||
auto& custom_properties_table_container = bottom_tab_widget.add_tab<GUI::Widget>("Variables"_string);
|
||||
custom_properties_table_container.set_layout<GUI::VerticalBoxLayout>(4);
|
||||
m_custom_properties_table_view = custom_properties_table_container.add<GUI::TableView>();
|
||||
|
||||
auto& box_model_widget = bottom_tab_widget.add_tab<GUI::Widget>("Box Model"_string.release_value_but_fixme_should_propagate_errors());
|
||||
auto& box_model_widget = bottom_tab_widget.add_tab<GUI::Widget>("Box Model"_string);
|
||||
box_model_widget.set_layout<GUI::VerticalBoxLayout>(4);
|
||||
m_element_size_view = box_model_widget.add<ElementSizePreviewWidget>();
|
||||
m_element_size_view->set_should_hide_unnecessary_scrollbars(true);
|
||||
|
||||
auto& aria_properties_state_widget = bottom_tab_widget.add_tab<GUI::Widget>("ARIA"_string.release_value_but_fixme_should_propagate_errors());
|
||||
auto& aria_properties_state_widget = bottom_tab_widget.add_tab<GUI::Widget>("ARIA"_string);
|
||||
aria_properties_state_widget.set_layout<GUI::VerticalBoxLayout>(4);
|
||||
m_aria_properties_state_view = aria_properties_state_widget.add<GUI::TableView>();
|
||||
|
||||
|
|
|
@ -602,7 +602,7 @@ Tab::Tab(BrowserWindow& window, WebView::UseJavaScriptBytecode use_javascript_by
|
|||
}
|
||||
},
|
||||
this);
|
||||
take_visible_screenshot_action->set_status_tip("Save a screenshot of the visible portion of the current tab to the Downloads directory"_string.release_value_but_fixme_should_propagate_errors());
|
||||
take_visible_screenshot_action->set_status_tip("Save a screenshot of the visible portion of the current tab to the Downloads directory"_string);
|
||||
|
||||
auto take_full_screenshot_action = GUI::Action::create(
|
||||
"Take &Full Screenshot"sv, g_icon_bag.filetype_image, [this](auto&) {
|
||||
|
@ -612,7 +612,7 @@ Tab::Tab(BrowserWindow& window, WebView::UseJavaScriptBytecode use_javascript_by
|
|||
}
|
||||
},
|
||||
this);
|
||||
take_full_screenshot_action->set_status_tip("Save a screenshot of the entirety of the current tab to the Downloads directory"_string.release_value_but_fixme_should_propagate_errors());
|
||||
take_full_screenshot_action->set_status_tip("Save a screenshot of the entirety of the current tab to the Downloads directory"_string);
|
||||
|
||||
m_page_context_menu = GUI::Menu::construct();
|
||||
m_page_context_menu->add_action(window.go_back_action());
|
||||
|
|
|
@ -31,7 +31,7 @@ WindowActions::WindowActions(GUI::Window& window)
|
|||
on_create_new_tab();
|
||||
},
|
||||
&window);
|
||||
m_create_new_tab_action->set_status_tip("Open a new tab"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_create_new_tab_action->set_status_tip("Open a new tab"_string);
|
||||
|
||||
m_create_new_window_action = GUI::Action::create(
|
||||
"&New Window", { Mod_Ctrl, Key_N }, g_icon_bag.new_window, [this](auto&) {
|
||||
|
@ -40,7 +40,7 @@ WindowActions::WindowActions(GUI::Window& window)
|
|||
}
|
||||
},
|
||||
&window);
|
||||
m_create_new_window_action->set_status_tip("Open a new browser window"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_create_new_window_action->set_status_tip("Open a new browser window"_string);
|
||||
|
||||
m_next_tab_action = GUI::Action::create(
|
||||
"&Next Tab", { Mod_Ctrl, Key_PageDown }, [this](auto&) {
|
||||
|
@ -48,7 +48,7 @@ WindowActions::WindowActions(GUI::Window& window)
|
|||
on_next_tab();
|
||||
},
|
||||
&window);
|
||||
m_next_tab_action->set_status_tip("Switch to the next tab"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_next_tab_action->set_status_tip("Switch to the next tab"_string);
|
||||
|
||||
m_previous_tab_action = GUI::Action::create(
|
||||
"&Previous Tab", { Mod_Ctrl, Key_PageUp }, [this](auto&) {
|
||||
|
@ -56,7 +56,7 @@ WindowActions::WindowActions(GUI::Window& window)
|
|||
on_previous_tab();
|
||||
},
|
||||
&window);
|
||||
m_previous_tab_action->set_status_tip("Switch to the previous tab"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_previous_tab_action->set_status_tip("Switch to the previous tab"_string);
|
||||
|
||||
for (auto i = 0; i <= 7; ++i) {
|
||||
m_tab_actions.append(GUI::Action::create(
|
||||
|
@ -73,7 +73,7 @@ WindowActions::WindowActions(GUI::Window& window)
|
|||
on_tabs[8]();
|
||||
},
|
||||
&window));
|
||||
m_tab_actions.last()->set_status_tip("Switch to last tab"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_tab_actions.last()->set_status_tip("Switch to last tab"_string);
|
||||
|
||||
m_about_action = GUI::CommonActions::make_about_action("Ladybird", GUI::Icon::default_icon("app-browser"sv), &window);
|
||||
|
||||
|
@ -84,7 +84,7 @@ WindowActions::WindowActions(GUI::Window& window)
|
|||
on_show_bookmarks_bar(action);
|
||||
},
|
||||
&window);
|
||||
m_show_bookmarks_bar_action->set_status_tip("Show/hide the bookmarks bar"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_show_bookmarks_bar_action->set_status_tip("Show/hide the bookmarks bar"_string);
|
||||
|
||||
m_vertical_tabs_action = GUI::Action::create_checkable(
|
||||
"&Vertical Tabs", { Mod_Ctrl, Key_Comma },
|
||||
|
@ -93,7 +93,7 @@ WindowActions::WindowActions(GUI::Window& window)
|
|||
on_vertical_tabs(action);
|
||||
},
|
||||
&window);
|
||||
m_vertical_tabs_action->set_status_tip("Enable/Disable vertical tabs"_string.release_value_but_fixme_should_propagate_errors());
|
||||
m_vertical_tabs_action->set_status_tip("Enable/Disable vertical tabs"_string);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue