shared: indexer: Report progress more often
Processing dirs with large docs takes time and waiting till the threshold is reached can be a bit annoying in those cases, so report if last report was 10+ seconds ago.
This commit is contained in:
父節點
785a517d62
當前提交
b6ac652ade
@ -152,12 +152,14 @@ void Indexer::processFileScanResult(FileScanResult result)
|
|||||||
++this->currentIndexResult.erroredPaths;
|
++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,
|
emit indexProgress(this->currentIndexResult.total(), this->currentIndexResult.addedPaths,
|
||||||
this->currentIndexResult.skippedPaths, this->currentIndexResult.erroredPaths,
|
this->currentIndexResult.skippedPaths, this->currentIndexResult.erroredPaths,
|
||||||
this->dirScanner->pathCount());
|
this->dirScanner->pathCount());
|
||||||
currentScanProcessedCount = 0;
|
currentScanProcessedCount = 0;
|
||||||
|
this->lastProgressReportTime = currentTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,6 +72,8 @@ class Indexer : public QObject
|
|||||||
IndexResult currentIndexResult;
|
IndexResult currentIndexResult;
|
||||||
void launchWorker(ConcurrentQueue<QString> &queue, int batchsize);
|
void launchWorker(ConcurrentQueue<QString> &queue, int batchsize);
|
||||||
|
|
||||||
|
QTime lastProgressReportTime = QTime::currentTime();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool isRunning();
|
bool isRunning();
|
||||||
|
|
||||||
|
載入中…
新增問題並參考
Block a user