From 5d27eb81cd038d1cf66f21efa24cb8c2ebd52557 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 6 Apr 2012 18:03:24 +0200 Subject: Update items if a Nepomuk property has been changed If a Nepomuk property has been changed (e.g. by changing the rating in the Information Panel) the corresponding item in the view must be updated. --- src/kitemviews/kfileitemmodelrolesupdater.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'src/kitemviews/kfileitemmodelrolesupdater.h') diff --git a/src/kitemviews/kfileitemmodelrolesupdater.h b/src/kitemviews/kfileitemmodelrolesupdater.h index 47255b03f..d22867511 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.h +++ b/src/kitemviews/kfileitemmodelrolesupdater.h @@ -21,11 +21,12 @@ #define KFILEITEMMODELROLESUPDATER_H #include -#include #include #include +#include + #include #include #include @@ -36,6 +37,21 @@ class KJob; class QPixmap; class QTimer; +#ifdef HAVE_NEPOMUK + namespace Nepomuk + { + class ResourceWatcher; + class Resource; + } +#else + // Required for the slot applyChangedNepomukRoles() that + // cannot be ifdefined due to moc. + namespace Nepomuk + { + class Resource; + } +#endif + /** * @brief Resolves expensive roles asynchronously and applies them to the KFileItemModel. * @@ -133,6 +149,8 @@ private slots: */ void resolveChangedItems(); + void applyChangedNepomukRoles(const Nepomuk::Resource& resource); + private: /** * Updates the roles for the given item ranges. The roles for the currently @@ -207,11 +225,9 @@ private: QSet m_changedItems; #ifdef HAVE_NEPOMUK - // True if roles must be resolved with the help of Nepomuk inside - // KFileItemModelRolesUpdater::rolesData(). - bool m_resolveNepomukRoles; + Nepomuk::ResourceWatcher* m_nepomukResourceWatcher; + mutable QHash m_nepomukUriItems; #endif - }; #endif -- cgit v1.3.1