diff options
Diffstat (limited to 'src/kitemviews/private/kdirectorycontentscounter.h')
| -rw-r--r-- | src/kitemviews/private/kdirectorycontentscounter.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/kitemviews/private/kdirectorycontentscounter.h b/src/kitemviews/private/kdirectorycontentscounter.h index f74565b73..9a5e4a86b 100644 --- a/src/kitemviews/private/kdirectorycontentscounter.h +++ b/src/kitemviews/private/kdirectorycontentscounter.h @@ -21,6 +21,8 @@ class KDirectoryContentsCounter : public QObject Q_OBJECT public: + enum PathCountPriority { Normal, High }; + explicit KDirectoryContentsCounter(KFileItemModel *model, QObject *parent = nullptr); ~KDirectoryContentsCounter() override; @@ -35,7 +37,12 @@ public: * Uses a cache internally to speed up first result, * but emit again result when the cache was updated */ - void scanDirectory(const QString &path); + void scanDirectory(const QString &path, PathCountPriority priority); + + /** + * Stops the work until new input is passed + */ + void stopWorker(); Q_SIGNALS: /** @@ -46,15 +53,14 @@ Q_SIGNALS: void requestDirectoryContentsCount(const QString &path, KDirectoryContentsCounterWorker::Options options); + void stop(); + private Q_SLOTS: void slotResult(const QString &path, int count, long size); void slotDirWatchDirty(const QString &path); void slotItemsRemoved(); private: - void startWorker(const QString &path); - -private: KFileItemModel *m_model; // Used as FIFO queues. |
