mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
LibGUI: Replace uses of JsonObject::get_deprecated()/get_ptr()
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 22:41:14 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/2fce19a451 Pull-request: https://github.com/SerenityOS/serenity/pull/17081 Reviewed-by: https://github.com/trflynn89 ✅
@@ -119,12 +119,14 @@ Variant JsonArrayModel::data(ModelIndex const& index, ModelRole role) const
|
||||
|
||||
if (role == ModelRole::Display) {
|
||||
auto& json_field_name = field_spec.json_field_name;
|
||||
auto data = object.get_deprecated(json_field_name);
|
||||
auto data = object.get(json_field_name);
|
||||
if (field_spec.massage_for_display)
|
||||
return field_spec.massage_for_display(object);
|
||||
if (data.is_number())
|
||||
return data;
|
||||
return object.get_deprecated(json_field_name).to_deprecated_string();
|
||||
if (!data.has_value())
|
||||
return "";
|
||||
if (data->is_number())
|
||||
return data.value();
|
||||
return data->to_deprecated_string();
|
||||
}
|
||||
|
||||
if (role == ModelRole::Sort) {
|
||||
|
||||
Reference in New Issue
Block a user