]> cloud.milkyroute.net Git - dolphin.git/commitdiff
KFileItemModelRolesUpdater: Avoid multiple updates for Nepomuk data
authorVishesh Handa <me@vhanda.in>
Tue, 22 Jan 2013 11:48:48 +0000 (17:18 +0530)
committerVishesh Handa <me@vhanda.in>
Thu, 24 Jan 2013 17:46:27 +0000 (23:16 +0530)
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

src/kitemviews/kfileitemmodelrolesupdater.cpp

index ae935819272a4ea1925bbd40718fd26e2734665a..a6d2e9a7fde1a152539846faf54e4a3b7a269547 100644 (file)
@@ -279,12 +279,6 @@ void KFileItemModelRolesUpdater::setRoles(const QSet<QByteArray>& 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<QUrl>)),
-                    this, SLOT(applyChangedNepomukRoles(Nepomuk2::Resource)));
         } else if (!hasNepomukRole && m_nepomukResourceWatcher) {
             delete m_nepomukResourceWatcher;
             m_nepomukResourceWatcher = 0;