| 560 | } |
| 561 | |
| 562 | void MainWindow::doAnalyzeProject(ImportProject p, const bool checkLib, const bool checkConfig, const QStringList& recheckFiles) |
| 563 | { |
| 564 | Settings checkSettings; |
| 565 | auto supprs = std::make_shared<Suppressions>(); |
| 566 | if (!getCppcheckSettings(checkSettings, *supprs)) |
| 567 | return; |
| 568 | |
| 569 | // filter requested files |
| 570 | if (!recheckFiles.isEmpty()) { |
| 571 | p.fileSettings.remove_if([&](const FileSettings& fs) { |
| 572 | return !recheckFiles.contains(QString::fromStdString(fs.filename())); |
| 573 | }); |
| 574 | } |
| 575 | |
| 576 | clearResults(); |
| 577 | |
| 578 | mIsLogfileLoaded = false; |
| 579 | if (mProjectFile) { |
| 580 | std::vector<std::string> v; |
| 581 | const QStringList excluded = mProjectFile->getExcludedPaths(); |
| 582 | std::transform(excluded.cbegin(), excluded.cend(), std::back_inserter(v), [](const QString& e) { |
| 583 | return e.toStdString(); |
| 584 | }); |
| 585 | p.ignorePaths(v); |
| 586 | |
| 587 | if (!mProjectFile->getAnalyzeAllVsConfigs()) { |
| 588 | const Platform::Type platform = static_cast<Platform::Type>(mSettings->value(SETTINGS_CHECKED_PLATFORM, 0).toInt()); |
| 589 | std::vector<std::string> configurations; |
| 590 | const QStringList configs = mProjectFile->getVsConfigurations(); |
| 591 | std::transform(configs.cbegin(), configs.cend(), std::back_inserter(configurations), [](const QString& e) { |
| 592 | return e.toStdString(); |
| 593 | }); |
| 594 | p.selectVsConfigurations(platform, configurations); |
| 595 | } |
| 596 | } else { |
| 597 | enableProjectActions(false); |
| 598 | } |
| 599 | |
| 600 | mUI->mResults->setResultsSource(ResultsTree::ResultsSource::Analysis); |
| 601 | mThread->clearFiles(); |
| 602 | |
| 603 | mUI->mResults->checkingStarted(p.fileSettings.size()); |
| 604 | |
| 605 | QDir inf(mCurrentDirectory); |
| 606 | const QString checkPath = inf.canonicalPath(); |
| 607 | setPath(SETTINGS_LAST_CHECK_PATH, checkPath); |
| 608 | |
| 609 | checkLockDownUI(); // lock UI while checking |
| 610 | |
| 611 | mUI->mResults->setCheckDirectory(checkPath); |
| 612 | checkSettings.force = false; |
| 613 | checkSettings.checkLibrary = checkLib; |
| 614 | checkSettings.checkConfiguration = checkConfig; |
| 615 | |
| 616 | if (mProjectFile) |
| 617 | qDebug() << "Checking project file" << mProjectFile->getFilename(); |
| 618 | |
| 619 | if (!checkSettings.buildDir.empty()) { |
nothing calls this directly
no test coverage detected