mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 04:27:12 +02:00
GJsonArrayModel: Add hook for customizing the GModel::Role::Custom data
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 12:40:58 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f9b8a18fae3
@@ -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 {};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user