mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-27 21:42:53 +00:00
SystemMonitor: Convert most widgets to a failable factory
I didn't convert widgets that don't do any failable tasks currently or are lazy-initialized.
This commit is contained in:
parent
a5936864d9
commit
412630637a
Notes:
sideshowbarker
2024-07-17 07:06:47 +09:00
Author: https://github.com/krkk
Commit: 412630637a
Pull-request: https://github.com/SerenityOS/serenity/pull/18969
10 changed files with 96 additions and 71 deletions
|
@ -71,11 +71,13 @@ private:
|
|||
Vector<Symbolication::Symbol> m_symbols;
|
||||
};
|
||||
|
||||
ThreadStackWidget::ThreadStackWidget()
|
||||
ErrorOr<NonnullRefPtr<ThreadStackWidget>> ThreadStackWidget::try_create()
|
||||
{
|
||||
set_layout<GUI::VerticalBoxLayout>(4);
|
||||
m_stack_table = add<GUI::TableView>();
|
||||
m_stack_table->set_model(adopt_ref(*new ThreadStackModel()));
|
||||
auto widget = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) ThreadStackWidget()));
|
||||
TRY(widget->try_set_layout<GUI::VerticalBoxLayout>(4));
|
||||
widget->m_stack_table = TRY(widget->try_add<GUI::TableView>());
|
||||
widget->m_stack_table->set_model(TRY(try_make_ref_counted<ThreadStackModel>()));
|
||||
return widget;
|
||||
}
|
||||
|
||||
void ThreadStackWidget::show_event(GUI::ShowEvent&)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue