mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 07:37:44 +00:00
SystemMonitor: Pass the correct parent when checking for selected values
This will cause trouble later when the row is not enough to identify a selection.
This commit is contained in:
parent
9df21a1385
commit
0e71c6a7de
1 changed files with 2 additions and 2 deletions
|
@ -416,14 +416,14 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto selected_id = [&](ProcessModel::Column column) -> pid_t {
|
||||
if (process_table_view.selection().is_empty())
|
||||
return -1;
|
||||
auto pid_index = process_table_view.model()->index(process_table_view.selection().first().row(), column);
|
||||
auto pid_index = process_table_view.model()->index(process_table_view.selection().first().row(), column, process_table_view.selection().first().parent());
|
||||
return pid_index.data().to_i32();
|
||||
};
|
||||
|
||||
auto selected_name = [&](ProcessModel::Column column) -> String {
|
||||
if (process_table_view.selection().is_empty())
|
||||
return {};
|
||||
auto pid_index = process_table_view.model()->index(process_table_view.selection().first().row(), column);
|
||||
auto pid_index = process_table_view.model()->index(process_table_view.selection().first().row(), column, process_table_view.selection().first().parent());
|
||||
return pid_index.data().to_string();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue