diff options
| author | Peter Penz <[email protected]> | 2012-04-06 18:03:24 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-04-06 18:04:56 +0200 |
| commit | 5d27eb81cd038d1cf66f21efa24cb8c2ebd52557 (patch) | |
| tree | eb226d0f10c06248a722e550b6671cb3ae7b9c4b /src/kitemviews/kfileitemmodelrolesupdater.h | |
| parent | c9a6760f9fe29cd74eba085fea2110d4ed5ebeda (diff) | |
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.
Diffstat (limited to 'src/kitemviews/kfileitemmodelrolesupdater.h')
| -rw-r--r-- | src/kitemviews/kfileitemmodelrolesupdater.h | 26 |
1 files changed, 21 insertions, 5 deletions
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 <config-nepomuk.h> -#include <libdolphin_export.h> #include <KFileItem> #include <kitemviews/kitemmodelbase.h> +#include <libdolphin_export.h> + #include <QObject> #include <QSet> #include <QSize> @@ -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<KFileItem> 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<QUrl, KUrl> m_nepomukUriItems; #endif - }; #endif |
