┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/private/kdirectorycontentscounterworker.h
diff options
context:
space:
mode:
authorMéven Car <[email protected]>2023-02-12 11:21:53 +0000
committerMéven Car <[email protected]>2023-02-12 11:21:53 +0000
commitba930ddb3635fe2d94d727e72aaf261513b28060 (patch)
tree9199f7944d1b02830eb05f15a58fe1b1be1edbce /src/kitemviews/private/kdirectorycontentscounterworker.h
parenta15def4e64dc08d508e7a511a20ad06e7e8a2e0c (diff)
Optimize Directory size counting
Two changes: * Prioritise size counting for visible path * stop the worker when switching dirs
Diffstat (limited to 'src/kitemviews/private/kdirectorycontentscounterworker.h')
-rw-r--r--src/kitemviews/private/kdirectorycontentscounterworker.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/kitemviews/private/kdirectorycontentscounterworker.h b/src/kitemviews/private/kdirectorycontentscounterworker.h
index 6bbe099a5..5266960cd 100644
--- a/src/kitemviews/private/kdirectorycontentscounterworker.h
+++ b/src/kitemviews/private/kdirectorycontentscounterworker.h
@@ -36,7 +36,7 @@ public:
*
* @return The number of items.
*/
- static CountResult subItemsCount(const QString &path, Options options);
+ CountResult subItemsCount(const QString &path, Options options);
Q_SIGNALS:
/**
@@ -53,6 +53,15 @@ public Q_SLOTS:
// is needed here. Just using 'Options' is OK for the compiler, but
// confuses moc.
void countDirectoryContents(const QString &path, KDirectoryContentsCounterWorker::Options options);
+ void stop();
+
+private:
+#ifndef Q_OS_WIN
+ KDirectoryContentsCounterWorker::CountResult
+ walkDir(const QString &dirPath, const bool countHiddenFiles, const bool countDirectoriesOnly, const uint allowedRecursiveLevel);
+#endif
+
+ bool m_stopping = false;
};
Q_DECLARE_METATYPE(KDirectoryContentsCounterWorker::Options)