summaryrefslogtreecommitdiff
path: root/DevTools
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-07-02 07:35:11 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-02 07:35:11 +0200
commitf5d920eb2e0170b5abf565686cd1284475a77cb1 (patch)
tree48cdf4e269421e949fbef326dd6640271fb54939 /DevTools
parenta44e52cc142500f7401d4db19b5ff5ac1c16730d (diff)
downloadserenity-f5d920eb2e0170b5abf565686cd1284475a77cb1.zip
Profiler: Make the RunningProcessesModel actually sortable
GUI::TableView looks at data(Model::Role::Sort) to know which order things should be in.
Diffstat (limited to 'DevTools')
-rw-r--r--DevTools/Profiler/RunningProcessesModel.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/DevTools/Profiler/RunningProcessesModel.cpp b/DevTools/Profiler/RunningProcessesModel.cpp
index dbea3a26a1..2870c9965d 100644
--- a/DevTools/Profiler/RunningProcessesModel.cpp
+++ b/DevTools/Profiler/RunningProcessesModel.cpp
@@ -116,6 +116,20 @@ GUI::Variant RunningProcessesModel::data(const GUI::ModelIndex& index, Role role
ASSERT_NOT_REACHED();
}
+ if (role == Role::Sort) {
+ switch (index.column()) {
+ case Column::Icon:
+ return {};
+ case Column::PID:
+ return process.pid;
+ case Column::UID:
+ return process.uid;
+ case Column::Name:
+ return process.name;
+ }
+ ASSERT_NOT_REACHED();
+ }
+
return {};
}