Fix #11911 (GUI: provide suppressions when creating the compliance report) (#5401)

This commit is contained in:
Daniel Marjamäki 2023-09-04 10:58:48 +02:00 committed by GitHub
parent 6817113665
commit 3ac89468ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -187,9 +187,16 @@ void ComplianceReportDialog::save()
tempFiles.close();
}
QStringList suppressions;
for (const auto& suppression: mProjectFile->getSuppressions()) {
if (!suppression.errorId.empty())
suppressions.append(QString::fromStdString(suppression.errorId));
}
QStringList args{"--project-name=" + projectName,
"--project-version=" + projectVersion,
"--output-file=" + outFile};
"--output-file=" + outFile,
"--suppressions=" + suppressions.join(",")};
args << ("--" + std);

View File

@ -1806,6 +1806,7 @@ void MainWindow::newProjectFile()
mProjectFile = new ProjectFile(this);
mProjectFile->setActiveProject();
mProjectFile->setFilename(filepath);
mProjectFile->setProjectName(filename.left(filename.indexOf(".")));
mProjectFile->setBuildDir(filename.left(filename.indexOf(".")) + "-cppcheck-build-dir");
ProjectFileDialog dlg(mProjectFile, isCppcheckPremium(), this);