LibGUI: Remove TabWidget::try_add_tab()

This commit is contained in:
Tim Ledbetter 2023-09-14 08:02:04 +01:00 committed by Andreas Kling
parent ffda0785c0
commit dc71ac4d2f
Notes: sideshowbarker 2024-07-17 09:39:38 +09:00
2 changed files with 2 additions and 12 deletions

View File

@ -49,9 +49,8 @@ public:
template<class T, class... Args>
ErrorOr<NonnullRefPtr<T>> add_tab(String title, StringView id, Args&&... args)
{
auto tab = TRY(m_tab_widget->try_add_tab<T>(move(title), forward<Args>(args)...));
TRY(m_tabs.try_set(id, tab));
tab->set_settings_window(*this);
auto tab = TRY(T::try_create(forward<Args>(args)...));
TRY(add_tab(tab, title, id));
return tab;
}

View File

@ -55,15 +55,6 @@ public:
void add_widget(Widget&);
void remove_widget(Widget&);
template<class T, class... Args>
ErrorOr<NonnullRefPtr<T>> try_add_tab(String title, Args&&... args)
{
auto t = TRY(T::try_create(forward<Args>(args)...));
t->set_title(move(title));
TRY(try_add_widget(*t));
return *t;
}
template<class T, class... Args>
T& add_tab(String title, Args&&... args)
{