┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemmodel.cpp
diff options
context:
space:
mode:
authorThomas Surrel <[email protected]>2018-11-22 22:24:37 +0100
committerThomas Surrel <[email protected]>2018-12-01 21:07:29 +0100
commitb714604a6795f9ed398a886c23348a2d52fbb7d1 (patch)
tree18f534ab8e1a84a80192c15e3ba794daeb401351 /src/kitemviews/kfileitemmodel.cpp
parentd0cfe1e658efc2de7269ed1568143dc1070fa556 (diff)
Do not sort twice when changing role and order at the same time
Summary: When using the list header to change the role and order, if one changes the order to descending and then changes role, dolphin also changes the order back to ascending. This results in sorting the list of files twice in a row. This patch removes the first (useless) sort. Reviewers: #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: elvisangelaccio, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D17111
Diffstat (limited to 'src/kitemviews/kfileitemmodel.cpp')
-rw-r--r--src/kitemviews/kfileitemmodel.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp
index e67255c0a..7c7abe9a7 100644
--- a/src/kitemviews/kfileitemmodel.cpp
+++ b/src/kitemviews/kfileitemmodel.cpp
@@ -789,7 +789,7 @@ void KFileItemModel::onGroupedSortingChanged(bool current)
m_groups.clear();
}
-void KFileItemModel::onSortRoleChanged(const QByteArray& current, const QByteArray& previous)
+void KFileItemModel::onSortRoleChanged(const QByteArray& current, const QByteArray& previous, bool resortItems)
{
Q_UNUSED(previous);
m_sortRole = typeForRole(current);
@@ -800,7 +800,9 @@ void KFileItemModel::onSortRoleChanged(const QByteArray& current, const QByteArr
setRoles(newRoles);
}
- resortAllItems();
+ if (resortItems) {
+ resortAllItems();
+ }
}
void KFileItemModel::onSortOrderChanged(Qt::SortOrder current, Qt::SortOrder previous)