┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemmodelrolesupdater.h
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2013-09-04 21:49:01 +0200
committerFrank Reininghaus <[email protected]>2013-09-04 21:50:16 +0200
commit4bfc28cb4bceb55996eec853da383efb44aaeeba (patch)
tree2ff8dc01d3692db9fe05f238ceae80e0da8307f6 /src/kitemviews/kfileitemmodelrolesupdater.h
parent8f7c3619ec734bbf31ae81315a6548db9cbd19aa (diff)
Count the items inside directories in another thread
This prevents that the GUI freezes if there are many files inside the directory, or if the access to the directory is slow for some other reason. BUG: 318518 REVIEW: 111920 FIXED-IN: 4.12.0
Diffstat (limited to 'src/kitemviews/kfileitemmodelrolesupdater.h')
-rw-r--r--src/kitemviews/kfileitemmodelrolesupdater.h16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/kitemviews/kfileitemmodelrolesupdater.h b/src/kitemviews/kfileitemmodelrolesupdater.h
index 409f098e8..fced44a85 100644
--- a/src/kitemviews/kfileitemmodelrolesupdater.h
+++ b/src/kitemviews/kfileitemmodelrolesupdater.h
@@ -32,7 +32,7 @@
#include <QSize>
#include <QStringList>
-class KDirWatch;
+class KDirectoryContentsCounter;
class KFileItemModel;
class KJob;
class QPixmap;
@@ -218,12 +218,7 @@ private slots:
void applyChangedNepomukRoles(const Nepomuk2::Resource& resource, const Nepomuk2::Types::Property& property);
- /**
- * 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);
+ void slotDirectoryContentsCountReceived(const QString& path, int count);
private:
/**
@@ -267,7 +262,7 @@ private:
ResolveAll
};
bool applyResolvedRoles(const KFileItem& item, ResolveHint hint);
- QHash<QByteArray, QVariant> rolesData(const KFileItem& item) const;
+ QHash<QByteArray, QVariant> rolesData(const KFileItem& item);
/**
* @return The number of items of the path \a path.
@@ -349,9 +344,8 @@ private:
// Items which have not been changed repeatedly recently.
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.
+ KDirectoryContentsCounter* m_directoryContentsCounter;
+
#ifdef HAVE_NEPOMUK
Nepomuk2::ResourceWatcher* m_nepomukResourceWatcher;
mutable QHash<QUrl, KUrl> m_nepomukUriItems;