mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 08:48:49 +00:00
GJsonArrayModel: Support fields that aren't tied to a single JSON value
Change the custom data massaging callback to take a const JsonObject&. This will allow binding together data from multiple fields into one output in the model. :^)
This commit is contained in:
parent
a4548a150f
commit
afd25679bc
Notes:
sideshowbarker
2024-07-19 12:46:16 +09:00
Author: https://github.com/awesomekling
Commit: afd25679bc
3 changed files with 13 additions and 6 deletions
|
@ -33,7 +33,7 @@ GVariant GJsonArrayModel::data(const GModelIndex& index, Role role) const
|
|||
auto& json_field_name = field_spec.json_field_name;
|
||||
auto data = object.get(json_field_name);
|
||||
if (field_spec.massage_for_display)
|
||||
return field_spec.massage_for_display(data);
|
||||
return field_spec.massage_for_display(object);
|
||||
if (data.is_int())
|
||||
return data.as_int();
|
||||
if (data.is_uint())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue