1
Fork 0
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:
Andreas Kling 2019-08-14 20:30:18 +02:00
parent 1ac963b5c8
commit f9b8a18fae
2 changed files with 10 additions and 1 deletions

View file

@ -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 {};
}