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
7a83252e0d

REVIEW: 118815
This commit is contained in:
Frank Reininghaus 2014-06-19 20:35:22 +02:00
parent 7a593fc92b
commit efa19caa46

View file

@ -449,6 +449,8 @@ void KFileItemModel::setRoles(const QSet<QByteArray>& roles)
if (m_roles == roles) {
return;
}
const QSet<QByteArray> changedRoles = (roles - m_roles) + (m_roles - roles);
m_roles = roles;
if (count() > 0) {
@ -477,7 +479,7 @@ void KFileItemModel::setRoles(const QSet<QByteArray>& roles)
m_itemData[i]->values = retrieveData(m_itemData.at(i)->item, m_itemData.at(i)->parent);
}
emit itemsChanged(KItemRangeList() << KItemRange(0, count()), QSet<QByteArray>());
emit itemsChanged(KItemRangeList() << KItemRange(0, count()), changedRoles);
}
// Clear the 'values' of all filtered items. They will be re-populated with the