LibGUI: Set ProcessChooser key column and sort order after set_model (#3521)

Need to set the sort order after model was set to sort the table.
This commit is contained in:
Uma Sankar 2020-09-17 19:47:14 +05:30 committed by GitHub
parent d7673b41ef
commit 19f2203b53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: sideshowbarker 2024-07-19 02:21:59 +09:00

View file

@ -58,8 +58,8 @@ ProcessChooser::ProcessChooser(const StringView& window_title, const StringView&
m_table_view = widget.add<GUI::TableView>();
auto sorting_model = GUI::SortingProxyModel::create(RunningProcessesModel::create());
sorting_model->set_sort_role(GUI::ModelRole::Display);
m_table_view->set_key_column_and_sort_order(RunningProcessesModel::Column::PID, GUI::SortOrder::Descending);
m_table_view->set_model(sorting_model);
m_table_view->set_key_column_and_sort_order(RunningProcessesModel::Column::PID, GUI::SortOrder::Descending);
m_table_view->on_activation = [this](const ModelIndex& index) { set_pid_from_index_and_close(index); };