MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / openResults

Method openResults

gui/mainwindow.cpp:1465–1495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1463}
1464
1465void MainWindow::openResults()
1466{
1467 if (mUI->mResults->hasResults()) {
1468 QMessageBox msgBox(this);
1469 msgBox.setWindowTitle(tr("Cppcheck"));
1470 const QString msg(tr("Current results will be cleared.\n\n"
1471 "Opening a new XML file will clear current results.\n"
1472 "Do you want to proceed?"));
1473 msgBox.setText(msg);
1474 msgBox.setIcon(QMessageBox::Warning);
1475 msgBox.addButton(QMessageBox::Yes);
1476 msgBox.addButton(QMessageBox::No);
1477 msgBox.setDefaultButton(QMessageBox::Yes);
1478 const int dlgResult = msgBox.exec();
1479 if (dlgResult == QMessageBox::No) {
1480 return;
1481 }
1482 }
1483
1484 QString selectedFilter;
1485 const QString filter(tr("XML files (*.xml)"));
1486 QString selectedFile = QFileDialog::getOpenFileName(this,
1487 tr("Open the report file"),
1488 getPath(SETTINGS_LAST_RESULT_PATH),
1489 filter,
1490 &selectedFilter);
1491
1492 if (!selectedFile.isEmpty()) {
1493 loadResults(selectedFile);
1494 }
1495}
1496
1497void MainWindow::loadResults(const QString &selectedFile)
1498{

Callers

nothing calls this directly

Calls 3

getPathFunction · 0.85
isEmptyMethod · 0.80
hasResultsMethod · 0.45

Tested by

no test coverage detected