diff options
| author | Méven Car <[email protected]> | 2023-05-26 15:10:09 +0000 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2023-05-26 15:10:09 +0000 |
| commit | a1c5c5cf81b5d1f6b7a0aa10b8a981cb70c5b26c (patch) | |
| tree | 0fcfce01dcef32b1b70b084e9719cf7d9c26418d /src/kitemviews/private/kdirectorycontentscounter.h | |
| parent | ab13c8881dafbe5beefef0db5891ce9f731ef489 (diff) | |
KDirectoryContentsCounter: show intermediate dir size counting results, improve stopping, improve data caching
Two user visible changes:
* we can see the dir size changing as it is updated.
* This makes the file counting a lot more reactive, when changing directories for instance.
`KDirectoryContentsCounterWorker::walkDir` is not recursive anymore.
The cache is now shared and only a single thread is used to count size recursively.
Diffstat (limited to 'src/kitemviews/private/kdirectorycontentscounter.h')
| -rw-r--r-- | src/kitemviews/private/kdirectorycontentscounter.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/kitemviews/private/kdirectorycontentscounter.h b/src/kitemviews/private/kdirectorycontentscounter.h index 9a5e4a86b..552b5560e 100644 --- a/src/kitemviews/private/kdirectorycontentscounter.h +++ b/src/kitemviews/private/kdirectorycontentscounter.h @@ -49,32 +49,32 @@ Q_SIGNALS: * Signals that the directory \a path contains \a count items of size \a * Size calculation depends on parameter DetailsModeSettings::recursiveDirectorySizeLimit */ - void result(const QString &path, int count, long size); + void result(const QString &path, int count, long long size); - void requestDirectoryContentsCount(const QString &path, KDirectoryContentsCounterWorker::Options options); - - void stop(); + void requestDirectoryContentsCount(const QString &path, KDirectoryContentsCounterWorker::Options options, int maxRecursiveLevel); private Q_SLOTS: - void slotResult(const QString &path, int count, long size); + void slotResult(const QString &path, int count, long long size); void slotDirWatchDirty(const QString &path); void slotItemsRemoved(); + void slotDirectoryRefreshing(); + void scheduleNext(); private: + void enqueuePathScanning(const QString &path, bool alreadyInCache, PathCountPriority priority); + KFileItemModel *m_model; // Used as FIFO queues. std::list<QString> m_priorityQueue; std::list<QString> m_queue; - static QThread *m_workerThread; - - KDirectoryContentsCounterWorker *m_worker; bool m_workerIsBusy; KDirWatch *m_dirWatcher; QSet<QString> m_watchedDirs; // Required as sadly KDirWatch does not offer a getter method // to get all watched directories. + QString m_currentPath; }; #endif |
