mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Only do a fast pre-sorting when "Sort by Name" is used
This is a follow-up to commit 0e9f4a3987
,
which tries to speed up sorting the items naturally by their name using
the idea that a fast non-natural pre-sorting already sorts the items
mostly correctly and thus reduces the number of expensive natural
comparisons.
This change only makes sense if the view is really sorted by "Name". In
other cases, the pre-sorting will most likely not be useful.
Thanks to Christoph Feck for pointing this out!
This commit is contained in:
parent
5c5d87fec4
commit
7128eb58ac
1 changed files with 1 additions and 1 deletions
|
@ -1034,7 +1034,7 @@ void KFileItemModel::insertItems(QList<ItemData*>& newItems)
|
|||
|
||||
m_groups.clear();
|
||||
|
||||
if (m_naturalSorting) {
|
||||
if (m_sortRole == NameRole && m_naturalSorting) {
|
||||
// Natural sorting of items can be very slow. However, it becomes much
|
||||
// faster if the input sequence is already mostly sorted. Therefore, we
|
||||
// first sort 'newItems' according to the QStrings returned by
|
||||
|
|
Loading…
Reference in a new issue