From efa19caa46f1d56afab9cc33c456bc84c47d95e1 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Thu, 19 Jun 2014 20:35:22 +0200 Subject: [PATCH] Implement TODO concerning changed roles When emitting the itemsChanged signal in KFileItemModel::setRoles, use the changed roles in the argument of the signal. A warning message which was related to this issue was removed in 7a83252e0d919d8408e0808ccbd7b401d57444d3 REVIEW: 118815 --- src/kitemviews/kfileitemmodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index 8290635236..72acf776a0 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -449,6 +449,8 @@ void KFileItemModel::setRoles(const QSet& roles) if (m_roles == roles) { return; } + + const QSet changedRoles = (roles - m_roles) + (m_roles - roles); m_roles = roles; if (count() > 0) { @@ -477,7 +479,7 @@ void KFileItemModel::setRoles(const QSet& roles) m_itemData[i]->values = retrieveData(m_itemData.at(i)->item, m_itemData.at(i)->parent); } - emit itemsChanged(KItemRangeList() << KItemRange(0, count()), QSet()); + emit itemsChanged(KItemRangeList() << KItemRange(0, count()), changedRoles); } // Clear the 'values' of all filtered items. They will be re-populated with the