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
Notes: sideshowbarker 2024-07-19 15:06:43 +09:00
4 changed files with 25 additions and 10 deletions

View file

@ -28,14 +28,10 @@ int GSortingProxyTableModel::column_count() const
GModelIndex GSortingProxyTableModel::map_to_target(const GModelIndex& index) const
{
ASSERT(!m_row_mappings.is_empty());
if (!index.is_valid()) {
ASSERT_NOT_REACHED();
if (!index.is_valid())
return { };
}
if (index.row() >= row_count() || index.column() >= column_count()) {
ASSERT_NOT_REACHED();
if (index.row() >= row_count() || index.column() >= column_count())
return { };
}
return { m_row_mappings[index.row()], index.column() };
}