void ThreadHandler::Check(const Settings &settings, bool recheck) { if (recheck && mRunningThreadCount == 0) { // only recheck changed files mResults.SetFiles(GetReCheckFiles()); } if (mResults.GetFileCount() == 0 || mRunningThreadCount > 0 || settings._jobs <= 0) { qDebug() << "Can't start checking if there's no files to check or if check is in progress."; emit Done(); return; } SetThreadCount(settings._jobs); mRunningThreadCount = mThreads.size(); if (mResults.GetFileCount() < mRunningThreadCount) { mRunningThreadCount = mResults.GetFileCount(); } for (int i = 0; i < mRunningThreadCount; i++) { mThreads[i]->Check(settings); } // Date and time when checking starts.. mCheckStartTime = QDateTime::currentDateTime(); mTime.start(); }
void ThreadHandler::SetCheckFiles(bool all) { if (mRunningThreadCount == 0) { mResults.SetFiles(GetReCheckFiles(all)); } }