| 487 | } |
| 488 | |
| 489 | void MainWindow::saveSettings() const |
| 490 | { |
| 491 | // Window/dialog sizes |
| 492 | mSettings->setValue(SETTINGS_WINDOW_WIDTH, size().width()); |
| 493 | mSettings->setValue(SETTINGS_WINDOW_HEIGHT, size().height()); |
| 494 | mSettings->setValue(SETTINGS_WINDOW_MAXIMIZED, isMaximized()); |
| 495 | |
| 496 | const ReportType reportType = mUI->mActionReportAutosar->isChecked() ? ReportType::autosar : |
| 497 | mUI->mActionReportCertC->isChecked() ? ReportType::certC : |
| 498 | mUI->mActionReportCertCpp->isChecked() ? ReportType::certCpp : |
| 499 | mUI->mActionReportMisraC->isChecked() ? (mProjectFile ? getMisraCReportType(mProjectFile->getCodingStandards()) : ReportType::misraC2012) : |
| 500 | mUI->mActionReportMisraCpp2008->isChecked() ? ReportType::misraCpp2008 : |
| 501 | mUI->mActionReportMisraCpp2023->isChecked() ? ReportType::misraCpp2023 : |
| 502 | ReportType::normal; |
| 503 | mSettings->setValue(SETTINGS_REPORT_TYPE, static_cast<int>(reportType)); |
| 504 | |
| 505 | // Show * states |
| 506 | mSettings->setValue(SETTINGS_SHOW_STYLE, mUI->mActionShowStyle->isChecked()); |
| 507 | mSettings->setValue(SETTINGS_SHOW_ERRORS, mUI->mActionShowErrors->isChecked()); |
| 508 | mSettings->setValue(SETTINGS_SHOW_WARNINGS, mUI->mActionShowWarnings->isChecked()); |
| 509 | mSettings->setValue(SETTINGS_SHOW_PORTABILITY, mUI->mActionShowPortability->isChecked()); |
| 510 | mSettings->setValue(SETTINGS_SHOW_PERFORMANCE, mUI->mActionShowPerformance->isChecked()); |
| 511 | mSettings->setValue(SETTINGS_SHOW_INFORMATION, mUI->mActionShowInformation->isChecked()); |
| 512 | |
| 513 | if (mUI->mActionC89->isChecked()) |
| 514 | mSettings->setValue(SETTINGS_STD_C, "C89"); |
| 515 | if (mUI->mActionC99->isChecked()) |
| 516 | mSettings->setValue(SETTINGS_STD_C, "C99"); |
| 517 | if (mUI->mActionC11->isChecked()) |
| 518 | mSettings->setValue(SETTINGS_STD_C, "C11"); |
| 519 | //if (mUI->mActionC17->isChecked()) |
| 520 | // mSettings->setValue(SETTINGS_STD_C, "C17"); |
| 521 | //if (mUI->mActionC23->isChecked()) |
| 522 | // mSettings->setValue(SETTINGS_STD_C, "C23"); |
| 523 | //if (mUI->mActionC2Y->isChecked()) |
| 524 | // mSettings->setValue(SETTINGS_STD_C, "C2Y"); |
| 525 | |
| 526 | if (mUI->mActionCpp03->isChecked()) |
| 527 | mSettings->setValue(SETTINGS_STD_CPP, "C++03"); |
| 528 | if (mUI->mActionCpp11->isChecked()) |
| 529 | mSettings->setValue(SETTINGS_STD_CPP, "C++11"); |
| 530 | if (mUI->mActionCpp14->isChecked()) |
| 531 | mSettings->setValue(SETTINGS_STD_CPP, "C++14"); |
| 532 | if (mUI->mActionCpp17->isChecked()) |
| 533 | mSettings->setValue(SETTINGS_STD_CPP, "C++17"); |
| 534 | if (mUI->mActionCpp20->isChecked()) |
| 535 | mSettings->setValue(SETTINGS_STD_CPP, "C++20"); |
| 536 | //if (mUI.mActionCpp23->isChecked()) |
| 537 | // mSettings->setValue(SETTINGS_STD_CPP, "C++23"); |
| 538 | //if (mUI.mActionCpp26->isChecked()) |
| 539 | // mSettings->setValue(SETTINGS_STD_CPP, "C++26"); |
| 540 | |
| 541 | // Main window settings |
| 542 | mSettings->setValue(SETTINGS_TOOLBARS_MAIN_SHOW, mUI->mToolBarMain->isVisible()); |
| 543 | mSettings->setValue(SETTINGS_TOOLBARS_VIEW_SHOW, mUI->mToolBarView->isVisible()); |
| 544 | mSettings->setValue(SETTINGS_TOOLBARS_FILTER_SHOW, mUI->mToolBarFilter->isVisible()); |
| 545 | |
| 546 | if (mUI->mActionEnforceCpp->isChecked()) |
nothing calls this directly
no test coverage detected