1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 16:55:08 +00:00

FileManager: Hook up a GSortingProxyTableModel so we get sorted files. :^)

The next step here is coming up with a nice way to always put directories
ahead of files.
This commit is contained in:
Andreas Kling 2019-03-09 14:52:25 +01:00
parent 7d2c962836
commit e14dd06b8c
4 changed files with 25 additions and 10 deletions

View file

@ -1,9 +1,13 @@
#include "DirectoryTableView.h"
#include <LibGUI/GSortingProxyTableModel.h>
DirectoryTableView::DirectoryTableView(GWidget* parent)
: GTableView(parent)
{
set_model(make<DirectoryTableModel>());
auto directory_model = make<DirectoryTableModel>();
m_model = directory_model.ptr();
set_model(make<GSortingProxyTableModel>(move(directory_model)));
GTableView::model()->set_key_column_and_sort_order(DirectoryTableModel::Column::Name, GSortOrder::Ascending);
}
DirectoryTableView::~DirectoryTableView()