mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
Userland: Make Window::set_main_widget()
non-fallible
This commit is contained in:
parent
c9297126db
commit
3aa49f268c
Notes:
sideshowbarker
2024-07-16 21:42:29 +09:00
Author: https://github.com/tcl3
Commit: 3aa49f268c
Pull-request: https://github.com/SerenityOS/serenity/pull/21152
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
120 changed files with 144 additions and 133 deletions
|
@ -150,9 +150,9 @@ public:
|
|||
void set_main_widget(Widget*);
|
||||
|
||||
template<class T, class... Args>
|
||||
inline ErrorOr<NonnullRefPtr<T>> set_main_widget(Args&&... args)
|
||||
inline NonnullRefPtr<T> set_main_widget(Args&&... args)
|
||||
{
|
||||
auto widget = TRY(T::try_create(forward<Args>(args)...));
|
||||
auto widget = T::construct(forward<Args>(args)...);
|
||||
set_main_widget(widget.ptr());
|
||||
return widget;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue