From: Vishesh Handa Date: Tue, 22 Jan 2013 11:48:48 +0000 (+0530) Subject: KFileItemModelRolesUpdater: Avoid multiple updates for Nepomuk data X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/d27c16d7516911c892bebbc517f42f457719cb44 KFileItemModelRolesUpdater: Avoid multiple updates for Nepomuk data The Nepomuk ResourceWatcher emits 3 signals - propertyChanged, propertyAdded and propertyRemoved. We should only listen to either the propertyChanged signal or the propertyAdded + Removed signals. There is no point in listening to all 3 signals. That will just result in unnecessary updates. Additionally, we do not need to listen to the resourceCreated signal. That is only emitted when we are watching for a specific types, which we are not. REVIEW: 108543 --- diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index ae9358192..a6d2e9a7f 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -279,12 +279,6 @@ void KFileItemModelRolesUpdater::setRoles(const QSet& roles) m_nepomukResourceWatcher = new Nepomuk2::ResourceWatcher(this); connect(m_nepomukResourceWatcher, SIGNAL(propertyChanged(Nepomuk2::Resource,Nepomuk2::Types::Property,QVariantList,QVariantList)), this, SLOT(applyChangedNepomukRoles(Nepomuk2::Resource))); - connect(m_nepomukResourceWatcher, SIGNAL(propertyRemoved(Nepomuk2::Resource,Nepomuk2::Types::Property,QVariant)), - this, SLOT(applyChangedNepomukRoles(Nepomuk2::Resource))); - connect(m_nepomukResourceWatcher, SIGNAL(propertyAdded(Nepomuk2::Resource,Nepomuk2::Types::Property,QVariant)), - this, SLOT(applyChangedNepomukRoles(Nepomuk2::Resource))); - connect(m_nepomukResourceWatcher, SIGNAL(resourceCreated(Nepomuk2::Resource,QList)), - this, SLOT(applyChangedNepomukRoles(Nepomuk2::Resource))); } else if (!hasNepomukRole && m_nepomukResourceWatcher) { delete m_nepomukResourceWatcher; m_nepomukResourceWatcher = 0;