1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:57:44 +00:00

AK+Everywhere: Rename JsonObject::get() to ::get_deprecated()

This is a preparatory step to making `get()` return `ErrorOr`.
This commit is contained in:
Sam Atkins 2022-12-21 11:42:06 +00:00 committed by Tim Flynn
parent efe4329f9f
commit 1dd6b7f5b7
76 changed files with 671 additions and 671 deletions

View file

@ -56,8 +56,8 @@ ErrorOr<void> CommonLocationsProvider::load_from_json(StringView json_path)
if (!entry_value.is_object())
continue;
auto entry = entry_value.as_object();
auto name = entry.get("name"sv).to_deprecated_string();
auto path = entry.get("path"sv).to_deprecated_string();
auto name = entry.get_deprecated("name"sv).to_deprecated_string();
auto path = entry.get_deprecated("path"sv).to_deprecated_string();
TRY(s_common_locations.try_append({ name, path }));
}

View file

@ -119,12 +119,12 @@ 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(json_field_name);
auto data = object.get_deprecated(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(json_field_name).to_deprecated_string();
return object.get_deprecated(json_field_name).to_deprecated_string();
}
if (role == ModelRole::Sort) {

View file

@ -306,9 +306,9 @@ inline auto clamp<GUI::UIDimension>(GUI::UIDimension const& input, GUI::UIDimens
if (!value.is_object()) \
return false; \
auto result_width = GUI::UIDimension::construct_from_json_value( \
value.as_object().get("width"sv)); \
value.as_object().get_deprecated("width"sv)); \
auto result_height = GUI::UIDimension::construct_from_json_value( \
value.as_object().get("height"sv)); \
value.as_object().get_deprecated("height"sv)); \
if (result_width.has_value() && result_height.has_value()) { \
GUI::UISize size(result_width.value(), result_height.value()); \
setter(size); \