HackStudio+LibGUI: Make fallible TabWidget::add_tab() non-fallible

This commit is contained in:
Tim Ledbetter 2023-09-14 08:29:47 +01:00 committed by Andreas Kling
parent dc71ac4d2f
commit 499f459f0b
2 changed files with 3 additions and 4 deletions

View file

@ -1346,7 +1346,7 @@ ErrorOr<void> HackStudioWidget::create_action_tab(GUI::Widget& parent)
m_todo_entries_widget = m_action_tab_widget->add_tab<ToDoEntriesWidget>("TODO"_string);
m_terminal_wrapper = m_action_tab_widget->add_tab<TerminalWrapper>("Console"_string, false);
auto debug_info_widget = TRY(DebugInfoWidget::create());
TRY(m_action_tab_widget->add_tab(debug_info_widget, "Debug"_string));
m_action_tab_widget->add_tab(debug_info_widget, "Debug"_string);
m_debug_info_widget = debug_info_widget;
m_debug_info_widget->on_backtrace_frame_selection = [this](Debug::DebugInfo::SourcePosition const& source_position) {

View file

@ -64,11 +64,10 @@ public:
return *t;
}
ErrorOr<void> add_tab(NonnullRefPtr<Widget> const& tab, String title)
void add_tab(NonnullRefPtr<Widget> const& tab, String title)
{
tab->set_title(move(title));
TRY(try_add_widget(*tab));
return {};
add_widget(*tab);
}
void remove_tab(Widget& tab) { remove_widget(tab); }