1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 10:18:15 +09:00

LibGUI: Move GUI::Model::Role to GUI::ModelRole

This is preparation for using ModelRole in the ModelIndex API.
This commit is contained in:
Andreas Kling 2020-08-16 16:00:07 +02:00
parent f6d7204689
commit a1e381a0f8
Notes: sideshowbarker 2024-07-19 03:33:11 +09:00
66 changed files with 201 additions and 167 deletions

View file

@ -159,15 +159,15 @@ void VariablesModel::set_variable_value(const GUI::ModelIndex& index, const Stri
GUI::MessageBox::Type::Error);
}
GUI::Variant VariablesModel::data(const GUI::ModelIndex& index, Role role) const
GUI::Variant VariablesModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const
{
auto* variable = static_cast<const DebugInfo::VariableInfo*>(index.internal_data());
switch (role) {
case Role::Display: {
case GUI::ModelRole::Display: {
auto value_as_string = variable_value_as_string(*variable);
return String::format("%s: %s", variable->name.characters(), value_as_string.characters());
}
case Role::Icon:
case GUI::ModelRole::Icon:
return m_variable_icon;
default:
return {};