@@ -262,25 +262,19 @@ void ResultsTree::keyPressEvent(QKeyEvent *event)
262262void ResultsTree::setReportType (ReportType reportType) {
263263 mReportType = reportType;
264264
265- auto readInfo = [this ](const std::vector<checkers::Info>& info) {
266- for (const auto & i: info)
267- for (const QString& cppcheckId: QString (i.cppcheckIds ).split (" ," ))
268- mGuideline [cppcheckId] = QString (i.guideline ).toUpper ();
269- };
270-
271- auto readIdMapping = [this ](const std::vector<checkers::IdMapping>& idMapping) {
265+ auto readIdMapping = [this ](const std::vector<checkers::IdMapping>& idMapping, const char * ext = " " ) {
272266 for (const auto & i: idMapping)
273267 for (const QString& cppcheckId: QString (i.cppcheckId ).split (" ," ))
274- mGuideline [cppcheckId] = i.guideline ;
268+ mGuideline [cppcheckId] = QString ( i.guideline ) + ext ;
275269 };
276270
277271 if (reportType == ReportType::autosar)
278- readInfo (checkers::autosarInfo );
272+ readIdMapping (checkers::idMappingAutosar );
279273 else if (reportType == ReportType::certC)
280- readInfo (checkers::certCInfo );
274+ readIdMapping (checkers::idMappingCertC, " -C " );
281275 else if (reportType == ReportType::certCpp) {
282- readInfo (checkers::certCInfo );
283- readInfo (checkers::certCppInfo );
276+ readIdMapping (checkers::idMappingCertC, " -C " );
277+ readIdMapping (checkers::idMappingCertCpp, " -CPP " );
284278 }
285279 else if (reportType == ReportType::misraC)
286280 readIdMapping (checkers::idMappingMisraC);
0 commit comments