mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +00:00
Userland: Use non-fallible EventReceiver::add()
where possible
This commit is contained in:
parent
707ca984bd
commit
b4e134cb52
54 changed files with 934 additions and 934 deletions
|
@ -89,12 +89,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
main_widget->set_fill_with_background_color(true);
|
||||
main_widget->set_layout<GUI::VerticalBoxLayout>();
|
||||
|
||||
auto icon_view = TRY(main_widget->try_add<GUI::IconView>());
|
||||
icon_view->set_should_hide_unnecessary_scrollbars(true);
|
||||
auto& icon_view = main_widget->add<GUI::IconView>();
|
||||
icon_view.set_should_hide_unnecessary_scrollbars(true);
|
||||
auto model = adopt_ref(*new ScreensaverAppsModel);
|
||||
icon_view->set_model(*model);
|
||||
icon_view.set_model(*model);
|
||||
|
||||
icon_view->on_activation = [&](GUI::ModelIndex const& index) {
|
||||
icon_view.on_activation = [&](GUI::ModelIndex const& index) {
|
||||
auto executable = model->data(index, GUI::ModelRole::Custom).as_string();
|
||||
GUI::Process::spawn_or_show_error(window, executable);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue