Cppcheck
|
A dialog for editing project file data. More...
#include <projectfiledialog.h>
Public Member Functions | |
ProjectFileDialog (ProjectFile *projectFile, bool premium, QWidget *parent=nullptr) | |
~ProjectFileDialog () override | |
Protected Slots | |
void | ok () |
ok button pressed, save changes and accept More... | |
void | browseBuildDir () |
Browse for build dir. More... | |
void | clearImportProject () |
Clear 'import project'. More... | |
void | browseImportProject () |
Browse for solution / project / compile database. More... | |
void | addCheckPath () |
Add new path to check. More... | |
void | editCheckPath () |
Edit path in the list. More... | |
void | removeCheckPath () |
Remove path from the list. More... | |
void | addIncludeDir () |
Browse for include directory. More... | |
void | removeIncludeDir () |
Remove include directory from the list. More... | |
void | editIncludeDir () |
Edit include directory in the list. More... | |
void | addExcludePath () |
Add new path to exclude list. More... | |
void | addExcludeFile () |
Add new file to exclude list. More... | |
void | editExcludePath () |
Edit excluded path in the list. More... | |
void | removeExcludePath () |
Remove excluded path from the list. More... | |
void | moveIncludePathUp () |
Move include path up in the list. More... | |
void | moveIncludePathDown () |
Move include path down in the list. More... | |
void | addSuppression () |
Add suppression to the list. More... | |
void | removeSuppression () |
Remove selected suppression from the list. More... | |
void | editSuppression (const QModelIndex &index) |
Edit suppression (double clicking on suppression) More... | |
void | browseMisraFile () |
Browse for misra file. More... | |
void | checkAllVSConfigs () |
Check for all VS configurations. More... | |
Protected Member Functions | |
void | loadSettings () |
Save dialog settings. More... | |
void | saveSettings () const |
Load dialog settings. More... | |
void | addIncludeDir (const QString &dir) |
Add new indlude directory. More... | |
void | addCheckPath (const QString &path) |
Add new path to check. More... | |
void | addExcludePath (const QString &path) |
Add new path to ignore list. More... | |
int | getSuppressionIndex (const QString &shortText) const |
Get mSuppressions index that match the given short text. More... | |
Private Member Functions | |
void | loadFromProjectFile (const ProjectFile *projectFile) |
void | saveToProjectFile (ProjectFile *projectFile) const |
void | updatePathsAndDefines () |
Enable and disable widgets in the 'Paths and Defines' tab. More... | |
QString | getRootPath () const |
Return project root path from the dialog control. More... | |
QStringList | getProjectConfigurations () const |
void | setProjectConfigurations (const QStringList &configs) |
QString | getImportProject () const |
QString | getBuildDir () const |
Get Cppcheck build dir. More... | |
QStringList | getIncludePaths () const |
Return include paths from the dialog control. More... | |
QStringList | getDefines () const |
Return define names from the dialog control. More... | |
QStringList | getUndefines () const |
Return undefine names from the dialog control. More... | |
QStringList | getCheckPaths () const |
Return check paths from the dialog control. More... | |
QStringList | getExcludedPaths () const |
Return excluded paths from the dialog control. More... | |
QStringList | getLibraries () const |
Return selected libraries from the dialog control. More... | |
const QList< SuppressionList::Suppression > & | getSuppressions () const |
Return suppressions from the dialog control. More... | |
void | setRootPath (const QString &root) |
Set project root path to dialog control. More... | |
void | setBuildDir (const QString &buildDir) |
Set build dir. More... | |
void | setImportProject (const QString &importProject) |
void | setIncludepaths (const QStringList &includes) |
Set include paths to dialog control. More... | |
void | setDefines (const QStringList &defines) |
Set define names to dialog control. More... | |
void | setUndefines (const QStringList &undefines) |
Set undefine names to dialog control. More... | |
void | setCheckPaths (const QStringList &paths) |
Set check paths to dialog control. More... | |
void | setExcludedPaths (const QStringList &paths) |
Set excluded paths to dialog control. More... | |
void | setLibraries (const QStringList &libraries) |
Set libraries to dialog control. More... | |
void | addSingleSuppression (const SuppressionList::Suppression &suppression) |
Add a single suppression to dialog control. More... | |
void | setSuppressions (const QList< SuppressionList::Suppression > &suppressions) |
Set suppressions to dialog control. More... | |
QString | getExistingDirectory (const QString &caption, bool trailingSlash) |
Static Private Member Functions | |
static QStringList | getProjectConfigs (const QString &fileName) |
Private Attributes | |
Ui::ProjectFile * | mUI |
ProjectFile * | mProjectFile |
Projectfile path. More... | |
bool | mPremium |
Is this Cppcheck Premium? More... | |
QList< SuppressionList::Suppression > | mSuppressions |
A dialog for editing project file data.
Definition at line 45 of file projectfiledialog.h.
|
explicit |
Definition at line 104 of file projectfiledialog.cpp.
References addCheckPath(), addExcludeFile(), addExcludePath(), addIncludeDir(), addSuppression(), browseBuildDir(), browseImportProject(), browseMisraFile(), builtinPlatforms, checkAllVSConfigs(), clearImportProject(), editCheckPath(), editExcludePath(), editIncludeDir(), editSuppression(), Library::Error::errorcode, Platforms::get(), getDataDir(), ProjectFile::getFilename(), Library::load(), Platform::loadFromFile(), loadFromProjectFile(), loadSettings(), moveIncludePathDown(), moveIncludePathUp(), PlatformData::mTitle, mUI, CppcheckXml::Name, ok(), Library::OK, removeCheckPath(), removeExcludePath(), removeIncludeDir(), and removeSuppression().
|
override |
Definition at line 249 of file projectfiledialog.cpp.
References mUI, and saveSettings().
|
protectedslot |
Add new path to check.
Definition at line 783 of file projectfiledialog.cpp.
References getExistingDirectory().
Referenced by ProjectFileDialog(), and setCheckPaths().
|
protected |
Add new path to check.
path | Path to add. |
Definition at line 630 of file projectfiledialog.cpp.
References mUI.
|
protectedslot |
Add new file to exclude list.
Definition at line 828 of file projectfiledialog.cpp.
References addExcludePath(), ProjectFile::getFilename(), mProjectFile, and toFilterString().
Referenced by ProjectFileDialog().
|
protectedslot |
Add new path to exclude list.
Definition at line 823 of file projectfiledialog.cpp.
References getExistingDirectory().
Referenced by addExcludeFile(), ProjectFileDialog(), and setExcludedPaths().
|
protected |
Add new path to ignore list.
path | Path to add. |
Definition at line 641 of file projectfiledialog.cpp.
References mUI.
|
protectedslot |
Browse for include directory.
Allow user to add new include directory to the list.
Definition at line 803 of file projectfiledialog.cpp.
References getExistingDirectory().
Referenced by ProjectFileDialog(), and setIncludepaths().
|
protected |
Add new indlude directory.
dir | Directory to add. |
Definition at line 619 of file projectfiledialog.cpp.
References mUI.
|
private |
Add a single suppression to dialog control.
suppression | A suppressions to add to dialog control. |
Definition at line 766 of file projectfiledialog.cpp.
References SuppressionList::Suppression::getText(), mSuppressions, and mUI.
Referenced by addSuppression(), and setSuppressions().
|
protectedslot |
Add suppression to the list.
Definition at line 870 of file projectfiledialog.cpp.
References addSingleSuppression(), and NewSuppressionDialog::getSuppression().
Referenced by ProjectFileDialog().
|
protectedslot |
Browse for build dir.
Definition at line 533 of file projectfiledialog.cpp.
References getExistingDirectory(), and mUI.
Referenced by ProjectFileDialog().
|
protectedslot |
Browse for solution / project / compile database.
Definition at line 570 of file projectfiledialog.cpp.
References ProjectFile::getFilename(), getProjectConfigs(), mProjectFile, mUI, setProjectConfigurations(), toFilterString(), and updatePathsAndDefines().
Referenced by ProjectFileDialog().
|
protectedslot |
Browse for misra file.
Definition at line 916 of file projectfiledialog.cpp.
References ADDON_MISRA, getDataDir(), mUI, SETTINGS_MISRA_FILE, and updateAddonCheckBox().
Referenced by ProjectFileDialog().
|
protectedslot |
Check for all VS configurations.
Definition at line 279 of file projectfiledialog.cpp.
References mUI.
Referenced by ProjectFileDialog().
|
protectedslot |
Clear 'import project'.
Definition at line 564 of file projectfiledialog.cpp.
References mUI, and updatePathsAndDefines().
Referenced by ProjectFileDialog().
|
protectedslot |
Edit path in the list.
Definition at line 790 of file projectfiledialog.cpp.
References mUI.
Referenced by ProjectFileDialog().
|
protectedslot |
Edit excluded path in the list.
Definition at line 838 of file projectfiledialog.cpp.
References mUI.
Referenced by ProjectFileDialog().
|
protectedslot |
Edit include directory in the list.
Definition at line 817 of file projectfiledialog.cpp.
References mUI.
Referenced by ProjectFileDialog().
|
protectedslot |
Edit suppression (double clicking on suppression)
Definition at line 891 of file projectfiledialog.cpp.
References NewSuppressionDialog::getSuppression(), getSuppressionIndex(), mSuppressions, mUI, NewSuppressionDialog::setSuppression(), and setSuppressions().
Referenced by ProjectFileDialog().
|
private |
Get Cppcheck build dir.
Definition at line 660 of file projectfiledialog.cpp.
References mUI.
Referenced by saveToProjectFile().
|
private |
Return check paths from the dialog control.
Definition at line 691 of file projectfiledialog.cpp.
References getPaths(), and mUI.
Referenced by saveToProjectFile().
|
private |
Return define names from the dialog control.
Definition at line 670 of file projectfiledialog.cpp.
References mUI.
Referenced by saveToProjectFile().
|
private |
Return excluded paths from the dialog control.
Definition at line 696 of file projectfiledialog.cpp.
References getPaths(), and mUI.
Referenced by saveToProjectFile().
|
private |
Definition at line 508 of file projectfiledialog.cpp.
References ProjectFile::getFilename(), and mProjectFile.
Referenced by addCheckPath(), addExcludePath(), addIncludeDir(), and browseBuildDir().
|
private |
Definition at line 614 of file projectfiledialog.cpp.
References mUI.
Referenced by saveToProjectFile().
|
private |
Return include paths from the dialog control.
Definition at line 665 of file projectfiledialog.cpp.
References getPaths(), and mUI.
Referenced by saveToProjectFile().
|
private |
Return selected libraries from the dialog control.
Definition at line 701 of file projectfiledialog.cpp.
References mUI.
Referenced by saveToProjectFile().
|
staticprivate |
Definition at line 91 of file projectfiledialog.cpp.
References cfg(), ImportProject::getVSConfigs(), and ImportProject::import().
Referenced by browseImportProject(), and loadFromProjectFile().
|
private |
Definition at line 592 of file projectfiledialog.cpp.
References mUI.
Referenced by saveToProjectFile().
|
private |
Return project root path from the dialog control.
Definition at line 652 of file projectfiledialog.cpp.
References mUI.
Referenced by saveToProjectFile().
|
protected |
Get mSuppressions index that match the given short text.
shortText | text as generated by Suppression::getText |
Definition at line 906 of file projectfiledialog.cpp.
References mSuppressions.
Referenced by editSuppression(), and removeSuppression().
|
inlineprivate |
Return suppressions from the dialog control.
Definition at line 112 of file projectfiledialog.h.
References mSuppressions.
Referenced by saveToProjectFile().
|
private |
Return undefine names from the dialog control.
Definition at line 679 of file projectfiledialog.cpp.
References mUI.
Referenced by saveToProjectFile().
|
private |
Definition at line 290 of file projectfiledialog.cpp.
References ADDON_MISRA, builtinPlatforms, ProjectFile::clangParser, CheckThread::clangTidyCmd(), Settings::SafeChecks::classes, CODING_STANDARD_AUTOSAR, CODING_STANDARD_CERT_C, CODING_STANDARD_CERT_CPP, CODING_STANDARD_MISRA_C_2023, CODING_STANDARD_MISRA_CPP_2008, ProjectFile::getAnalyzeAllVsConfigs(), ProjectFile::getBughunting(), ProjectFile::getBuildDir(), ProjectFile::getCertIntPrecision(), ProjectFile::getCheckHeaders(), ProjectFile::getCheckPaths(), ProjectFile::getCheckUnusedTemplates(), ProjectFile::getClangAnalyzer(), ProjectFile::getClangTidy(), ProjectFile::getCodingStandards(), getDataDir(), ProjectFile::getDefines(), ProjectFile::getExcludedPaths(), ProjectFile::getImportProject(), ProjectFile::getIncludeDirs(), ProjectFile::getLibraries(), ProjectFile::getMaxCtuDepth(), ProjectFile::getMaxTemplateRecursion(), ProjectFile::getPlatform(), getProjectConfigs(), ProjectFile::getRootPath(), ProjectFile::getSuppressions(), ProjectFile::getTags(), ProjectFile::getUndefines(), ProjectFile::getVsConfigurations(), ProjectFile::isCheckLevelExhaustive(), mPremium, mUI, numberOfBuiltinPlatforms, ProjectFile::safeChecks, setBuildDir(), setCheckPaths(), setDefines(), setExcludedPaths(), setImportProject(), setIncludepaths(), setLibraries(), setProjectConfigurations(), setRootPath(), setSuppressions(), SETTINGS_MISRA_FILE, setUndefines(), Platform::toString(), updateAddonCheckBox(), and updatePathsAndDefines().
Referenced by ProjectFileDialog().
|
protected |
Save dialog settings.
Definition at line 255 of file projectfiledialog.cpp.
References SETTINGS_PROJECT_DIALOG_HEIGHT, and SETTINGS_PROJECT_DIALOG_WIDTH.
Referenced by ProjectFileDialog().
|
protectedslot |
Move include path down in the list.
Definition at line 860 of file projectfiledialog.cpp.
References mUI.
Referenced by ProjectFileDialog().
|
protectedslot |
Move include path up in the list.
Definition at line 851 of file projectfiledialog.cpp.
References mUI.
Referenced by ProjectFileDialog().
|
protectedslot |
ok button pressed, save changes and accept
Definition at line 501 of file projectfiledialog.cpp.
References mProjectFile, saveToProjectFile(), and ProjectFile::write().
Referenced by ProjectFileDialog().
|
protectedslot |
Remove path from the list.
Definition at line 796 of file projectfiledialog.cpp.
References mUI.
Referenced by ProjectFileDialog().
|
protectedslot |
Remove excluded path from the list.
Definition at line 844 of file projectfiledialog.cpp.
References mUI.
Referenced by ProjectFileDialog().
|
protectedslot |
Remove include directory from the list.
Definition at line 810 of file projectfiledialog.cpp.
References mUI.
Referenced by ProjectFileDialog().
|
protectedslot |
Remove selected suppression from the list.
Definition at line 878 of file projectfiledialog.cpp.
References getSuppressionIndex(), mSuppressions, and mUI.
Referenced by ProjectFileDialog().
|
protected |
Load dialog settings.
Definition at line 262 of file projectfiledialog.cpp.
References SETTINGS_PROJECT_DIALOG_HEIGHT, and SETTINGS_PROJECT_DIALOG_WIDTH.
Referenced by ~ProjectFileDialog().
|
private |
Definition at line 423 of file projectfiledialog.cpp.
References ADDON_MISRA, builtinPlatforms, ProjectFile::clangParser, Settings::SafeChecks::classes, CODING_STANDARD_AUTOSAR, CODING_STANDARD_CERT_C, CODING_STANDARD_CERT_CPP, CODING_STANDARD_MISRA_C_2023, CODING_STANDARD_MISRA_CPP_2008, ProjectFile::exhaustive, getBuildDir(), getCheckPaths(), getDefines(), getExcludedPaths(), getImportProject(), getIncludePaths(), getLibraries(), getProjectConfigurations(), getRootPath(), getSuppressions(), getUndefines(), mPremium, mUI, ProjectFile::normal, numberOfBuiltinPlatforms, ProjectFile::safeChecks, ProjectFile::setAddons(), ProjectFile::setAnalyzeAllVsConfigs(), ProjectFile::setBughunting(), ProjectFile::setBuildDir(), ProjectFile::setCertIntPrecision(), ProjectFile::setCheckHeaders(), ProjectFile::setCheckLevel(), ProjectFile::setCheckPaths(), ProjectFile::setCheckUnusedTemplates(), ProjectFile::setClangAnalyzer(), ProjectFile::setClangTidy(), ProjectFile::setCodingStandards(), ProjectFile::setDefines(), ProjectFile::setExcludedPaths(), ProjectFile::setImportProject(), ProjectFile::setIncludes(), ProjectFile::setLibraries(), ProjectFile::setMaxCtuDepth(), ProjectFile::setMaxTemplateRecursion(), ProjectFile::setPlatform(), ProjectFile::setRootPath(), ProjectFile::setSuppressions(), ProjectFile::setTags(), ProjectFile::setUndefines(), ProjectFile::setVSConfigurations(), and Platform::toString().
Referenced by ok().
|
private |
Set build dir.
Definition at line 717 of file projectfiledialog.cpp.
References mUI.
Referenced by loadFromProjectFile().
|
private |
Set check paths to dialog control.
paths | List of path names to set to dialog control. |
Definition at line 744 of file projectfiledialog.cpp.
References addCheckPath().
Referenced by loadFromProjectFile().
|
private |
Set define names to dialog control.
defines | List of define names to set to dialog control. |
Definition at line 734 of file projectfiledialog.cpp.
References mUI.
Referenced by loadFromProjectFile().
|
private |
Set excluded paths to dialog control.
paths | List of path names to set to dialog control. |
Definition at line 751 of file projectfiledialog.cpp.
References addExcludePath().
Referenced by loadFromProjectFile().
|
private |
Definition at line 722 of file projectfiledialog.cpp.
References mUI.
Referenced by loadFromProjectFile().
|
private |
Set include paths to dialog control.
includes | List of include paths to set to dialog control. |
Definition at line 727 of file projectfiledialog.cpp.
References addIncludeDir().
Referenced by loadFromProjectFile().
|
private |
Set libraries to dialog control.
libraries | List of libraries to set to dialog control. |
Definition at line 758 of file projectfiledialog.cpp.
References mUI.
Referenced by loadFromProjectFile().
|
private |
Definition at line 603 of file projectfiledialog.cpp.
Referenced by browseImportProject(), and loadFromProjectFile().
|
private |
Set project root path to dialog control.
root | Project root path to set to dialog control. |
Definition at line 712 of file projectfiledialog.cpp.
References mUI.
Referenced by loadFromProjectFile().
|
private |
Set suppressions to dialog control.
suppressions | List of suppressions to set to dialog control. |
Definition at line 772 of file projectfiledialog.cpp.
References addSingleSuppression(), mSuppressions, and mUI.
Referenced by editSuppression(), and loadFromProjectFile().
|
private |
Set undefine names to dialog control.
undefines | List of undefine names to set to dialog control. |
Definition at line 739 of file projectfiledialog.cpp.
References mUI.
Referenced by loadFromProjectFile().
|
private |
Enable and disable widgets in the 'Paths and Defines' tab.
Definition at line 540 of file projectfiledialog.cpp.
References mUI.
Referenced by browseImportProject(), clearImportProject(), and loadFromProjectFile().
|
private |
Is this Cppcheck Premium?
Definition at line 330 of file projectfiledialog.h.
Referenced by loadFromProjectFile(), and saveToProjectFile().
|
private |
Projectfile path.
Definition at line 327 of file projectfiledialog.h.
Referenced by addExcludeFile(), browseImportProject(), getExistingDirectory(), and ok().
|
private |
Definition at line 334 of file projectfiledialog.h.
Referenced by addSingleSuppression(), editSuppression(), getSuppressionIndex(), getSuppressions(), removeSuppression(), and setSuppressions().
|
private |
Definition at line 322 of file projectfiledialog.h.
Referenced by addCheckPath(), addExcludePath(), addIncludeDir(), addSingleSuppression(), browseBuildDir(), browseImportProject(), browseMisraFile(), checkAllVSConfigs(), clearImportProject(), editCheckPath(), editExcludePath(), editIncludeDir(), editSuppression(), getBuildDir(), getCheckPaths(), getDefines(), getExcludedPaths(), getImportProject(), getIncludePaths(), getLibraries(), getProjectConfigurations(), getRootPath(), getUndefines(), loadFromProjectFile(), moveIncludePathDown(), moveIncludePathUp(), ProjectFileDialog(), removeCheckPath(), removeExcludePath(), removeIncludeDir(), removeSuppression(), saveToProjectFile(), setBuildDir(), setDefines(), setImportProject(), setLibraries(), setProjectConfigurations(), setRootPath(), setSuppressions(), setUndefines(), updatePathsAndDefines(), and ~ProjectFileDialog().