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

Method loadSettings

gui/mainwindow.cpp:383–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

381}
382
383void MainWindow::loadSettings()
384{
385 // Window/dialog sizes
386 if (mSettings->value(SETTINGS_WINDOW_MAXIMIZED, false).toBool()) {
387 showMaximized();
388 } else {
389 resize(mSettings->value(SETTINGS_WINDOW_WIDTH, 800).toInt(),
390 mSettings->value(SETTINGS_WINDOW_HEIGHT, 600).toInt());
391 }
392
393 const ReportType reportType = static_cast<ReportType>(mSettings->value(SETTINGS_REPORT_TYPE, static_cast<int>(ReportType::normal)).toInt());
394 mUI->mActionReportNormal->setChecked(reportType <= ReportType::normal);
395 mUI->mActionReportAutosar->setChecked(reportType == ReportType::autosar);
396 mUI->mActionReportCertC->setChecked(reportType == ReportType::certC);
397 mUI->mActionReportCertCpp->setChecked(reportType == ReportType::certCpp);
398 mUI->mActionReportMisraC->setChecked(reportType == ReportType::misraC2012 ||
399 reportType == ReportType::misraC2023 ||
400 reportType == ReportType::misraC2025);
401 mUI->mActionReportMisraCpp2008->setChecked(reportType == ReportType::misraCpp2008);
402 mUI->mActionReportMisraCpp2023->setChecked(reportType == ReportType::misraCpp2023);
403
404 const ShowTypes &types = mUI->mResults->getShowTypes();
405 mUI->mActionShowStyle->setChecked(types.isShown(ShowTypes::ShowStyle));
406 mUI->mActionShowErrors->setChecked(types.isShown(ShowTypes::ShowErrors));
407 mUI->mActionShowWarnings->setChecked(types.isShown(ShowTypes::ShowWarnings));
408 mUI->mActionShowPortability->setChecked(types.isShown(ShowTypes::ShowPortability));
409 mUI->mActionShowPerformance->setChecked(types.isShown(ShowTypes::ShowPerformance));
410 mUI->mActionShowInformation->setChecked(types.isShown(ShowTypes::ShowInformation));
411 mUI->mActionShowCppcheck->setChecked(true);
412 mUI->mActionShowClang->setChecked(true);
413
414 Standards standards;
415 standards.setC(mSettings->value(SETTINGS_STD_C, QString()).toString().toStdString());
416 mUI->mActionC89->setChecked(standards.c == Standards::C89);
417 mUI->mActionC99->setChecked(standards.c == Standards::C99);
418 mUI->mActionC11->setChecked(standards.c == Standards::C11);
419 //mUI->mActionC17->setChecked(standards.c == Standards::C17);
420 //mUI->mActionC23->setChecked(standards.c == Standards::C23);
421 //mUI->mActionC2Y->setChecked(standards.c == Standards::C2Y);
422 standards.setCPP(mSettings->value(SETTINGS_STD_CPP, QString()).toString().toStdString());
423 mUI->mActionCpp03->setChecked(standards.cpp == Standards::CPP03);
424 mUI->mActionCpp11->setChecked(standards.cpp == Standards::CPP11);
425 mUI->mActionCpp14->setChecked(standards.cpp == Standards::CPP14);
426 mUI->mActionCpp17->setChecked(standards.cpp == Standards::CPP17);
427 mUI->mActionCpp20->setChecked(standards.cpp == Standards::CPP20);
428 //mUI->mActionCpp23->setChecked(standards.cpp == Standards::CPP23);
429 //mUI->mActionCpp26->setChecked(standards.cpp == Standards::CPP26);
430
431 // Main window settings
432 const bool showMainToolbar = mSettings->value(SETTINGS_TOOLBARS_MAIN_SHOW, true).toBool();
433 mUI->mActionToolBarMain->setChecked(showMainToolbar);
434 mUI->mToolBarMain->setVisible(showMainToolbar);
435
436 const bool showViewToolbar = mSettings->value(SETTINGS_TOOLBARS_VIEW_SHOW, true).toBool();
437 mUI->mActionToolBarView->setChecked(showViewToolbar);
438 mUI->mToolBarView->setVisible(showViewToolbar);
439
440 const bool showFilterToolbar = mSettings->value(SETTINGS_TOOLBARS_FILTER_SHOW, true).toBool();

Callers

nothing calls this directly

Calls 12

setPathFunction · 0.85
isShownMethod · 0.80
setCMethod · 0.80
setCPPMethod · 0.80
isEmptyMethod · 0.80
setActiveProjectMethod · 0.80
QStringClass · 0.70
valueMethod · 0.45
toStringMethod · 0.45
sizeMethod · 0.45
existsMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected