mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
SystemMonitor: Add sorting key to the devices model
This commit is contained in:
parent
eaeb793454
commit
2c1b244889
Notes:
sideshowbarker
2024-07-19 02:16:59 +09:00
Author: https://github.com/xTibor Commit: https://github.com/SerenityOS/serenity/commit/2c1b244889f Pull-request: https://github.com/SerenityOS/serenity/pull/3577
1 changed files with 18 additions and 0 deletions
|
@ -93,6 +93,24 @@ GUI::Variant DevicesModel::data(const GUI::ModelIndex& index, GUI::ModelRole rol
|
|||
return {};
|
||||
}
|
||||
|
||||
if (role == GUI::ModelRole::Sort) {
|
||||
const DeviceInfo& device = m_devices[index.row()];
|
||||
switch (index.column()) {
|
||||
case Column::Device:
|
||||
return device.path;
|
||||
case Column::Major:
|
||||
return device.major;
|
||||
case Column::Minor:
|
||||
return device.minor;
|
||||
case Column::ClassName:
|
||||
return device.class_name;
|
||||
case Column::Type:
|
||||
return device.type;
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
if (role == GUI::ModelRole::Display) {
|
||||
const DeviceInfo& device = m_devices[index.row()];
|
||||
switch (index.column()) {
|
||||
|
|
Loading…
Reference in a new issue