diff --git a/src/qml/experimental/monitor.cpp b/src/qml/experimental/monitor.cpp --- a/src/qml/experimental/monitor.cpp +++ b/src/qml/experimental/monitor.cpp @@ -76,17 +76,22 @@ void Monitor::newFile(const QString& filePath) { + QDBusPendingReply batchSize = m_scheduler->getBatchSize(); + if (m_totalFiles == 0) { fetchTotalFiles(); } m_filePath = filePath; if (++m_filesIndexed == m_totalFiles) { m_filePath = QStringLiteral("Done"); } Q_EMIT newFileIndexed(); + batchSize.waitForFinished(); - if (m_filesIndexed % (m_scheduler->getBatchSize() * 5) == 0) { - updateRemainingTime(); + if (!batchSize.isError()) { + if (m_filesIndexed % (batchSize * 5) == 0) { + updateRemainingTime(); + } } }