mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:38:11 +00:00
LibCore+LibGUI: Add fallible versions of Widget::load_from_gml()
The existing `load_from_gml()` methods look the same as before from the outside. Inside though, they now forward to `try_load_from_gml()` which returns Error when things go wrong. It also now calls the `try_create()` factory method for Objects instead of the `construct()` one.
This commit is contained in:
parent
e58fe1cdd7
commit
b32f5dbcff
8 changed files with 73 additions and 69 deletions
|
@ -263,7 +263,7 @@ static HashMap<StringView, ObjectClassRegistration*>& object_classes()
|
|||
return s_map;
|
||||
}
|
||||
|
||||
ObjectClassRegistration::ObjectClassRegistration(StringView class_name, Function<RefPtr<Object>()> factory, ObjectClassRegistration* parent_class)
|
||||
ObjectClassRegistration::ObjectClassRegistration(StringView class_name, Function<ErrorOr<NonnullRefPtr<Object>>()> factory, ObjectClassRegistration* parent_class)
|
||||
: m_class_name(class_name)
|
||||
, m_factory(move(factory))
|
||||
, m_parent_class(parent_class)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue