From 6c15705528f1a316d7896f7684761b2aae234c1f Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Mon, 11 Jun 2012 15:43:49 +0200 Subject: 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 --- src/kitemviews/kfileitemmodelrolesupdater.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/kitemviews/kfileitemmodelrolesupdater.h') 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 #include +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 m_changedItems; + KDirWatch* m_dirWatcher; + mutable QSet 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 m_nepomukUriItems; -- cgit v1.3.1