]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Implement TODO concerning changed roles
authorFrank Reininghaus <frank78ac@googlemail.com>
Thu, 19 Jun 2014 18:35:22 +0000 (20:35 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Thu, 19 Jun 2014 18:35:22 +0000 (20:35 +0200)
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

index 8290635236794144a8b537e79690a2ffe8723348..72acf776a08ad9ca0ce70c5f5cf2d91f1da2f389 100644 (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