This commit is contained in:
parent
db66105128
commit
9dd729e9be
|
@ -95,6 +95,18 @@ ComplianceReportDialog::ComplianceReportDialog(ProjectFile* projectFile, QString
|
||||||
mUI->setupUi(this);
|
mUI->setupUi(this);
|
||||||
mUI->mEditProjectName->setText(projectFile->getProjectName());
|
mUI->mEditProjectName->setText(projectFile->getProjectName());
|
||||||
connect(mUI->buttonBox, &QDialogButtonBox::clicked, this, &ComplianceReportDialog::buttonClicked);
|
connect(mUI->buttonBox, &QDialogButtonBox::clicked, this, &ComplianceReportDialog::buttonClicked);
|
||||||
|
mUI->mCodingStandard->clear();
|
||||||
|
if (projectFile->getCodingStandards().contains("misra-c-2023"))
|
||||||
|
mUI->mCodingStandard->addItem("Misra C 2023");
|
||||||
|
else if (projectFile->getAddons().contains("misra"))
|
||||||
|
mUI->mCodingStandard->addItem("Misra C 2012");
|
||||||
|
if (projectFile->getCodingStandards().contains("misra-c++-2008"))
|
||||||
|
mUI->mCodingStandard->addItem("Misra C++ 2008");
|
||||||
|
if (projectFile->getCodingStandards().contains("cert-c-2016"))
|
||||||
|
mUI->mCodingStandard->addItem("Cert C");
|
||||||
|
if (projectFile->getCodingStandards().contains("cert-c++-2016"))
|
||||||
|
mUI->mCodingStandard->addItem("Cert C++");
|
||||||
|
mUI->mCodingStandard->addItems(projectFile->getCodingStandards());
|
||||||
}
|
}
|
||||||
|
|
||||||
ComplianceReportDialog::~ComplianceReportDialog()
|
ComplianceReportDialog::~ComplianceReportDialog()
|
||||||
|
@ -197,8 +209,9 @@ void ComplianceReportDialog::save()
|
||||||
|
|
||||||
QStringList args{"--project-name=" + projectName,
|
QStringList args{"--project-name=" + projectName,
|
||||||
"--project-version=" + projectVersion,
|
"--project-version=" + projectVersion,
|
||||||
"--output-file=" + outFile,
|
"--output-file=" + outFile};
|
||||||
"--suppressions=" + suppressions.join(",")};
|
if (!suppressions.isEmpty())
|
||||||
|
args << "--suppressions=" + suppressions.join(",");
|
||||||
|
|
||||||
args << ("--" + std);
|
args << ("--" + std);
|
||||||
|
|
||||||
|
@ -215,4 +228,13 @@ void ComplianceReportDialog::save()
|
||||||
process.start(appPath + "/compliance-report", args);
|
process.start(appPath + "/compliance-report", args);
|
||||||
#endif
|
#endif
|
||||||
process.waitForFinished();
|
process.waitForFinished();
|
||||||
|
const QString output = process.readAll();
|
||||||
|
if (!output.isEmpty()) {
|
||||||
|
QMessageBox msg(QMessageBox::Critical,
|
||||||
|
tr("Save compliance report"),
|
||||||
|
output,
|
||||||
|
QMessageBox::Ok,
|
||||||
|
this);
|
||||||
|
msg.exec();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue