| 151 | } |
| 152 | |
| 153 | void ResultsTree::setReportType(ReportType reportType) { |
| 154 | mReportType = reportType; |
| 155 | |
| 156 | mGuideline = createGuidelineMapping(reportType); |
| 157 | |
| 158 | for (int i = 0; i < mModel->rowCount(); ++i) { |
| 159 | auto *fileItem = dynamic_cast<ResultItem*>(mModel->item(i, COLUMN_FILE)); |
| 160 | if (!fileItem) |
| 161 | continue; |
| 162 | for (int j = 0; j < fileItem->rowCount(); ++j) { |
| 163 | QSharedPointer<ErrorItem>& errorItem = dynamic_cast<ResultItem*>(fileItem->child(j,0))->errorItem; |
| 164 | errorItem->guideline = getGuideline(mReportType, mGuideline, errorItem->errorId, errorItem->severity); |
| 165 | errorItem->classification = getClassification(mReportType, errorItem->guideline); |
| 166 | dynamic_cast<ResultItem*>(fileItem->child(j, COLUMN_FILE))->setIconFileName(severityToIcon(getSeverity(reportType, *errorItem))); |
| 167 | fileItem->child(j, COLUMN_CERT_LEVEL)->setText(errorItem->classification); |
| 168 | fileItem->child(j, COLUMN_CERT_RULE)->setText(errorItem->guideline); |
| 169 | fileItem->child(j, COLUMN_MISRA_CLASSIFICATION)->setText(errorItem->classification); |
| 170 | fileItem->child(j, COLUMN_MISRA_GUIDELINE)->setText(errorItem->guideline); |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | if (isAutosarMisraReport()) { |
| 175 | showColumn(COLUMN_MISRA_CLASSIFICATION); |
| 176 | showColumn(COLUMN_MISRA_GUIDELINE); |
| 177 | } else { |
| 178 | hideColumn(COLUMN_MISRA_CLASSIFICATION); |
| 179 | hideColumn(COLUMN_MISRA_GUIDELINE); |
| 180 | } |
| 181 | |
| 182 | if (isCertReport()) { |
| 183 | showColumn(COLUMN_CERT_LEVEL); |
| 184 | showColumn(COLUMN_CERT_RULE); |
| 185 | } else { |
| 186 | hideColumn(COLUMN_CERT_LEVEL); |
| 187 | hideColumn(COLUMN_CERT_RULE); |
| 188 | } |
| 189 | |
| 190 | if (mReportType == ReportType::normal) { |
| 191 | showColumn(COLUMN_SEVERITY); |
| 192 | } else { |
| 193 | hideColumn(COLUMN_SEVERITY); |
| 194 | } |
| 195 | |
| 196 | refreshTree(); |
| 197 | } |
| 198 | |
| 199 | void ResultsTree::initialize(QSettings *settings, ApplicationList *list, ThreadHandler *checkThreadHandler) |
| 200 | { |