mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:17:45 +00:00
LibGUI+Userland: Make GML unregistered_child_handler fallible
This commit is contained in:
parent
2069a5a2a0
commit
fa98034ff7
6 changed files with 16 additions and 16 deletions
|
@ -121,8 +121,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
editor->on_change = [&] {
|
||||
preview->remove_all_children();
|
||||
preview->load_from_gml(editor->text(), [](const DeprecatedString& class_name) -> RefPtr<Core::Object> {
|
||||
return UnregisteredWidget::construct(class_name);
|
||||
preview->load_from_gml(editor->text(), [](DeprecatedString const& class_name) -> ErrorOr<NonnullRefPtr<Core::Object>> {
|
||||
return UnregisteredWidget::try_create(class_name);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -27,8 +27,8 @@ void GMLPreviewWidget::load_gml(DeprecatedString const& gml)
|
|||
return;
|
||||
}
|
||||
|
||||
load_from_gml(gml, [](DeprecatedString const& name) -> RefPtr<Core::Object> {
|
||||
return GUI::Label::construct(DeprecatedString::formatted("{} is not registered as a GML element!", name));
|
||||
load_from_gml(gml, [](DeprecatedString const& name) -> ErrorOr<NonnullRefPtr<Core::Object>> {
|
||||
return GUI::Label::try_create(DeprecatedString::formatted("{} is not registered as a GML element!", name));
|
||||
});
|
||||
|
||||
if (children().is_empty()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue