| 325 | } |
| 326 | |
| 327 | void ResultsView::checkingFinished() |
| 328 | { |
| 329 | mUI->mProgress->setVisible(false); |
| 330 | mUI->mProgress->setFormat("%p%"); |
| 331 | |
| 332 | { |
| 333 | Settings checkSettings; |
| 334 | const std::set<std::string> activeCheckers = mStatistics->getActiveCheckers(); |
| 335 | CheckersReport checkersReport(mCheckSettings ? *mCheckSettings : checkSettings, activeCheckers); |
| 336 | mStatistics->setCheckersReport(QString::fromStdString(checkersReport.getReport(mCriticalErrors.toStdString()))); |
| 337 | } |
| 338 | |
| 339 | // TODO: Items can be mysteriously hidden when checking is finished, this function |
| 340 | // call should be redundant but it "unhides" the wrongly hidden items. |
| 341 | mUI->mTree->refreshTree(); |
| 342 | |
| 343 | //Should we inform user of non visible/not found errors? |
| 344 | if (mShowNoErrorsMessage) { |
| 345 | //Tell user that we found no errors |
| 346 | if (!hasResults()) { |
| 347 | QMessageBox msg(QMessageBox::Information, |
| 348 | tr("Cppcheck"), |
| 349 | tr("No errors found."), |
| 350 | QMessageBox::Ok, |
| 351 | this); |
| 352 | |
| 353 | msg.exec(); |
| 354 | } //If we have errors but they aren't visible, tell user about it |
| 355 | else if (!mUI->mTree->hasVisibleResults()) { |
| 356 | QString text = tr("Errors were found, but they are configured to be hidden.\n" \ |
| 357 | "To toggle what kind of errors are shown, open view menu."); |
| 358 | QMessageBox msg(QMessageBox::Information, |
| 359 | tr("Cppcheck"), |
| 360 | text, |
| 361 | QMessageBox::Ok, |
| 362 | this); |
| 363 | |
| 364 | msg.exec(); |
| 365 | } |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | bool ResultsView::hasVisibleResults() const |
| 370 | { |
no test coverage detected