diff --git a/shared/indexer.cpp b/shared/indexer.cpp index 3b5a0c0..b1f9b0a 100644 --- a/shared/indexer.cpp +++ b/shared/indexer.cpp @@ -152,12 +152,14 @@ void Indexer::processFileScanResult(FileScanResult result) ++this->currentIndexResult.erroredPaths; } - if(currentScanProcessedCount++ == progressReportThreshold) + QTime currentTime = QTime::currentTime(); + if(currentScanProcessedCount++ == progressReportThreshold || this->lastProgressReportTime.secsTo(currentTime) >= 10) { emit indexProgress(this->currentIndexResult.total(), this->currentIndexResult.addedPaths, this->currentIndexResult.skippedPaths, this->currentIndexResult.erroredPaths, this->dirScanner->pathCount()); currentScanProcessedCount = 0; + this->lastProgressReportTime = currentTime; } } diff --git a/shared/indexer.h b/shared/indexer.h index 3011abe..a14958e 100644 --- a/shared/indexer.h +++ b/shared/indexer.h @@ -72,6 +72,8 @@ class Indexer : public QObject IndexResult currentIndexResult; void launchWorker(ConcurrentQueue &queue, int batchsize); + QTime lastProgressReportTime = QTime::currentTime(); + public: bool isRunning();