mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:48:11 +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
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