LibGUI+Userland: Port Labels to String

This commit is contained in:
thankyouverycool 2023-04-29 10:41:48 -04:00 committed by Andreas Kling
parent 3d53dc8228
commit 91bafc2653
Notes: sideshowbarker 2024-07-17 08:42:05 +09:00
92 changed files with 240 additions and 242 deletions

View file

@ -22,19 +22,19 @@ void GMLPreviewWidget::load_gml(DeprecatedString const& gml)
if (gml.is_empty()) {
auto& label = add<GUI::Label>();
label.set_text("Open a .gml file to show the preview");
label.set_text("Open a .gml file to show the preview"_string.release_value_but_fixme_should_propagate_errors());
return;
}
// FIXME: Parsing errors happen while the user is typing. What should we do about them?
(void)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));
return GUI::Label::try_create(TRY(String::formatted("{} is not registered as a GML element!", name)));
});
if (children().is_empty()) {
auto& label = add<GUI::Label>();
label.set_text("Failed to load GML!");
label.set_text("Failed to load GML!"_string.release_value_but_fixme_should_propagate_errors());
}
}