diff options
| author | Peter Penz <[email protected]> | 2012-06-11 15:43:49 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-06-11 15:46:55 +0200 |
| commit | 6c15705528f1a316d7896f7684761b2aae234c1f (patch) | |
| tree | bbba0cb41f0f0160e8c42dc157b331c597de9628 /src/kitemviews/kfileitemmodelrolesupdater.h | |
| parent | dbf233ea28fc895e9e4c235cd95a9adba0c977a8 (diff) | |
Update "isExpandable" and "size"-roles
If the "isExpandable"- or "size"-role is shown for a folder, the
number of sub-items must be watched to be able to update the
state of those 2 roles.
This fixes the issue that e.g. no expanding-toggle is shown
if an sub-directory has been created inside an empty directory.
BUG: 293972
FIXED-IN: 4.9.0
Diffstat (limited to 'src/kitemviews/kfileitemmodelrolesupdater.h')
| -rw-r--r-- | src/kitemviews/kfileitemmodelrolesupdater.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/kitemviews/kfileitemmodelrolesupdater.h b/src/kitemviews/kfileitemmodelrolesupdater.h index c520a23e8..cabb00391 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.h +++ b/src/kitemviews/kfileitemmodelrolesupdater.h @@ -32,6 +32,7 @@ #include <QSize> #include <QStringList> +class KDirWatch; class KFileItemModel; class KJob; class QPixmap; @@ -161,6 +162,13 @@ private slots: void applyChangedNepomukRoles(const Nepomuk::Resource& resource); + /** + * Is invoked if a directory watched by KDirWatch got dirty. Updates + * the "isExpandable"- and "size"-roles of the item that matches to + * the given path. + */ + void slotDirWatchDirty(const QString& path); + private: /** * Updates the roles for the given item ranges. The roles for the currently @@ -262,6 +270,9 @@ private: QTimer* m_changedItemsTimer; QSet<KFileItem> m_changedItems; + KDirWatch* m_dirWatcher; + mutable QSet<QString> m_watchedDirs; // Required as sadly KDirWatch does not offer a getter method + // to get all watched directories. #ifdef HAVE_NEPOMUK Nepomuk::ResourceWatcher* m_nepomukResourceWatcher; mutable QHash<QUrl, KUrl> m_nepomukUriItems; |
