Skip to content

Commit

Permalink
Fix #11911 (GUI: provide suppressions when creating the compliance re…
Browse files Browse the repository at this point in the history
…port) (danmar#5401)
  • Loading branch information
danmar authored Sep 4, 2023
1 parent 6817113 commit 3ac8946
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gui/compliancereportdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3ac8946

Please sign in to comment.