| 95 | } |
| 96 | |
| 97 | void ThreadHandler::check(const Settings &settings, const std::shared_ptr<Suppressions>& supprs) |
| 98 | { |
| 99 | if (mResults.getFileCount() == 0 || mRunningThreadCount > 0 || settings.jobs == 0) { |
| 100 | qDebug() << "Can't start checking if there's no files to check or if check is in progress."; |
| 101 | emit done(); |
| 102 | return; |
| 103 | } |
| 104 | |
| 105 | mCheckSettings = settings; |
| 106 | mCheckSuppressions = supprs; |
| 107 | |
| 108 | createThreads(mCheckSettings.jobs); |
| 109 | |
| 110 | mRunningThreadCount = mThreads.size(); |
| 111 | mRunningThreadCount = std::min(mResults.getFileCount(), mRunningThreadCount); |
| 112 | |
| 113 | mCheckAddonsAndTools = mAddonsAndTools; |
| 114 | for (const std::string& addon: mCheckSettings.addons) { |
| 115 | QString s = QString::fromStdString(addon); |
| 116 | if (!mCheckAddonsAndTools.contains(s)) |
| 117 | mCheckAddonsAndTools << s; |
| 118 | } |
| 119 | |
| 120 | mCtuInfo.clear(); |
| 121 | |
| 122 | for (int i = 0; i < mRunningThreadCount; i++) { |
| 123 | setupCheckThread(*mThreads[i]); |
| 124 | mThreads[i]->start(); |
| 125 | } |
| 126 | |
| 127 | // Date and time when checking starts.. |
| 128 | mCheckStartTime = QDateTime::currentDateTime(); |
| 129 | |
| 130 | mAnalyseWholeProgram = true; |
| 131 | |
| 132 | mTimer.start(); |
| 133 | } |
| 134 | |
| 135 | bool ThreadHandler::isChecking() const |
| 136 | { |
no test coverage detected