LibGUI: Resort SortingProxyModel when source invalidates if possible

If the source model invalidates with indexes still good, we can simply
resort the proxy's mappings.
This commit is contained in:
Andreas Kling 2020-08-16 11:10:20 +02:00
commit 17992fbab7
Notes: sideshowbarker 2024-07-19 03:33:23 +09:00

View file

@ -44,6 +44,9 @@ SortingProxyModel::~SortingProxyModel()
void SortingProxyModel::invalidate(unsigned int flags)
{
if (flags == UpdateFlag::DontInvalidateIndexes)
sort(m_last_key_column, m_last_sort_order);
else
m_mappings.clear();
did_update(flags);
}