コード例 #1
0
ファイル: threadhandler.cpp プロジェクト: Mathiasdm/cppcheck
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();
}
コード例 #2
0
ファイル: threadhandler.cpp プロジェクト: JIghtuse/cppcheck
void ThreadHandler::SetCheckFiles(bool all)
{
    if (mRunningThreadCount == 0) {
        mResults.SetFiles(GetReCheckFiles(all));
    }
}