Skip to content

Commit

Permalink
Fix #12984 (GUI: Misra C++ option does not work well in project dialog)
Browse files Browse the repository at this point in the history
  • Loading branch information
danmar committed Aug 4, 2024
1 parent ef487ad commit 23ab9be
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions gui/projectfiledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,23 @@ void ProjectFileDialog::loadFromProjectFile(const ProjectFile *projectFile)
}

mUI->mMisraCpp->setEnabled(mPremium);
mUI->mMisraCppVersion->setVisible(mPremium);
if (projectFile->getCodingStandards().contains(CODING_STANDARD_MISRA_CPP_2008)) {
mUI->mMisraCpp->setChecked(true);
mUI->mMisraCppVersion->setCurrentIndex(0);
}
else if (projectFile->getCodingStandards().contains(CODING_STANDARD_MISRA_CPP_2023)) {
mUI->mMisraCpp->setChecked(true);
mUI->mMisraCppVersion->setCurrentIndex(1);
} else {
mUI->mMisraCpp->setChecked(false);
mUI->mMisraCppVersion->setCurrentIndex(1);
}

mUI->mMisraCppVersion->setEnabled(mUI->mMisraCpp->isChecked());
connect(mUI->mMisraCpp, &QCheckBox::toggled, mUI->mMisraCppVersion, &QComboBox::setEnabled);

mUI->mMisraCppVersion->setVisible(mPremium);
mUI->mMisraCppVersion->setCurrentIndex(projectFile->getCodingStandards().contains(CODING_STANDARD_MISRA_CPP_2023));
QStringList c = projectFile->getCodingStandards();

mUI->mCertC2016->setChecked(mPremium && projectFile->getCodingStandards().contains(CODING_STANDARD_CERT_C));
mUI->mCertCpp2016->setChecked(mPremium && projectFile->getCodingStandards().contains(CODING_STANDARD_CERT_CPP));
Expand Down

0 comments on commit 23ab9be

Please sign in to comment.