summaryrefslogtreecommitdiff
path: root/DevTools/Inspector
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-08-16 16:00:07 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-16 16:44:09 +0200
commita1e381a0f87edb396d9c8be90f77fd4bd27024d4 (patch)
tree63c8f74e970cdcb091796fceed8064705c2e0098 /DevTools/Inspector
parentf6d7204689a009ce804b56e9e921985d2e61fc19 (diff)
downloadserenity-a1e381a0f87edb396d9c8be90f77fd4bd27024d4.zip
LibGUI: Move GUI::Model::Role to GUI::ModelRole
This is preparation for using ModelRole in the ModelIndex API.
Diffstat (limited to 'DevTools/Inspector')
-rw-r--r--DevTools/Inspector/RemoteObjectGraphModel.cpp6
-rw-r--r--DevTools/Inspector/RemoteObjectGraphModel.h2
-rw-r--r--DevTools/Inspector/RemoteObjectPropertyModel.cpp4
-rw-r--r--DevTools/Inspector/RemoteObjectPropertyModel.h2
4 files changed, 7 insertions, 7 deletions
diff --git a/DevTools/Inspector/RemoteObjectGraphModel.cpp b/DevTools/Inspector/RemoteObjectGraphModel.cpp
index d6df44161b..8579b622da 100644
--- a/DevTools/Inspector/RemoteObjectGraphModel.cpp
+++ b/DevTools/Inspector/RemoteObjectGraphModel.cpp
@@ -96,10 +96,10 @@ int RemoteObjectGraphModel::column_count(const GUI::ModelIndex&) const
return 1;
}
-GUI::Variant RemoteObjectGraphModel::data(const GUI::ModelIndex& index, Role role) const
+GUI::Variant RemoteObjectGraphModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const
{
auto* remote_object = static_cast<RemoteObject*>(index.internal_data());
- if (role == Role::Icon) {
+ if (role == GUI::ModelRole::Icon) {
if (remote_object->class_name == "Window")
return m_window_icon;
if (remote_object->class_name == "Timer")
@@ -108,7 +108,7 @@ GUI::Variant RemoteObjectGraphModel::data(const GUI::ModelIndex& index, Role rol
return m_layout_icon;
return m_object_icon;
}
- if (role == Role::Display) {
+ if (role == GUI::ModelRole::Display) {
return String::format("%s{%p}", remote_object->class_name.characters(), remote_object->address);
}
return {};
diff --git a/DevTools/Inspector/RemoteObjectGraphModel.h b/DevTools/Inspector/RemoteObjectGraphModel.h
index bd89842924..338c92e4e6 100644
--- a/DevTools/Inspector/RemoteObjectGraphModel.h
+++ b/DevTools/Inspector/RemoteObjectGraphModel.h
@@ -45,7 +45,7 @@ public:
virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
- virtual GUI::Variant data(const GUI::ModelIndex&, Role = Role::Display) const override;
+ virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override;
virtual GUI::ModelIndex index(int row, int column, const GUI::ModelIndex& parent = GUI::ModelIndex()) const override;
virtual GUI::ModelIndex parent_index(const GUI::ModelIndex&) const override;
virtual void update() override;
diff --git a/DevTools/Inspector/RemoteObjectPropertyModel.cpp b/DevTools/Inspector/RemoteObjectPropertyModel.cpp
index 78f39bff05..e0a8d1852f 100644
--- a/DevTools/Inspector/RemoteObjectPropertyModel.cpp
+++ b/DevTools/Inspector/RemoteObjectPropertyModel.cpp
@@ -62,13 +62,13 @@ String RemoteObjectPropertyModel::column_name(int column) const
ASSERT_NOT_REACHED();
}
-GUI::Variant RemoteObjectPropertyModel::data(const GUI::ModelIndex& index, Role role) const
+GUI::Variant RemoteObjectPropertyModel::data(const GUI::ModelIndex& index, GUI::ModelRole role) const
{
auto* path = static_cast<const JsonPath*>(index.internal_data());
if (!path)
return {};
- if (role == Role::Display) {
+ if (role == GUI::ModelRole::Display) {
switch (index.column()) {
case Column::Name:
return path->last().to_string();
diff --git a/DevTools/Inspector/RemoteObjectPropertyModel.h b/DevTools/Inspector/RemoteObjectPropertyModel.h
index 36a01b32e6..a7380eab15 100644
--- a/DevTools/Inspector/RemoteObjectPropertyModel.h
+++ b/DevTools/Inspector/RemoteObjectPropertyModel.h
@@ -50,7 +50,7 @@ public:
virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return Column::__Count; }
virtual String column_name(int) const override;
- virtual GUI::Variant data(const GUI::ModelIndex&, Role = Role::Display) const override;
+ virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override;
virtual void set_data(const GUI::ModelIndex&, const GUI::Variant&) override;
virtual void update() override;
virtual bool is_editable(const GUI::ModelIndex& index) const override { return index.column() == Column::Value; }