Cppcheck
|
Main window for cppcheck-gui. More...
#include <mainwindow.h>
Public Types | |
enum | { MaxRecentProjects = 5 } |
Maximum number of MRU project items in File-menu. More... | |
Public Slots | |
void | analyzeFiles () |
Slot for analyze files menu item. More... | |
void | reAnalyzeAll () |
Slot to reanalyze all files. More... | |
void | checkLibrary () |
Slot to reanalyze with checking library configuration. More... | |
void | checkConfiguration () |
Slot to check configuration. More... | |
void | performSelectedFilesCheck (const QStringList &selectedFilesList) |
Slot to reanalyze selected files. More... | |
void | reAnalyzeModified () |
Slot to reanalyze modified files. More... | |
void | clearResults () |
Slot to clear all search results. More... | |
void | openResults () |
Slot to open XML report file. More... | |
void | showStyle (bool checked) |
Show errors with type "style". More... | |
void | showErrors (bool checked) |
Show errors with type "error". More... | |
void | showWarnings (bool checked) |
Show errors with type "warning". More... | |
void | showPortability (bool checked) |
Show errors with type "portability". More... | |
void | showPerformance (bool checked) |
Show errors with type "performance". More... | |
void | showInformation (bool checked) |
Show errors with type "information". More... | |
void | checkAll () |
Slot to check all "Show errors" menu items. More... | |
void | uncheckAll () |
Slot to uncheck all "Show errors" menu items. More... | |
void | analyzeDirectory () |
Slot for analyze directory menu item. More... | |
void | programSettings () |
Slot to open program's settings dialog. More... | |
void | about () |
Slot to open program's about dialog. More... | |
void | showLicense () |
Slot to to show license text. More... | |
void | showAuthors () |
Slot to to show authors list. More... | |
void | save () |
Slot to save results. More... | |
void | complianceReport () |
Slot to generate compliance report. More... | |
void | newProjectFile () |
Slot to create new project file. More... | |
void | openProjectFile () |
Slot to open project file and start analyzing contained paths. More... | |
void | showScratchpad () |
Slot to show scratchpad. More... | |
void | closeProjectFile () |
Slot to close open project file. More... | |
void | editProjectFile () |
Slot to edit project file. More... | |
void | showStatistics () |
Slot for showing the scan and project statistics. More... | |
void | showLibraryEditor () |
Slot for showing the library editor. More... | |
Public Member Functions | |
MainWindow (TranslationHandler *th, QSettings *settings) | |
MainWindow (const MainWindow &)=delete | |
~MainWindow () override | |
MainWindow & | operator= (const MainWindow &)=delete |
void | analyzeCode (const QString &code, const QString &filename) |
Analyze given code. More... | |
Public Attributes | |
Platforms | mPlatforms |
List of checked platforms. More... | |
Private Slots | |
void | analysisDone () |
Slot for checkthread's done signal. More... | |
void | checkLockDownUI () |
Lock down UI while analyzing. More... | |
void | resultsAdded () |
Slot for enabling save and clear button. More... | |
void | toggleMainToolBar () |
Slot for showing/hiding standard toolbar. More... | |
void | toggleViewToolBar () |
Slot for showing/hiding Categories toolbar. More... | |
void | toggleFilterToolBar () |
Slot for showing/hiding Filter toolbar. More... | |
void | aboutToShowViewMenu () |
Slot for updating View-menu before it is shown. More... | |
void | stopAnalysis () |
Slot when stop analysis button is pressed. More... | |
void | openHelpContents () |
Open help file contents. More... | |
void | filterResults () |
Filters the results in the result list. More... | |
void | openRecentProject () |
Opens recently opened project file. More... | |
void | selectPlatform () |
Selects the platform as analyzed platform. More... | |
void | suppressIds (QStringList ids) |
Suppress error ids. More... | |
void | replyFinished (QNetworkReply *reply) |
void | hideInformation () |
Private Member Functions | |
bool | isCppcheckPremium () const |
QString | getLastResults () const |
Get filename for last results. More... | |
void | reAnalyze (bool all) |
Reanalyzes files. More... | |
void | reAnalyzeSelected (const QStringList &files) |
Reanalyze selected files. More... | |
void | analyzeProject (const ProjectFile *projectFile, const bool checkLibrary=false, const bool checkConfiguration=false) |
Analyze the project. More... | |
void | setLanguage (const QString &code) |
Set current language. More... | |
void | closeEvent (QCloseEvent *event) override |
Event coming when application is about to close. More... | |
void | toggleAllChecked (bool checked) |
Helper function to toggle all show error menu items. More... | |
void | enableCheckButtons (bool enable) |
Helper function to enable/disable all check,recheck buttons. More... | |
void | enableResultsButtons () |
Helper function to enable/disable results buttons (clear,save,print) More... | |
QStringList | selectFilesToAnalyze (QFileDialog::FileMode mode) |
Select files/or directory to analyze. More... | |
void | doAnalyzeProject (ImportProject p, const bool checkLibrary=false, const bool checkConfiguration=false) |
Analyze project. More... | |
void | doAnalyzeFiles (const QStringList &files, const bool checkLibrary=false, const bool checkConfiguration=false) |
Analyze all files specified in parameter files. More... | |
QPair< bool, Settings > | getCppcheckSettings () |
Get our default cppcheck settings and read project file. More... | |
void | loadSettings () |
Load program settings. More... | |
void | saveSettings () const |
Save program settings. More... | |
void | formatAndSetTitle (const QString &text=QString()) |
Format main window title. More... | |
void | enableProjectActions (bool enable) |
Enable or disable project file actions. More... | |
void | enableProjectOpenActions (bool enable) |
Enable or disable project file actions. More... | |
void | addIncludeDirs (const QStringList &includeDirs, Settings &result) |
Add include directories. More... | |
void | handleCLIParams (const QStringList ¶ms) |
Handle command line parameters given to GUI. More... | |
void | loadResults (const QString &selectedFile) |
Load XML file to the GUI. More... | |
void | loadResults (const QString &selectedFile, const QString &sourceDirectory) |
Load XML file to the GUI. More... | |
bool | loadLastResults () |
Load last project results to the GUI. More... | |
void | loadProjectFile (const QString &filePath) |
Load project file to the GUI. More... | |
Library::Error | loadLibrary (Library &library, const QString &filename) |
Load library file. More... | |
bool | tryLoadLibrary (Library &library, const QString &filename) |
Tries to load library file, prints message on error. More... | |
QString | loadAddon (Settings &settings, const QString &filesDir, const QString &pythonCmd, const QString &addon) |
void | updateMRUMenuItems () |
Update project MRU items in File-menu. More... | |
void | addProjectMRU (const QString &project) |
Add project file (path) to the MRU list. More... | |
void | removeProjectMRU (const QString &project) |
Remove project file (path) from the MRU list. More... | |
Static Private Member Functions | |
static void | openOnlineHelp () |
Show help contents. More... | |
Private Attributes | |
QSettings * | mSettings |
Program settings. More... | |
ThreadHandler * | mThread |
Thread to analyze files. More... | |
ApplicationList * | mApplications |
List of user defined applications to open errors with. More... | |
TranslationHandler * | mTranslation |
Class to handle translation changes. More... | |
Ui::MainWindow * | mUI |
Class holding all UI components. More... | |
QString | mCurrentDirectory |
Current analyzed directory. More... | |
ScratchPad * | mScratchPad {} |
Scratchpad. More... | |
ProjectFile * | mProjectFile {} |
Project (file). More... | |
QLineEdit * | mLineEditFilter |
Filter field in the Filter toolbar. More... | |
QTimer * | mFilterTimer |
Timer to delay filtering while typing. More... | |
QActionGroup * | mPlatformActions |
GUI actions for selecting the analyzed platform. More... | |
QActionGroup * | mCStandardActions |
GUI actions for selecting the coding standard. More... | |
QActionGroup * | mCppStandardActions |
QActionGroup * | mSelectLanguageActions |
GUI actions for selecting language. More... | |
bool | mExiting {} |
Are we exiting the cppcheck? If this is true then the cppcheck is waiting for check threads to exit so that the application can be closed. More... | |
bool | mIsLogfileLoaded {} |
Set to true in case of loading log file. More... | |
QAction * | mRecentProjectActs [MaxRecentProjects+1] |
Project MRU menu actions. More... | |
QString | mCppcheckCfgAbout |
QString | mCppcheckCfgProductName |
QNetworkAccessManager * | mNetworkAccessManager = nullptr |
Main window for cppcheck-gui.
Definition at line 58 of file mainwindow.h.
anonymous enum |
Maximum number of MRU project items in File-menu.
Enumerator | |
---|---|
MaxRecentProjects |
Definition at line 65 of file mainwindow.h.
MainWindow::MainWindow | ( | TranslationHandler * | th, |
QSettings * | settings | ||
) |
Definition at line 113 of file mainwindow.cpp.
References about(), aboutToShowViewMenu(), analysisDone(), analyzeDirectory(), analyzeFiles(), checkAll(), checkConfiguration(), checkLibrary(), ResultsView::checkSelected(), clearResults(), closeProjectFile(), ResultsView::collapseAllResults(), complianceReport(), Settings::cppcheckCfgAbout, Settings::cppcheckCfgProductName, ResultsView::debugError(), ThreadHandler::debugError(), ThreadHandler::done(), editProjectFile(), enableCheckButtons(), enableProjectActions(), enableProjectOpenActions(), enableResultsButtons(), Settings::exename, ResultsView::expandAllResults(), filterResults(), formatAndSetTitle(), Platforms::get(), Platforms::getCount(), ProjectFile::getFilename(), ResultsView::gotResults(), handleCLIParams(), hideInformation(), ThreadHandler::initialize(), isCppcheckPremium(), Settings::loadCppcheckCfg(), loadSettings(), ThreadHandler::log(), ResultsView::log(), PlatformData::mActMainWindow, mApplications, MaxRecentProjects, mCppcheckCfgAbout, mCppcheckCfgProductName, mCppStandardActions, mCStandardActions, mFilterTimer, mLineEditFilter, mNetworkAccessManager, mPlatformActions, mPlatforms, Platforms::mPlatforms, mProjectFile, mRecentProjectActs, mSelectLanguageActions, mSettings, mThread, PlatformData::mTitle, PlatformData::mType, mUI, newProjectFile(), openHelpContents(), openProjectFile(), openRecentProject(), openResults(), performSelectedFilesCheck(), programSettings(), reAnalyzeAll(), reAnalyzeModified(), replyFinished(), resultsAdded(), ResultsView::resultsHidden(), save(), selectPlatform(), SETTINGS_CHECK_FOR_UPDATES, SETTINGS_CHECKED_PLATFORM, showAuthors(), ResultsView::showClangResults(), ResultsView::showCppcheckResults(), showErrors(), ResultsView::showHiddenResults(), showInformation(), showLibraryEditor(), showLicense(), showPerformance(), showPortability(), showScratchpad(), showStatistics(), showStyle(), showWarnings(), stopAnalysis(), suppressIds(), ResultsView::suppressIds(), Settings::supprs, toggleFilterToolBar(), toggleMainToolBar(), toggleViewToolBar(), uncheckAll(), and updateMRUMenuItems().
|
delete |
|
override |
Definition at line 313 of file mainwindow.cpp.
References mProjectFile, mScratchPad, and mUI.
|
slot |
Slot to open program's about dialog.
Definition at line 1505 of file mainwindow.cpp.
References CppCheck::extraVersion(), mCppcheckCfgAbout, and CppCheck::version().
Referenced by MainWindow().
|
privateslot |
Slot for updating View-menu before it is shown.
Definition at line 1657 of file mainwindow.cpp.
References mUI.
Referenced by MainWindow().
|
private |
Add include directories.
includeDirs | List of include directories to add. |
result | Settings class where include directories are added. |
Definition at line 810 of file mainwindow.cpp.
References Settings::includePaths, and mCurrentDirectory.
Referenced by getCppcheckSettings().
|
private |
Add project file (path) to the MRU list.
project | Full path to the project file to add. |
Definition at line 2037 of file mainwindow.cpp.
References MaxRecentProjects, mSettings, SETTINGS_MRU_PROJECTS, and updateMRUMenuItems().
Referenced by loadProjectFile(), and newProjectFile().
|
privateslot |
Slot for checkthread's done signal.
Definition at line 1142 of file mainwindow.cpp.
References enableCheckButtons(), enableProjectActions(), enableProjectOpenActions(), enableResultsButtons(), ProjectFile::getBuildDir(), ProjectFile::getFilename(), mCppcheckCfgProductName, mCppStandardActions, mCStandardActions, mExiting, mIsLogfileLoaded, mPlatformActions, mProjectFile, mRecentProjectActs, mScratchPad, mSelectLanguageActions, mSettings, mUI, SETTINGS_SHOW_STATISTICS, showStatistics(), and Report::XMLV2.
Referenced by analyzeCode(), and MainWindow().
void MainWindow::analyzeCode | ( | const QString & | code, |
const QString & | filename | ||
) |
Analyze given code.
code | Content of the (virtual) file to be analyzed |
filename | Name of the (virtual) file to be analyzed - determines language. |
Definition at line 625 of file mainwindow.cpp.
References analysisDone(), checkLockDownUI(), clearResults(), error, getCppcheckSettings(), mUI, and ThreadResult::setFiles().
Referenced by ScratchPad::checkButtonClicked().
|
slot |
Slot for analyze directory menu item.
Definition at line 753 of file mainwindow.cpp.
References doAnalyzeFiles(), loadProjectFile(), and selectFilesToAnalyze().
Referenced by MainWindow().
|
slot |
Slot for analyze files menu item.
Definition at line 716 of file mainwindow.cpp.
References cfg(), compile_commands_json(), doAnalyzeFiles(), doAnalyzeProject(), ImportProject::fileSettings, ImportProject::ignoreOtherConfigs(), ImportProject::import(), selectFilesToAnalyze(), and Settings::terminate().
Referenced by MainWindow().
|
private |
Analyze the project.
projectFile | Pointer to the project to analyze. |
checkLibrary | Flag to indicate if the library should be checked. |
checkConfiguration | Flag to indicate if the configuration should be checked. |
Definition at line 1752 of file mainwindow.cpp.
References ImportProject::BORLAND, checkConfiguration(), checkLibrary(), ImportProject::COMPILE_DB, ImportProject::CPPCHECK_GUI, doAnalyzeFiles(), doAnalyzeProject(), InternalError::errorMessage, ImportProject::FAILURE, ProjectFile::getAddons(), ProjectFile::getAddonsAndTools(), ProjectFile::getBuildDir(), ProjectFile::getCheckPaths(), ProjectFile::getFilename(), ProjectFile::getImportProject(), ProjectFile::getRootPath(), ImportProject::import(), mCurrentDirectory, ImportProject::MISSING, mThread, ImportProject::NONE, ThreadHandler::setAddonsAndTools(), Settings::terminate(), ImportProject::UNKNOWN, ImportProject::VS_SLN, and ImportProject::VS_VCXPROJ.
Referenced by checkConfiguration(), checkLibrary(), editProjectFile(), loadProjectFile(), newProjectFile(), and reAnalyzeAll().
|
slot |
Slot to check all "Show errors" menu items.
Definition at line 1450 of file mainwindow.cpp.
References toggleAllChecked().
Referenced by MainWindow().
|
slot |
Slot to check configuration.
Definition at line 1250 of file mainwindow.cpp.
References analyzeProject(), and mProjectFile.
Referenced by analyzeProject(), doAnalyzeFiles(), doAnalyzeProject(), and MainWindow().
|
slot |
Slot to reanalyze with checking library configuration.
Definition at line 1244 of file mainwindow.cpp.
References analyzeProject(), and mProjectFile.
Referenced by analyzeProject(), doAnalyzeFiles(), doAnalyzeProject(), and MainWindow().
|
privateslot |
Lock down UI while analyzing.
Definition at line 1192 of file mainwindow.cpp.
References enableCheckButtons(), enableProjectActions(), enableProjectOpenActions(), mCppStandardActions, mCStandardActions, mPlatformActions, mRecentProjectActs, mScratchPad, mSelectLanguageActions, and mUI.
Referenced by analyzeCode(), doAnalyzeFiles(), doAnalyzeProject(), reAnalyze(), and reAnalyzeSelected().
|
slot |
Slot to clear all search results.
Definition at line 1321 of file mainwindow.cpp.
References enableResultsButtons(), ProjectFile::getBuildDir(), ProjectFile::getFilename(), mProjectFile, and mUI.
Referenced by analyzeCode(), doAnalyzeFiles(), doAnalyzeProject(), and MainWindow().
|
overrideprivate |
Event coming when application is about to close.
Definition at line 1460 of file mainwindow.cpp.
References ThreadHandler::isChecking(), mExiting, mThread, saveSettings(), and ThreadHandler::stop().
|
slot |
Slot to close open project file.
Definition at line 1901 of file mainwindow.cpp.
References enableProjectActions(), enableProjectOpenActions(), formatAndSetTitle(), mProjectFile, and mUI.
Referenced by loadResults(), MainWindow(), and newProjectFile().
|
slot |
Slot to generate compliance report.
Definition at line 1578 of file mainwindow.cpp.
References mCppcheckCfgProductName, mProjectFile, mUI, and Report::XMLV2.
Referenced by MainWindow().
|
private |
Analyze all files specified in parameter files.
files | List of files and/or directories to analyze |
checkLibrary | Flag to indicate if library should be checked |
checkConfiguration | Flag to indicate if the configuration should be checked. |
Definition at line 557 of file mainwindow.cpp.
References FileList::addExcludeList(), FileList::addPathList(), Settings::buildDir, ThreadHandler::check(), checkConfiguration(), Settings::checkConfiguration, checkLibrary(), Settings::checkLibrary, checkLockDownUI(), ThreadHandler::clearFiles(), clearResults(), enableProjectActions(), ProjectFile::getAddonsAndTools(), ProjectFile::getCheckingSuppressions(), getCppcheckSettings(), ProjectFile::getExcludedPaths(), FileList::getFileList(), ProjectFile::getFilename(), Settings::loadSummaries(), mCurrentDirectory, mIsLogfileLoaded, mProjectFile, mThread, mUI, ThreadHandler::setAddonsAndTools(), ThreadHandler::setCheckFiles(), ThreadHandler::setFiles(), setPath(), ThreadHandler::setSuppressions(), SETTINGS_LAST_CHECK_PATH, Settings::userDefines, and AnalyzerInformation::writeFilesTxt().
Referenced by analyzeDirectory(), analyzeFiles(), analyzeProject(), and handleCLIParams().
|
private |
Analyze project.
p | imported project |
checkLibrary | Flag to indicate if library should be checked |
checkConfiguration | Flag to indicate if the configuration should be checked. |
Definition at line 489 of file mainwindow.cpp.
References Settings::buildDir, ThreadHandler::check(), checkConfiguration(), Settings::checkConfiguration, checkLibrary(), Settings::checkLibrary, checkLockDownUI(), ThreadHandler::clearFiles(), clearResults(), enableProjectActions(), ImportProject::fileSettings, Settings::force, ProjectFile::getAddonsAndTools(), ProjectFile::getAnalyzeAllVsConfigs(), getCppcheckSettings(), ProjectFile::getExcludedPaths(), ProjectFile::getFilename(), ProjectFile::getSuppressions(), ProjectFile::getVsConfigurations(), ImportProject::ignorePaths(), Settings::loadSummaries(), mCurrentDirectory, mIsLogfileLoaded, mProjectFile, mSettings, mThread, mUI, ImportProject::selectVsConfigurations(), ThreadHandler::setAddonsAndTools(), ThreadHandler::setClangIncludePaths(), setPath(), ThreadHandler::setProject(), ThreadHandler::setSuppressions(), SETTINGS_CHECKED_PLATFORM, SETTINGS_LAST_CHECK_PATH, SETTINGS_VS_INCLUDE_PATHS, Settings::userDefines, and AnalyzerInformation::writeFilesTxt().
Referenced by analyzeFiles(), and analyzeProject().
|
slot |
Slot to edit project file.
Definition at line 1911 of file mainwindow.cpp.
References analyzeProject(), isCppcheckPremium(), mProjectFile, and ProjectFile::write().
Referenced by MainWindow().
|
private |
Helper function to enable/disable all check,recheck buttons.
Definition at line 1391 of file mainwindow.cpp.
References ProjectFile::getAddons(), ProjectFile::getCodingStandards(), ThreadHandler::hasPreviousFiles(), isCppcheckPremium(), mProjectFile, mThread, and mUI.
Referenced by analysisDone(), checkLockDownUI(), and MainWindow().
|
private |
Enable or disable project file actions.
Project editing and closing actions should be only enabled when project is open and we are not analyzing files.
enable | If true then actions are enabled. |
Definition at line 1955 of file mainwindow.cpp.
References mUI.
Referenced by analysisDone(), checkLockDownUI(), closeProjectFile(), doAnalyzeFiles(), doAnalyzeProject(), and MainWindow().
|
private |
Enable or disable project file actions.
Project opening and creating actions should be disabled when analyzing.
enable | If true then actions are enabled. |
Definition at line 1963 of file mainwindow.cpp.
References mUI.
Referenced by analysisDone(), checkLockDownUI(), closeProjectFile(), and MainWindow().
|
private |
Helper function to enable/disable results buttons (clear,save,print)
Definition at line 1411 of file mainwindow.cpp.
References mUI.
Referenced by analysisDone(), clearResults(), loadLastResults(), and MainWindow().
|
privateslot |
Filters the results in the result list.
Definition at line 1950 of file mainwindow.cpp.
References mLineEditFilter, and mUI.
Referenced by MainWindow().
|
private |
Format main window title.
text | Text added to end of the title. |
Definition at line 1619 of file mainwindow.cpp.
References CppCheck::extraVersion(), mCppcheckCfgProductName, and CppCheck::version().
Referenced by closeProjectFile(), loadProjectFile(), loadResults(), MainWindow(), newProjectFile(), selectFilesToAnalyze(), and setLanguage().
|
private |
Get our default cppcheck settings and read project file.
Definition at line 963 of file mainwindow.cpp.
References addIncludeDirs(), Settings::addons, SuppressionList::addSuppression(), Settings::buildDir, Settings::certainty, Settings::checkAllConfigurations, Settings::checkHeaders, Settings::checks, Settings::checkUnknownFunctionReturn, Settings::checkUnusedTemplates, Settings::clang, ProjectFile::clangParser, Settings::SafeChecks::classes, Settings::debugwarnings, SimpleEnableGroup< T >::enable(), Settings::enforcedLang, CheckThread::executeCommand(), Settings::exename, Settings::exhaustive, Settings::SafeChecks::externalFunctions, Settings::SafeChecks::externalVariables, Settings::force, fromNativePath(), ProjectFile::getAddons(), ProjectFile::getBughunting(), ProjectFile::getBuildDir(), ProjectFile::getCertIntPrecision(), ProjectFile::getCheckHeaders(), ProjectFile::getCheckingSuppressions(), ProjectFile::getCheckUnknownFunctionReturn(), ProjectFile::getCheckUnusedTemplates(), ProjectFile::getCodingStandards(), getDataDir(), ProjectFile::getDefines(), ProjectFile::getFilename(), ProjectFile::getImportProject(), ProjectFile::getIncludeDirs(), ProjectFile::getLibraries(), ProjectFile::getMaxCtuDepth(), ProjectFile::getMaxTemplateRecursion(), ProjectFile::getPlatform(), ProjectFile::getUndefines(), inconclusive, information, Settings::inlineSuppressions, Settings::SafeChecks::internalFunctions, ProjectFile::isCheckLevelExhaustive(), isCppcheckPremium(), Settings::jobs, Settings::libraries, Settings::library, loadAddon(), Settings::loadCppcheckCfg(), Platform::loadFromFile(), Settings::maxConfigs, Settings::maxCtuDepth, Settings::maxTemplateRecursion, missingInclude, mProjectFile, mSettings, Suppressions::nomsg, Settings::normal, performance, Settings::platform, portability, Settings::premiumArgs, Settings::quiet, ProjectFile::safeChecks, Settings::safeChecks, saveSettings(), Platform::set(), Standards::setC(), Settings::setCheckLevel(), Standards::setCPP(), SimpleEnableGroup< T >::setEnabled(), Settings::setMisraRuleTexts(), SETTINGS_CHECK_FORCE, SETTINGS_CHECK_THREADS, SETTINGS_CHECKED_PLATFORM, SETTINGS_ENFORCED_LANGUAGE, SETTINGS_GLOBAL_INCLUDE_PATHS, SETTINGS_INCONCLUSIVE_ERRORS, SETTINGS_INLINE_SUPPRESSIONS, SETTINGS_PYTHON_PATH, SETTINGS_SHOW_DEBUG_WARNINGS, SETTINGS_STD_C, SETTINGS_STD_CPP, Settings::severity, Settings::standards, style, Settings::supprs, Settings::terminate(), Platform::toString(), toString(), tryLoadLibrary(), Platform::type, unusedFunction, Settings::userDefines, Settings::userUndefs, Settings::verbose, warning, and Settings::xml.
Referenced by analyzeCode(), doAnalyzeFiles(), doAnalyzeProject(), reAnalyze(), and reAnalyzeSelected().
|
private |
Get filename for last results.
Definition at line 1731 of file mainwindow.cpp.
References ProjectFile::getBuildDir(), ProjectFile::getFilename(), and mProjectFile.
Referenced by loadLastResults(), and stopAnalysis().
|
private |
Handle command line parameters given to GUI.
params | List of string given to command line. |
Definition at line 320 of file mainwindow.cpp.
References doAnalyzeFiles(), loadProjectFile(), and loadResults().
Referenced by MainWindow().
|
privateslot |
Definition at line 2157 of file mainwindow.cpp.
References getVersion(), mSettings, mUI, and SETTINGS_CHECK_VERSION.
Referenced by MainWindow().
|
private |
Definition at line 2165 of file mainwindow.cpp.
References mCppcheckCfgProductName.
Referenced by editProjectFile(), enableCheckButtons(), getCppcheckSettings(), loadAddon(), MainWindow(), newProjectFile(), programSettings(), and replyFinished().
|
private |
Definition at line 926 of file mainwindow.cpp.
References Settings::addonInfos, Settings::addons, Settings::exename, fromNativePath(), ProjectFile::getAddonFilePath(), AddonInfo::getAddonInfo(), isCppcheckPremium(), mSettings, and SETTINGS_MISRA_FILE.
Referenced by getCppcheckSettings().
|
private |
Load last project results to the GUI.
Definition at line 1738 of file mainwindow.cpp.
References enableResultsButtons(), getLastResults(), mSettings, mUI, SETTINGS_LAST_CHECK_PATH, and toString().
Referenced by loadProjectFile(), loadSettings(), and openRecentProject().
|
private |
Load library file.
library | library to use |
filename | filename (no path) |
Definition at line 826 of file mainwindow.cpp.
References Library::Error::errorcode, Library::FILE_NOT_FOUND, getDataDir(), ProjectFile::getFilename(), Library::load(), and mProjectFile.
Referenced by tryLoadLibrary().
|
private |
Load project file to the GUI.
filePath | Filename (inc. path) of project file to load. |
Definition at line 1714 of file mainwindow.cpp.
References addProjectMRU(), analyzeProject(), formatAndSetTitle(), loadLastResults(), mIsLogfileLoaded, mProjectFile, mUI, and ProjectFile::setActiveProject().
Referenced by analyzeDirectory(), handleCLIParams(), openProjectFile(), and openRecentProject().
|
private |
Load XML file to the GUI.
selectedFile | Filename (inc. path) of XML file to load. |
Definition at line 1370 of file mainwindow.cpp.
References closeProjectFile(), formatAndSetTitle(), mIsLogfileLoaded, mProjectFile, mUI, setPath(), and SETTINGS_LAST_RESULT_PATH.
Referenced by handleCLIParams(), loadResults(), openRecentProject(), and openResults().
|
private |
Load XML file to the GUI.
selectedFile | Filename (inc. path) of XML file to load. |
sourceDirectory | Path to the directory that the results were generated for. |
Definition at line 1385 of file mainwindow.cpp.
References loadResults(), and mUI.
|
private |
Load program settings.
Definition at line 351 of file mainwindow.cpp.
References Standards::c, Standards::C11, Standards::C89, Standards::C99, Standards::cpp, Standards::CPP03, Standards::CPP11, Standards::CPP14, Standards::CPP17, Standards::CPP20, ShowTypes::isShown(), loadLastResults(), ApplicationList::loadSettings(), mApplications, mProjectFile, mSettings, mUI, ProjectFile::read(), ProjectFile::setActiveProject(), Standards::setC(), Standards::setCPP(), setPath(), SETTINGS_ENFORCED_LANGUAGE, SETTINGS_LAST_PROJECT_PATH, SETTINGS_OPEN_PROJECT, SETTINGS_STD_C, SETTINGS_STD_CPP, SETTINGS_TOOLBARS_FILTER_SHOW, SETTINGS_TOOLBARS_MAIN_SHOW, SETTINGS_TOOLBARS_VIEW_SHOW, SETTINGS_WINDOW_HEIGHT, SETTINGS_WINDOW_MAXIMIZED, SETTINGS_WINDOW_WIDTH, ShowTypes::ShowErrors, ShowTypes::ShowInformation, ShowTypes::ShowPerformance, ShowTypes::ShowPortability, ShowTypes::ShowStyle, ShowTypes::ShowWarnings, and toString().
Referenced by MainWindow().
|
slot |
Slot to create new project file.
Definition at line 1866 of file mainwindow.cpp.
References addProjectMRU(), analyzeProject(), closeProjectFile(), formatAndSetTitle(), getPath(), isCppcheckPremium(), mProjectFile, ProjectFile::setActiveProject(), ProjectFile::setBuildDir(), ProjectFile::setFilename(), setPath(), ProjectFile::setProjectName(), and SETTINGS_LAST_PROJECT_PATH.
Referenced by MainWindow().
|
privateslot |
Open help file contents.
Definition at line 1675 of file mainwindow.cpp.
References openOnlineHelp().
Referenced by MainWindow().
|
staticprivate |
Show help contents.
Definition at line 1680 of file mainwindow.cpp.
Referenced by openHelpContents().
|
slot |
Slot to open project file and start analyzing contained paths.
Definition at line 1686 of file mainwindow.cpp.
References getPath(), loadProjectFile(), setPath(), and SETTINGS_LAST_PROJECT_PATH.
Referenced by MainWindow().
|
privateslot |
Opens recently opened project file.
Definition at line 1969 of file mainwindow.cpp.
References loadLastResults(), loadProjectFile(), loadResults(), and removeProjectMRU().
Referenced by MainWindow().
|
slot |
Slot to open XML report file.
Definition at line 1338 of file mainwindow.cpp.
References getPath(), loadResults(), mUI, and SETTINGS_LAST_RESULT_PATH.
Referenced by MainWindow().
|
delete |
|
slot |
Slot to reanalyze selected files.
selectedFilesList | list of selected files |
Definition at line 1535 of file mainwindow.cpp.
References reAnalyzeSelected().
Referenced by MainWindow().
|
slot |
Slot to open program's settings dialog.
Definition at line 1213 of file mainwindow.cpp.
References isCppcheckPremium(), mApplications, mSettings, mTranslation, mUI, SettingsDialog::saveAllErrors(), SettingsDialog::saveFullPath(), SettingsDialog::saveSettingValues(), setLanguage(), SETTINGS_LANGUAGE, SettingsDialog::showErrorId(), SettingsDialog::showFullPath(), SettingsDialog::showInconclusive(), and SettingsDialog::showNoErrorsMessage().
Referenced by MainWindow().
|
private |
Reanalyzes files.
Definition at line 1292 of file mainwindow.cpp.
References ThreadHandler::check(), checkLockDownUI(), getCppcheckSettings(), ProjectFile::getFilename(), ThreadHandler::getReCheckFiles(), mProjectFile, mThread, mUI, and ThreadHandler::setCheckFiles().
Referenced by reAnalyzeAll(), and reAnalyzeModified().
|
slot |
Slot to reanalyze all files.
Definition at line 1236 of file mainwindow.cpp.
References analyzeProject(), mProjectFile, and reAnalyze().
Referenced by MainWindow().
|
slot |
Slot to reanalyze modified files.
Definition at line 1231 of file mainwindow.cpp.
References reAnalyze().
Referenced by MainWindow().
|
private |
Reanalyze selected files.
files | list of selected files |
Definition at line 1256 of file mainwindow.cpp.
References FileList::addExcludeList(), FileList::addPathList(), ThreadHandler::check(), checkLockDownUI(), ThreadHandler::getCheckStartTime(), getCppcheckSettings(), ProjectFile::getExcludedPaths(), FileList::getFileList(), ThreadHandler::isChecking(), mCurrentDirectory, mProjectFile, mThread, mUI, ThreadHandler::setCheckFiles(), and ThreadHandler::setCheckStartTime().
Referenced by performSelectedFilesCheck().
|
private |
Remove project file (path) from the MRU list.
project | Full path of the project file to remove. |
Definition at line 2049 of file mainwindow.cpp.
References mSettings, SETTINGS_MRU_PROJECTS, and updateMRUMenuItems().
Referenced by openRecentProject().
|
privateslot |
Definition at line 2120 of file mainwindow.cpp.
References getVersion(), isCppcheckPremium(), mCppcheckCfgProductName, mSettings, mUI, SETTINGS_CHECK_VERSION, and CppCheck::version().
Referenced by MainWindow().
|
privateslot |
Slot for enabling save and clear button.
Definition at line 1600 of file mainwindow.cpp.
Referenced by MainWindow().
|
slot |
Slot to save results.
Definition at line 1540 of file mainwindow.cpp.
References Report::CSV, getPath(), mCppcheckCfgProductName, mUI, setPath(), SETTINGS_LAST_RESULT_PATH, Report::TXT, and Report::XMLV2.
Referenced by MainWindow().
|
private |
Save program settings.
Definition at line 433 of file mainwindow.cpp.
References TranslationHandler::getCurrentLanguage(), ProjectFile::getFilename(), mApplications, mProjectFile, mSettings, mTranslation, mUI, ApplicationList::saveSettings(), SETTINGS_ENFORCED_LANGUAGE, SETTINGS_LANGUAGE, SETTINGS_OPEN_PROJECT, SETTINGS_SHOW_ERRORS, SETTINGS_SHOW_INFORMATION, SETTINGS_SHOW_PERFORMANCE, SETTINGS_SHOW_PORTABILITY, SETTINGS_SHOW_STYLE, SETTINGS_SHOW_WARNINGS, SETTINGS_STD_C, SETTINGS_STD_CPP, SETTINGS_TOOLBARS_FILTER_SHOW, SETTINGS_TOOLBARS_MAIN_SHOW, SETTINGS_TOOLBARS_VIEW_SHOW, SETTINGS_WINDOW_HEIGHT, SETTINGS_WINDOW_MAXIMIZED, and SETTINGS_WINDOW_WIDTH.
Referenced by closeEvent(), and getCppcheckSettings().
|
private |
Select files/or directory to analyze.
Helper function to open a dialog to ask user to select files or directory to analyze. Use native dialogs instead of Qt:s own dialogs.
mode | Dialog open mode (files or directories) |
Definition at line 660 of file mainwindow.cpp.
References compile_commands_json(), formatAndSetTitle(), FileList::getDefaultFilters(), getPath(), mCurrentDirectory, mProjectFile, mSettings, setPath(), SETTINGS_LAST_ANALYZE_FILES_FILTER, SETTINGS_LAST_CHECK_PATH, and toFilterString().
Referenced by analyzeDirectory(), and analyzeFiles().
|
privateslot |
Selects the platform as analyzed platform.
Definition at line 2058 of file mainwindow.cpp.
References mSettings, and SETTINGS_CHECKED_PLATFORM.
Referenced by MainWindow().
|
private |
Set current language.
code | Language code of the language to set (e.g. "en"). |
Definition at line 1639 of file mainwindow.cpp.
References formatAndSetTitle(), TranslationHandler::getCurrentLanguage(), ProjectFile::getFilename(), mLineEditFilter, mProjectFile, mScratchPad, mTranslation, mUI, TranslationHandler::setLanguage(), and ScratchPad::translate().
Referenced by programSettings().
|
slot |
Slot to to show authors list.
Definition at line 1528 of file mainwindow.cpp.
Referenced by MainWindow().
|
slot |
Show errors with type "error".
checked | Should errors be shown (true) or hidden (false) |
Definition at line 1425 of file mainwindow.cpp.
References mUI, and ShowTypes::ShowErrors.
Referenced by MainWindow(), and toggleAllChecked().
|
slot |
Show errors with type "information".
checked | Should errors be shown (true) or hidden (false) |
Definition at line 1445 of file mainwindow.cpp.
References mUI, and ShowTypes::ShowInformation.
Referenced by MainWindow(), and toggleAllChecked().
|
slot |
Slot for showing the library editor.
Definition at line 1944 of file mainwindow.cpp.
Referenced by MainWindow().
|
slot |
Slot to to show license text.
Definition at line 1521 of file mainwindow.cpp.
Referenced by MainWindow().
|
slot |
Show errors with type "performance".
checked | Should errors be shown (true) or hidden (false) |
Definition at line 1440 of file mainwindow.cpp.
References mUI, and ShowTypes::ShowPerformance.
Referenced by MainWindow(), and toggleAllChecked().
|
slot |
Show errors with type "portability".
checked | Should errors be shown (true) or hidden (false) |
Definition at line 1435 of file mainwindow.cpp.
References mUI, and ShowTypes::ShowPortability.
Referenced by MainWindow(), and toggleAllChecked().
|
slot |
Slot to show scratchpad.
Definition at line 1703 of file mainwindow.cpp.
References mScratchPad.
Referenced by MainWindow().
|
slot |
Slot for showing the scan and project statistics.
Definition at line 1930 of file mainwindow.cpp.
References ThreadHandler::getPreviousFilesCount(), ThreadHandler::getPreviousScanDuration(), mCurrentDirectory, mProjectFile, mThread, mUI, StatsDialog::setNumberOfFilesScanned(), StatsDialog::setPathSelected(), StatsDialog::setProject(), StatsDialog::setScanDuration(), and StatsDialog::setStatistics().
Referenced by analysisDone(), and MainWindow().
|
slot |
Show errors with type "style".
checked | Should errors be shown (true) or hidden (false) |
Definition at line 1420 of file mainwindow.cpp.
References mUI, and ShowTypes::ShowStyle.
Referenced by MainWindow(), and toggleAllChecked().
|
slot |
Show errors with type "warning".
checked | Should errors be shown (true) or hidden (false) |
Definition at line 1430 of file mainwindow.cpp.
References mUI, and ShowTypes::ShowWarnings.
Referenced by MainWindow(), and toggleAllChecked().
|
privateslot |
Slot when stop analysis button is pressed.
Definition at line 1664 of file mainwindow.cpp.
References getLastResults(), mThread, mUI, and ThreadHandler::stop().
Referenced by MainWindow().
|
privateslot |
Suppress error ids.
Definition at line 2067 of file mainwindow.cpp.
References SuppressionList::Suppression::errorId, ProjectFile::getSuppressions(), mProjectFile, ProjectFile::setSuppressions(), and ProjectFile::write().
Referenced by MainWindow().
|
private |
Helper function to toggle all show error menu items.
checked | Should all errors be shown (true) or hidden (false) |
Definition at line 1489 of file mainwindow.cpp.
References mUI, showErrors(), showInformation(), showPerformance(), showPortability(), showStyle(), and showWarnings().
Referenced by checkAll(), and uncheckAll().
|
privateslot |
Slot for showing/hiding Filter toolbar.
Definition at line 1613 of file mainwindow.cpp.
References mLineEditFilter, and mUI.
Referenced by MainWindow().
|
privateslot |
Slot for showing/hiding standard toolbar.
Definition at line 1603 of file mainwindow.cpp.
References mUI.
Referenced by MainWindow().
|
privateslot |
Slot for showing/hiding Categories toolbar.
Definition at line 1608 of file mainwindow.cpp.
References mUI.
Referenced by MainWindow().
|
private |
Tries to load library file, prints message on error.
library | library to use |
filename | filename (no path) |
Definition at line 874 of file mainwindow.cpp.
References Library::BAD_ATTRIBUTE_VALUE, Library::BAD_XML, Library::DUPLICATE_DEFINE, Library::DUPLICATE_PLATFORM_TYPE, error, Library::FILE_NOT_FOUND, loadLibrary(), Library::MISSING_ATTRIBUTE, Library::OK, Library::PLATFORM_TYPE_REDEFINED, Library::UNKNOWN_ELEMENT, and Library::UNSUPPORTED_FORMAT.
Referenced by getCppcheckSettings().
|
slot |
Slot to uncheck all "Show errors" menu items.
Definition at line 1455 of file mainwindow.cpp.
References toggleAllChecked().
Referenced by MainWindow().
|
private |
Update project MRU items in File-menu.
Definition at line 2002 of file mainwindow.cpp.
References MaxRecentProjects, mRecentProjectActs, mSettings, mUI, and SETTINGS_MRU_PROJECTS.
Referenced by addProjectMRU(), MainWindow(), and removeProjectMRU().
|
private |
List of user defined applications to open errors with.
Definition at line 431 of file mainwindow.h.
Referenced by loadSettings(), MainWindow(), programSettings(), and saveSettings().
|
private |
Definition at line 479 of file mainwindow.h.
Referenced by about(), and MainWindow().
|
private |
Definition at line 480 of file mainwindow.h.
Referenced by analysisDone(), complianceReport(), formatAndSetTitle(), isCppcheckPremium(), MainWindow(), replyFinished(), and save().
|
private |
Definition at line 458 of file mainwindow.h.
Referenced by analysisDone(), checkLockDownUI(), and MainWindow().
|
private |
GUI actions for selecting the coding standard.
Definition at line 458 of file mainwindow.h.
Referenced by analysisDone(), checkLockDownUI(), and MainWindow().
|
private |
Current analyzed directory.
Definition at line 440 of file mainwindow.h.
Referenced by addIncludeDirs(), analyzeProject(), doAnalyzeFiles(), doAnalyzeProject(), reAnalyzeSelected(), selectFilesToAnalyze(), and showStatistics().
|
private |
Are we exiting the cppcheck? If this is true then the cppcheck is waiting for check threads to exit so that the application can be closed.
Definition at line 468 of file mainwindow.h.
Referenced by analysisDone(), and closeEvent().
|
private |
Timer to delay filtering while typing.
Definition at line 452 of file mainwindow.h.
Referenced by MainWindow().
|
private |
Set to true in case of loading log file.
Definition at line 471 of file mainwindow.h.
Referenced by analysisDone(), doAnalyzeFiles(), doAnalyzeProject(), loadProjectFile(), and loadResults().
|
private |
Filter field in the Filter toolbar.
Definition at line 449 of file mainwindow.h.
Referenced by filterResults(), MainWindow(), setLanguage(), and toggleFilterToolBar().
|
private |
Definition at line 482 of file mainwindow.h.
Referenced by MainWindow().
|
private |
GUI actions for selecting the analyzed platform.
Definition at line 455 of file mainwindow.h.
Referenced by analysisDone(), checkLockDownUI(), and MainWindow().
Platforms MainWindow::mPlatforms |
|
private |
Project (file).
Definition at line 446 of file mainwindow.h.
Referenced by analysisDone(), checkConfiguration(), checkLibrary(), clearResults(), closeProjectFile(), complianceReport(), doAnalyzeFiles(), doAnalyzeProject(), editProjectFile(), enableCheckButtons(), getCppcheckSettings(), getLastResults(), loadLibrary(), loadProjectFile(), loadResults(), loadSettings(), MainWindow(), newProjectFile(), reAnalyze(), reAnalyzeAll(), reAnalyzeSelected(), saveSettings(), selectFilesToAnalyze(), setLanguage(), showStatistics(), suppressIds(), and ~MainWindow().
|
private |
Project MRU menu actions.
List of MRU menu actions. Needs also to store the separator.
Definition at line 477 of file mainwindow.h.
Referenced by analysisDone(), checkLockDownUI(), MainWindow(), and updateMRUMenuItems().
|
private |
Scratchpad.
Definition at line 443 of file mainwindow.h.
Referenced by analysisDone(), checkLockDownUI(), setLanguage(), showScratchpad(), and ~MainWindow().
|
private |
GUI actions for selecting language.
Definition at line 461 of file mainwindow.h.
Referenced by analysisDone(), checkLockDownUI(), and MainWindow().
|
private |
Program settings.
Definition at line 425 of file mainwindow.h.
Referenced by addProjectMRU(), analysisDone(), doAnalyzeProject(), getCppcheckSettings(), hideInformation(), loadAddon(), loadLastResults(), loadSettings(), MainWindow(), programSettings(), removeProjectMRU(), replyFinished(), saveSettings(), selectFilesToAnalyze(), selectPlatform(), and updateMRUMenuItems().
|
private |
Thread to analyze files.
Definition at line 428 of file mainwindow.h.
Referenced by analyzeProject(), closeEvent(), doAnalyzeFiles(), doAnalyzeProject(), enableCheckButtons(), MainWindow(), reAnalyze(), reAnalyzeSelected(), showStatistics(), and stopAnalysis().
|
private |
Class to handle translation changes.
Definition at line 434 of file mainwindow.h.
Referenced by programSettings(), saveSettings(), and setLanguage().
|
private |
Class holding all UI components.
Definition at line 437 of file mainwindow.h.
Referenced by aboutToShowViewMenu(), analysisDone(), analyzeCode(), checkLockDownUI(), clearResults(), closeProjectFile(), complianceReport(), doAnalyzeFiles(), doAnalyzeProject(), enableCheckButtons(), enableProjectActions(), enableProjectOpenActions(), enableResultsButtons(), filterResults(), hideInformation(), loadLastResults(), loadProjectFile(), loadResults(), loadSettings(), MainWindow(), openResults(), programSettings(), reAnalyze(), reAnalyzeSelected(), replyFinished(), save(), saveSettings(), setLanguage(), showErrors(), showInformation(), showPerformance(), showPortability(), showStatistics(), showStyle(), showWarnings(), stopAnalysis(), toggleAllChecked(), toggleFilterToolBar(), toggleMainToolBar(), toggleViewToolBar(), updateMRUMenuItems(), and ~MainWindow().