From 75ed1946f8743bc924d28a49ca87df1392f1d408 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Tue, 18 Jun 2013 17:39:56 +0200 Subject: Ensure that the "Sort by Type" setting is respected Before this commit, switching from, e.g., "Sort by Name" to "Sort by Type" sometimes had no effect until the view was refreshed. The problem was that the re-sorting was triggered before the type information was actually added to the model. BUG: 310705 BUG: 312014 FIXED-IN: 4.10.5 REVIEW: 111004 --- src/kitemviews/kfileitemmodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/kitemviews/kfileitemmodel.cpp') diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index c78fdc358..400d29849 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -644,11 +644,11 @@ void KFileItemModel::onSortRoleChanged(const QByteArray& current, const QByteArr Q_UNUSED(previous); m_sortRole = typeForRole(current); -#ifdef KFILEITEMMODEL_DEBUG if (!m_requestRole[m_sortRole]) { - kWarning() << "The sort-role has been changed to a role that has not been received yet"; + QSet newRoles = m_roles; + newRoles << current; + setRoles(newRoles); } -#endif resortAllItems(); } -- cgit v1.3