GUI: Simple first hack to allow bughunting in the GUI

This commit is contained in:
Daniel Marjamäki 2020-02-04 21:20:43 +01:00
parent ca3095746c
commit 25b5304efc
9 changed files with 102 additions and 1 deletions

View File

@ -16,6 +16,10 @@ contains(LINKCORE, [yY][eE][sS]) {
}
LIBS += -L$$PWD/../externals
# z3
LIBS += -lz3
QMAKE_CXXFLAGS += -DUSE_Z3
DESTDIR = .
RCC_DIR = temp
MOC_DIR = temp

View File

@ -28,5 +28,6 @@
<file>images/applications-development.png</file>
<file>images/applications-system.png</file>
<file>images/llvm-dragon.png</file>
<file>images/verify.svg</file>
</qresource>
</RCC>

74
gui/images/verify.svg Normal file
View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="297"
height="210"
viewBox="0 0 78.581252 55.562501"
version="1.1"
id="svg8"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="verify.svg"
inkscape:export-filename="/home/danielm/verify.svg.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.3764247"
inkscape:cx="231.16151"
inkscape:cy="218.89725"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="981"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1"
units="px" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-241.4375)">
<ellipse
id="path3715"
cx="38.99736"
cy="269.44327"
style="fill:#4d4d4d;stroke-width:0.1327479"
rx="21.936352"
ry="21.681561" />
<path
style="fill:#ffffff;stroke:#000000;stroke-width:0.1327479px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 25.288891,266.30976 11.703894,15.45035 17.71617,-21.78895 -4.248675,-3.6447 -13.467495,16.16344 -7.294892,-9.34944 z"
id="path4522"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -840,6 +840,7 @@ Settings MainWindow::getCppcheckSettings()
}
result.clang = mProjectFile->clangParser;
result.bugHunting = mProjectFile->bugHunting;
const QStringList undefines = mProjectFile->getUndefines();
foreach (QString undefine, undefines)

View File

@ -46,6 +46,7 @@ ProjectFile::ProjectFile(const QString &filename, QObject *parent) :
void ProjectFile::clear()
{
clangParser = false;
bugHunting = false;
mRootPath.clear();
mBuildDir.clear();
mImportProject.clear();
@ -115,6 +116,9 @@ bool ProjectFile::read(const QString &filename)
if (xmlReader.name() == CppcheckXml::Parser)
clangParser = true;
if (xmlReader.name() == CppcheckXml::BugHunting)
bugHunting = true;
if (xmlReader.name() == CppcheckXml::CheckHeadersElementName)
mCheckHeaders = readBool(xmlReader);
@ -719,6 +723,11 @@ bool ProjectFile::write(const QString &filename)
xmlWriter.writeEndElement();
}
if (bugHunting) {
xmlWriter.writeStartElement(CppcheckXml::BugHunting);
xmlWriter.writeEndElement();
}
xmlWriter.writeStartElement(CppcheckXml::CheckHeadersElementName);
xmlWriter.writeCharacters(mCheckHeaders ? "true" : "false");
xmlWriter.writeEndElement();

View File

@ -366,6 +366,8 @@ public:
/** Use Clang parser */
bool clangParser;
/** Bug hunting */
bool bugHunting;
protected:
/**

View File

@ -264,6 +264,7 @@ void ProjectFileDialog::loadFromProjectFile(const ProjectFile *projectFile)
mUI.mBtnClangParser->setChecked(true);
else
mUI.mBtnCppcheckParser->setChecked(true);
mUI.mBugHunting->setChecked(projectFile->bugHunting);
setExcludedPaths(projectFile->getExcludedPaths());
setLibraries(projectFile->getLibraries());
const QString platform = projectFile->getPlatform();
@ -366,6 +367,7 @@ void ProjectFileDialog::saveToProjectFile(ProjectFile *projectFile) const
projectFile->setExcludedPaths(getExcludedPaths());
projectFile->setLibraries(getLibraries());
projectFile->clangParser = mUI.mBtnClangParser->isChecked();
projectFile->bugHunting = mUI.mBugHunting->isChecked();
if (mUI.mComboBoxPlatform->currentText().endsWith(".xml"))
projectFile->setPlatform(mUI.mComboBoxPlatform->currentText());
else {

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>888</width>
<height>546</height>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
@ -388,6 +388,13 @@
<string>Analysis</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<widget class="QCheckBox" name="mBugHunting">
<property name="text">
<string>Bug hunting</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="mCheckHeaders">
<property name="text">

View File

@ -123,6 +123,7 @@ namespace CppcheckXml {
const char ImportProjectElementName[] = "importproject";
const char AnalyzeAllVsConfigsElementName[] = "analyze-all-vs-configs";
const char Parser[] = "parser";
const char BugHunting[] = "bug-hunting";
const char IncludeDirElementName[] = "includedir";
const char DirElementName[] = "dir";
const char DirNameAttrib[] = "name";