mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibGUI: Replace uses of JsonObject::get_deprecated()/get_ptr()
This commit is contained in:
parent
4313c17d95
commit
2fce19a451
Notes:
sideshowbarker
2024-07-17 22:41:14 +09:00
Author: https://github.com/AtkinsSJ
Commit: 2fce19a451
Pull-request: https://github.com/SerenityOS/serenity/pull/17081
Reviewed-by: https://github.com/trflynn89 ✅
3 changed files with 10 additions and 8 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue