diff options
author | Andreas Kling <kling@serenityos.org> | 2020-08-16 11:10:20 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-16 16:44:09 +0200 |
commit | 17992fbab738450c892ee283a642b8f4697fafde (patch) | |
tree | 3b50122d9964bd0b8c26a19998b378dbbad056ff /Libraries/LibGUI/SortingProxyModel.cpp | |
parent | 6715b696fa898f03da5ad921e3d65167828eb50e (diff) | |
download | serenity-17992fbab738450c892ee283a642b8f4697fafde.zip |
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.
Diffstat (limited to 'Libraries/LibGUI/SortingProxyModel.cpp')
-rw-r--r-- | Libraries/LibGUI/SortingProxyModel.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Libraries/LibGUI/SortingProxyModel.cpp b/Libraries/LibGUI/SortingProxyModel.cpp index e25f179b8d..0752dc1206 100644 --- a/Libraries/LibGUI/SortingProxyModel.cpp +++ b/Libraries/LibGUI/SortingProxyModel.cpp @@ -44,7 +44,10 @@ SortingProxyModel::~SortingProxyModel() void SortingProxyModel::invalidate(unsigned int flags) { - m_mappings.clear(); + if (flags == UpdateFlag::DontInvalidateIndexes) + sort(m_last_key_column, m_last_sort_order); + else + m_mappings.clear(); did_update(flags); } |