mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 18:15:06 +00:00
GJsonArrayModel: Add hook for customizing the GModel::Role::Custom data
This commit is contained in:
parent
1ac963b5c8
commit
f9b8a18fae
2 changed files with 10 additions and 1 deletions
|
@ -46,6 +46,13 @@ GVariant GJsonArrayModel::data(const GModelIndex& index, Role role) const
|
|||
return field_spec.massage_for_sort(object);
|
||||
return data(index, Role::Display);
|
||||
}
|
||||
|
||||
if (role == GModel::Role::Custom) {
|
||||
if (field_spec.massage_for_custom)
|
||||
return field_spec.massage_for_custom(object);
|
||||
return {};
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue