From f5d920eb2e0170b5abf565686cd1284475a77cb1 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 2 Jul 2020 07:35:11 +0200 Subject: Profiler: Make the RunningProcessesModel actually sortable GUI::TableView looks at data(Model::Role::Sort) to know which order things should be in. --- DevTools/Profiler/RunningProcessesModel.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'DevTools') 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 {}; } -- cgit v1.2.3