LibGUI: FilePicker: Set initial sort to name instead of undefined

Well, technically the initial sort order is 'ascending inode'.
However, that is unpredictable for the user.
In the rare case it is desired, it can be re-enabled by revealing the
inode column, and then sorting by it, in the TableView.
This commit is contained in:
Ben Wiederhake 2020-05-01 17:53:04 +02:00 committed by Andreas Kling
parent b6bea3d25b
commit cfbc49b5fc
Notes: sideshowbarker 2024-07-19 07:02:57 +09:00

View file

@ -114,6 +114,7 @@ FilePicker::FilePicker(Mode mode, const StringView& file_name, const StringView&
m_view = vertical_container.add<MultiView>();
m_view->set_model(SortingProxyModel::create(*m_model));
m_view->set_model_column(FileSystemModel::Column::Name);
m_view->model()->set_key_column_and_sort_order(GUI::FileSystemModel::Column::Name, GUI::SortOrder::Ascending);
m_view->set_column_hidden(FileSystemModel::Column::Owner, true);
m_view->set_column_hidden(FileSystemModel::Column::Group, true);
m_view->set_column_hidden(FileSystemModel::Column::Permissions, true);