From c3355e37e47568894c64daf6199c1455c43c9528 Mon Sep 17 00:00:00 2001 From: dismine Date: Tue, 17 Jun 2014 12:50:11 +0300 Subject: [PATCH] Includes for Coverity Scan, again. --HG-- branch : develop --- .hgignore | 3 +++ src/app/container/vcontainer.cpp | 2 ++ src/app/container/vcontainer.h | 2 ++ src/app/dialogs/app/configdialog.cpp | 8 +++++++- src/app/dialogs/app/dialogincrements.cpp | 1 + .../dialogs/app/dialogindividualmeasurements.cpp | 1 + src/app/dialogs/app/dialogpatternproperties.cpp | 1 + src/app/dialogs/app/dialogpatternxmledit.cpp | 1 + .../dialogs/app/dialogstandardmeasurements.cpp | 1 + src/app/dialogs/app/pages.cpp | 16 ++++++++++++++-- src/app/dialogs/app/pages.h | 2 ++ src/app/dialogs/tools/dialogarc.cpp | 1 + src/app/dialogs/tools/dialogtool.cpp | 14 ++++++++++++++ src/app/dialogs/tools/dialogtool.h | 1 + src/app/exception/vexception.cpp | 6 +++--- src/app/exception/vexception.h | 2 +- src/app/exception/vexceptionemptyparameter.cpp | 1 + src/app/geometry/varc.cpp | 3 +++ src/app/geometry/varc.h | 1 + src/app/geometry/vdetail.h | 1 + src/app/geometry/vgobject.h | 2 ++ src/app/geometry/vnodedetail.h | 1 + src/app/geometry/vspline.cpp | 1 + src/app/geometry/vspline.h | 3 ++- src/app/geometry/vsplinepath.h | 3 +++ src/app/geometry/vsplinepoint.cpp | 1 + src/app/geometry/vsplinepoint.h | 1 + src/app/mainwindow.cpp | 2 ++ src/app/tools/drawTools/vtoolpoint.h | 1 + src/app/tools/nodeDetails/vnodearc.cpp | 2 ++ src/app/tools/nodeDetails/vnodepoint.cpp | 3 +++ src/app/tools/nodeDetails/vnodespline.cpp | 2 ++ src/app/tools/nodeDetails/vnodesplinepath.cpp | 2 ++ src/app/tools/vtooluniondetails.cpp | 2 +- src/app/widgets/vapplication.cpp | 4 +--- src/app/widgets/vgraphicssimpletextitem.cpp | 2 ++ src/app/widgets/vmaingraphicsscene.cpp | 1 + src/app/widgets/vsimplesplinepath.cpp | 1 + src/app/widgets/vtablegraphicsview.cpp | 3 +++ src/app/widgets/vtranslation.cpp | 1 + src/app/xml/vindividualmeasurements.cpp | 1 + src/app/xml/vpattern.cpp | 1 + src/libs/qmuparser/qmuparser.cpp | 1 + src/libs/qmuparser/qmuparserbase.cpp | 2 +- src/libs/qmuparser/qmuparserbytecode.cpp | 1 + 45 files changed, 99 insertions(+), 13 deletions(-) diff --git a/.hgignore b/.hgignore index 88129a4c3..d4f666f85 100644 --- a/.hgignore +++ b/.hgignore @@ -26,6 +26,9 @@ uic/ rcc/ man/ +#Ignore Coverity Scan Build Tool +cov-int/ + # Ignore file used QtCreator for user profile. *.pro.user diff --git a/src/app/container/vcontainer.cpp b/src/app/container/vcontainer.cpp index 1ff67ac16..4f8b81778 100644 --- a/src/app/container/vcontainer.cpp +++ b/src/app/container/vcontainer.cpp @@ -31,6 +31,8 @@ #include "../widgets/vapplication.h" #include "../geometry/varc.h" #include "../geometry/vsplinepath.h" +#include +#include quint32 VContainer::_id = 0; diff --git a/src/app/container/vcontainer.h b/src/app/container/vcontainer.h index 091ae9d68..8e5ba870f 100644 --- a/src/app/container/vcontainer.h +++ b/src/app/container/vcontainer.h @@ -34,6 +34,8 @@ #include "../geometry/vdetail.h" #include "../geometry/vgobject.h" #include "../exception/vexceptionbadid.h" +#include +#include /** * @brief The VContainer class container of all variables. diff --git a/src/app/dialogs/app/configdialog.cpp b/src/app/dialogs/app/configdialog.cpp index 1f321f4aa..c684f3629 100644 --- a/src/app/dialogs/app/configdialog.cpp +++ b/src/app/dialogs/app/configdialog.cpp @@ -27,10 +27,16 @@ *************************************************************************/ #include "configdialog.h" +#include +#include +#include +#include +#include //--------------------------------------------------------------------------------------------------------------------- ConfigDialog::ConfigDialog(QWidget *parent) : - QDialog(parent), contentsWidget(nullptr), pagesWidget(nullptr), configurationPage(nullptr), patternPage(nullptr) + QDialog(parent), contentsWidget(nullptr), pagesWidget(nullptr), configurationPage(nullptr), patternPage(nullptr), + communityPage(nullptr) { contentsWidget = new QListWidget; contentsWidget->setViewMode(QListView::IconMode); diff --git a/src/app/dialogs/app/dialogincrements.cpp b/src/app/dialogs/app/dialogincrements.cpp index 076d83878..a4df3d8f5 100644 --- a/src/app/dialogs/app/dialogincrements.cpp +++ b/src/app/dialogs/app/dialogincrements.cpp @@ -37,6 +37,7 @@ #include #include #include +#include //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/dialogs/app/dialogindividualmeasurements.cpp b/src/app/dialogs/app/dialogindividualmeasurements.cpp index abcbfee3d..a9c2e8b34 100644 --- a/src/app/dialogs/app/dialogindividualmeasurements.cpp +++ b/src/app/dialogs/app/dialogindividualmeasurements.cpp @@ -31,6 +31,7 @@ #include "../../xml/vindividualmeasurements.h" #include #include +#include #include "../../widgets/vapplication.h" #include "../../container/vcontainer.h" diff --git a/src/app/dialogs/app/dialogpatternproperties.cpp b/src/app/dialogs/app/dialogpatternproperties.cpp index 39b7e1f4e..ba236e0f7 100644 --- a/src/app/dialogs/app/dialogpatternproperties.cpp +++ b/src/app/dialogs/app/dialogpatternproperties.cpp @@ -29,6 +29,7 @@ #include "dialogpatternproperties.h" #include "ui_dialogpatternproperties.h" #include +#include #include "../../xml/vpattern.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/dialogs/app/dialogpatternxmledit.cpp b/src/app/dialogs/app/dialogpatternxmledit.cpp index 7010748f3..521ed0792 100644 --- a/src/app/dialogs/app/dialogpatternxmledit.cpp +++ b/src/app/dialogs/app/dialogpatternxmledit.cpp @@ -29,6 +29,7 @@ #include "dialogpatternxmledit.h" #include "ui_dialogpatternxmledit.h" +#include #include const short int DialogPatternXmlEdit::ChangeTypeDelete=1; diff --git a/src/app/dialogs/app/dialogstandardmeasurements.cpp b/src/app/dialogs/app/dialogstandardmeasurements.cpp index 6af2a7ce1..980c3efe0 100644 --- a/src/app/dialogs/app/dialogstandardmeasurements.cpp +++ b/src/app/dialogs/app/dialogstandardmeasurements.cpp @@ -29,6 +29,7 @@ #include "dialogstandardmeasurements.h" #include "ui_dialogstandardmeasurements.h" #include +#include #include "../../xml/vstandardmeasurements.h" #include "../../widgets/vapplication.h" #include "../../container/vcontainer.h" diff --git a/src/app/dialogs/app/pages.cpp b/src/app/dialogs/app/pages.cpp index f4d6805ee..01044635f 100644 --- a/src/app/dialogs/app/pages.cpp +++ b/src/app/dialogs/app/pages.cpp @@ -30,10 +30,22 @@ #include "../../options.h" #include "../../widgets/vapplication.h" #include "../../widgets/vmaingraphicsview.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include //--------------------------------------------------------------------------------------------------------------------- -ConfigurationPage::ConfigurationPage(QWidget *parent): - QWidget(parent), autoSaveCheck(nullptr), autoTime(nullptr), langCombo(nullptr), unitCombo(nullptr), +ConfigurationPage::ConfigurationPage(QWidget *parent) + : QWidget(parent), autoSaveCheck(nullptr), autoTime(nullptr), langCombo(nullptr), unitCombo(nullptr), osOptionCheck(nullptr), langChanged(false), unitChanged(false) { QGroupBox *saveGroup = SaveGroup(); diff --git a/src/app/dialogs/app/pages.h b/src/app/dialogs/app/pages.h index 0ba1fad48..1474cf662 100644 --- a/src/app/dialogs/app/pages.h +++ b/src/app/dialogs/app/pages.h @@ -30,6 +30,8 @@ #define PAGES_H #include +#include +#include class QCheckBox; class QSpinBox; diff --git a/src/app/dialogs/tools/dialogarc.cpp b/src/app/dialogs/tools/dialogarc.cpp index 47c145de0..92cae1561 100644 --- a/src/app/dialogs/tools/dialogarc.cpp +++ b/src/app/dialogs/tools/dialogarc.cpp @@ -30,6 +30,7 @@ #include "ui_dialogarc.h" #include +#include #include "../../geometry/vpointf.h" #include "../../container/vcontainer.h" diff --git a/src/app/dialogs/tools/dialogtool.cpp b/src/app/dialogs/tools/dialogtool.cpp index 6c22ba12b..570d2ef8e 100644 --- a/src/app/dialogs/tools/dialogtool.cpp +++ b/src/app/dialogs/tools/dialogtool.cpp @@ -36,6 +36,20 @@ #include "../../../libs/qmuparser/qmuparsererror.h" #include "../../widgets/vapplication.h" #include "../../xml/vdomdocument.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/dialogs/tools/dialogtool.h b/src/app/dialogs/tools/dialogtool.h index 87f308401..0ddbabe69 100644 --- a/src/app/dialogs/tools/dialogtool.h +++ b/src/app/dialogs/tools/dialogtool.h @@ -32,6 +32,7 @@ #include #include #include "../../widgets/vapplication.h" +#include class QDoubleSpinBox; class QLabel; diff --git a/src/app/exception/vexception.cpp b/src/app/exception/vexception.cpp index a0e06ebbc..fef48ed4a 100644 --- a/src/app/exception/vexception.cpp +++ b/src/app/exception/vexception.cpp @@ -27,12 +27,12 @@ *************************************************************************/ #include "vexception.h" +#include #include +#include +#include #include "../options.h" -class QSpacerItem; -class QGridLayout; - //--------------------------------------------------------------------------------------------------------------------- /** * @brief VException constructor exception diff --git a/src/app/exception/vexception.h b/src/app/exception/vexception.h index 721e73132..4f30c3423 100644 --- a/src/app/exception/vexception.h +++ b/src/app/exception/vexception.h @@ -26,12 +26,12 @@ ** *************************************************************************/ - #ifndef VEXCEPTION_H #define VEXCEPTION_H #include #include +#include class QWidget; diff --git a/src/app/exception/vexceptionemptyparameter.cpp b/src/app/exception/vexceptionemptyparameter.cpp index b9d63e056..31d876f78 100644 --- a/src/app/exception/vexceptionemptyparameter.cpp +++ b/src/app/exception/vexceptionemptyparameter.cpp @@ -28,6 +28,7 @@ #include "vexceptionemptyparameter.h" #include +#include //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/geometry/varc.cpp b/src/app/geometry/varc.cpp index facf84354..dd7718f91 100644 --- a/src/app/geometry/varc.cpp +++ b/src/app/geometry/varc.cpp @@ -28,6 +28,9 @@ #include "varc.h" #include +#include +#include +#include #ifdef Q_OS_WIN32 # include // for M_PI on Windows diff --git a/src/app/geometry/varc.h b/src/app/geometry/varc.h index 1aa18aa4a..e9b6ca53c 100644 --- a/src/app/geometry/varc.h +++ b/src/app/geometry/varc.h @@ -31,6 +31,7 @@ #include "vgobject.h" #include "vpointf.h" +#include class QPainterPath; diff --git a/src/app/geometry/vdetail.h b/src/app/geometry/vdetail.h index efcf6f7f5..924d4eaa7 100644 --- a/src/app/geometry/vdetail.h +++ b/src/app/geometry/vdetail.h @@ -30,6 +30,7 @@ #define VDETAIL_H #include "vnodedetail.h" +#include #include class QString; diff --git a/src/app/geometry/vgobject.h b/src/app/geometry/vgobject.h index e6e86f96c..83c48aafa 100644 --- a/src/app/geometry/vgobject.h +++ b/src/app/geometry/vgobject.h @@ -30,6 +30,8 @@ #define VGOBJECT_H #include "../options.h" +#include +#include enum class GOType : char { Point, Arc, Spline, SplinePath }; diff --git a/src/app/geometry/vnodedetail.h b/src/app/geometry/vnodedetail.h index 936e06d52..ee94e5797 100644 --- a/src/app/geometry/vnodedetail.h +++ b/src/app/geometry/vnodedetail.h @@ -30,6 +30,7 @@ #define VNODEDETAIL_H #include "../options.h" +#include enum class NodeDetail : char { Contour, Modeling }; diff --git a/src/app/geometry/vspline.cpp b/src/app/geometry/vspline.cpp index ffd837bb5..51ad88a07 100644 --- a/src/app/geometry/vspline.cpp +++ b/src/app/geometry/vspline.cpp @@ -28,6 +28,7 @@ #include "vspline.h" #include +#include #ifdef Q_OS_WIN32 # include // for M_PI on Windows diff --git a/src/app/geometry/vspline.h b/src/app/geometry/vspline.h index e749f0863..629ca99cf 100644 --- a/src/app/geometry/vspline.h +++ b/src/app/geometry/vspline.h @@ -31,8 +31,9 @@ #include "vpointf.h" #include "vgobject.h" +#include +#include -class QLineF; class QPainterPath; #define M_2PI 6.28318530717958647692528676655900576 diff --git a/src/app/geometry/vsplinepath.h b/src/app/geometry/vsplinepath.h index 991799401..e31553eea 100644 --- a/src/app/geometry/vsplinepath.h +++ b/src/app/geometry/vsplinepath.h @@ -32,6 +32,9 @@ #include "vgobject.h" #include "vspline.h" #include "vsplinepoint.h" +#include +#include +#include enum class SplinePointPosition : char { FirstPoint, LastPoint }; diff --git a/src/app/geometry/vsplinepoint.cpp b/src/app/geometry/vsplinepoint.cpp index daeaca28d..87b3d0e68 100644 --- a/src/app/geometry/vsplinepoint.cpp +++ b/src/app/geometry/vsplinepoint.cpp @@ -28,6 +28,7 @@ #include "vsplinepoint.h" #include +#include //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/geometry/vsplinepoint.h b/src/app/geometry/vsplinepoint.h index f19826c5e..95cce159e 100644 --- a/src/app/geometry/vsplinepoint.h +++ b/src/app/geometry/vsplinepoint.h @@ -30,6 +30,7 @@ #define VSPLINEPOINT_H #include "vpointf.h" +#include /** * @brief The VSplinePoint class keep information about point in spline path. Each point have two angles and two diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 548caf616..a843b8caa 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -47,6 +47,8 @@ #include #include #include +#include +#include //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/tools/drawTools/vtoolpoint.h b/src/app/tools/drawTools/vtoolpoint.h index a0afcfbf0..fd4fc12e8 100644 --- a/src/app/tools/drawTools/vtoolpoint.h +++ b/src/app/tools/drawTools/vtoolpoint.h @@ -30,6 +30,7 @@ #define VTOOLPOINT_H #include "vdrawtool.h" +#include class VPointF; class VGraphicsSimpleTextItem; diff --git a/src/app/tools/nodeDetails/vnodearc.cpp b/src/app/tools/nodeDetails/vnodearc.cpp index 403ac0aaf..0b9d03cfa 100644 --- a/src/app/tools/nodeDetails/vnodearc.cpp +++ b/src/app/tools/nodeDetails/vnodearc.cpp @@ -30,6 +30,8 @@ #include "../../widgets/vapplication.h" #include "../../geometry/varc.h" +#include +#include const QString VNodeArc::TagName = QStringLiteral("arc"); const QString VNodeArc::ToolType = QStringLiteral("modeling"); diff --git a/src/app/tools/nodeDetails/vnodepoint.cpp b/src/app/tools/nodeDetails/vnodepoint.cpp index 199fe3bb8..278b61fef 100644 --- a/src/app/tools/nodeDetails/vnodepoint.cpp +++ b/src/app/tools/nodeDetails/vnodepoint.cpp @@ -31,6 +31,9 @@ #include "../../widgets/vapplication.h" #include "../../geometry/vpointf.h" #include "../../widgets/vgraphicssimpletextitem.h" +#include +#include +#include const QString VNodePoint::TagName = QStringLiteral("point"); const QString VNodePoint::ToolType = QStringLiteral("modeling"); diff --git a/src/app/tools/nodeDetails/vnodespline.cpp b/src/app/tools/nodeDetails/vnodespline.cpp index 3ed4d22f2..1126ff51e 100644 --- a/src/app/tools/nodeDetails/vnodespline.cpp +++ b/src/app/tools/nodeDetails/vnodespline.cpp @@ -30,6 +30,8 @@ #include "../../widgets/vapplication.h" #include "../../geometry/vspline.h" +#include +#include const QString VNodeSpline::TagName = QStringLiteral("spline"); const QString VNodeSpline::ToolType = QStringLiteral("modelingSpline"); diff --git a/src/app/tools/nodeDetails/vnodesplinepath.cpp b/src/app/tools/nodeDetails/vnodesplinepath.cpp index aea0047b6..06bbe5eb4 100644 --- a/src/app/tools/nodeDetails/vnodesplinepath.cpp +++ b/src/app/tools/nodeDetails/vnodesplinepath.cpp @@ -30,6 +30,8 @@ #include "../../widgets/vapplication.h" #include "../../geometry/vsplinepath.h" +#include +#include const QString VNodeSplinePath::TagName = QStringLiteral("spline"); const QString VNodeSplinePath::ToolType = QStringLiteral("modelingPath"); diff --git a/src/app/tools/vtooluniondetails.cpp b/src/app/tools/vtooluniondetails.cpp index b9cd16e9c..530d01fda 100644 --- a/src/app/tools/vtooluniondetails.cpp +++ b/src/app/tools/vtooluniondetails.cpp @@ -715,7 +715,7 @@ QVector VToolUnionDetails::GetDetailFromFile(VPattern *doc, const QDomE quint32 id = doc->GetParametrUInt(element, VToolDetail::AttrIdObject, "0"); qreal mx = qApp->toPixel(doc->GetParametrDouble(element, VAbstractTool::AttrMx, "0.0")); qreal my = qApp->toPixel(doc->GetParametrDouble(element, VAbstractTool::AttrMy, "0.0")); - Tool tool; + Tool tool = Tool::NodePoint; NodeDetail nodeType = NodeDetail::Contour; QString t = doc->GetParametrString(element, "type", "NodePoint"); if (t == "NodePoint") diff --git a/src/app/widgets/vapplication.cpp b/src/app/widgets/vapplication.cpp index 934ecd865..05db5b923 100644 --- a/src/app/widgets/vapplication.cpp +++ b/src/app/widgets/vapplication.cpp @@ -40,9 +40,7 @@ #include #include -#ifdef Q_OS_WIN32 -# include // for M_PI on Windows -#endif /*Q_OS_WIN32*/ +#include const qreal VApplication::PrintDPI = 96.0; diff --git a/src/app/widgets/vgraphicssimpletextitem.cpp b/src/app/widgets/vgraphicssimpletextitem.cpp index 5621f7703..62076f3d5 100644 --- a/src/app/widgets/vgraphicssimpletextitem.cpp +++ b/src/app/widgets/vgraphicssimpletextitem.cpp @@ -27,6 +27,8 @@ *************************************************************************/ #include "vgraphicssimpletextitem.h" +#include +#include //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/widgets/vmaingraphicsscene.cpp b/src/app/widgets/vmaingraphicsscene.cpp index 761327227..e4bbf423d 100644 --- a/src/app/widgets/vmaingraphicsscene.cpp +++ b/src/app/widgets/vmaingraphicsscene.cpp @@ -27,6 +27,7 @@ *************************************************************************/ #include "vmaingraphicsscene.h" +#include //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/widgets/vsimplesplinepath.cpp b/src/app/widgets/vsimplesplinepath.cpp index 8752fcf5c..1456ec480 100644 --- a/src/app/widgets/vsimplesplinepath.cpp +++ b/src/app/widgets/vsimplesplinepath.cpp @@ -29,6 +29,7 @@ #include "vsimplesplinepath.h" #include "../widgets/vapplication.h" #include +#include //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/app/widgets/vtablegraphicsview.cpp b/src/app/widgets/vtablegraphicsview.cpp index 28fe99fa9..5d21f03eb 100644 --- a/src/app/widgets/vtablegraphicsview.cpp +++ b/src/app/widgets/vtablegraphicsview.cpp @@ -29,7 +29,10 @@ #include "vtablegraphicsview.h" #include +#include +#include #include +#include #include "../options.h" //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/widgets/vtranslation.cpp b/src/app/widgets/vtranslation.cpp index b616d966f..d43f9eabe 100644 --- a/src/app/widgets/vtranslation.cpp +++ b/src/app/widgets/vtranslation.cpp @@ -27,6 +27,7 @@ *************************************************************************/ #include "vtranslation.h" +#include //--------------------------------------------------------------------------------------------------------------------- VTranslation VTranslation::translate(const QString &context, const QString &sourceText, const QString &disambiguation, diff --git a/src/app/xml/vindividualmeasurements.cpp b/src/app/xml/vindividualmeasurements.cpp index b0217e0c8..0acefe104 100644 --- a/src/app/xml/vindividualmeasurements.cpp +++ b/src/app/xml/vindividualmeasurements.cpp @@ -28,6 +28,7 @@ #include "vindividualmeasurements.h" #include "../widgets/vapplication.h" +#include const QString VIndividualMeasurements::AttrValue = QStringLiteral("value"); const QString VIndividualMeasurements::TagFamily_name = QStringLiteral("family-name"); diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 340a0c146..353d09fda 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -895,6 +895,7 @@ void VPattern::ParseDetailElement(VMainGraphicsScene *sceneDetail, const QDomEle break; default: qDebug()<<"Wrong node type."< +#include using namespace std; diff --git a/src/libs/qmuparser/qmuparserbase.cpp b/src/libs/qmuparser/qmuparserbase.cpp index 10a55b563..b6941a2b4 100644 --- a/src/libs/qmuparser/qmuparserbase.cpp +++ b/src/libs/qmuparser/qmuparserbase.cpp @@ -21,7 +21,7 @@ ******************************************************************************************************/ #include "qmuparserbase.h" -//#include +#include #ifdef Q_OS_WIN32 # include // for M_PI on Windows diff --git a/src/libs/qmuparser/qmuparserbytecode.cpp b/src/libs/qmuparser/qmuparserbytecode.cpp index d49357c06..439693911 100644 --- a/src/libs/qmuparser/qmuparserbytecode.cpp +++ b/src/libs/qmuparser/qmuparserbytecode.cpp @@ -31,6 +31,7 @@ #include #include "qmuparsertoken.h" +#include namespace qmu