diff options
| author | Frank Reininghaus <[email protected]> | 2013-06-18 17:39:56 +0200 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2013-06-18 17:39:56 +0200 |
| commit | 75ed1946f8743bc924d28a49ca87df1392f1d408 (patch) | |
| tree | ad24a167d46f1a88ffaf0a64d61a9c085a1be7f2 /src/kitemviews/kfileitemmodel.cpp | |
| parent | 9cf54dcc025073f29e6a1f55c83c4edcec6a5ea3 (diff) | |
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
Diffstat (limited to 'src/kitemviews/kfileitemmodel.cpp')
| -rw-r--r-- | src/kitemviews/kfileitemmodel.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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<QByteArray> newRoles = m_roles; + newRoles << current; + setRoles(newRoles); } -#endif resortAllItems(); } |
