1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 05:27:35 +00:00

Profiler: Make the RunningProcessesModel actually sortable

GUI::TableView looks at data(Model::Role::Sort) to know which order
things should be in.
This commit is contained in:
Andreas Kling 2020-07-02 07:35:11 +02:00
parent a44e52cc14
commit f5d920eb2e

View file

@ -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 {};
}