diff --git a/plugins/paintops/hatching/hatching_brush.h b/plugins/paintops/hatching/hatching_brush.h --- a/plugins/paintops/hatching/hatching_brush.h +++ b/plugins/paintops/hatching/hatching_brush.h @@ -74,16 +74,16 @@ double origin_y; /** Intercept of the base line */ - double baseLineIntercept; + double baseLineIntercept {0}; /** Intercept of the first line _found to_ pass or be neighbour of a line * that passes through the hatching area, this line is used as a base * to start iterating with HatchingBrush::iterateLines() */ - double hotIntercept; + double hotIntercept {0}; /** Intercept of each line as it is scanned, this value changes constantly */ - double scanIntercept; + double scanIntercept {0}; /** X position of the first vertical line _found to_ pass or be neighbour * of a line that passes through the hatching area, this line is used as @@ -95,18 +95,18 @@ double verticalScanX; /** Angle of the lines expressed algebraically, as in slope*x + intercept = y */ - double slope; + double slope {0}; /** Unused variable, distance separating non-vertical lines in the X axis*/ - double dx; + double dx {0}; /** Distance separating non-vertical lines in the Y axis*/ - double dy; + double dy {0}; /** Intercept of the line that extends from the mouse cursor position, calculated from * the point (x, y) of the cursor and 'slope' */ - double cursorLineIntercept; + double cursorLineIntercept {0}; /** Function that begins exploring the field from hotIntercept and * moves in the direction of dy (forward==true) or -dy (forward==false) diff --git a/plugins/paintops/hatching/hatching_brush.cpp b/plugins/paintops/hatching/hatching_brush.cpp --- a/plugins/paintops/hatching/hatching_brush.cpp +++ b/plugins/paintops/hatching/hatching_brush.cpp @@ -36,20 +36,11 @@ } HatchingBrush::HatchingBrush(KisHatchingPaintOpSettingsSP settings) + : m_settings(settings) + , separation(m_settings->separation) + , origin_x(m_settings->origin_x) + , origin_y(m_settings->origin_y) { - m_settings = settings; - - // Initializing - separation = m_settings->separation; - origin_x = m_settings->origin_x; - origin_y = m_settings->origin_y; - cursorLineIntercept = 0; - baseLineIntercept = 0; - scanIntercept = 0; - hotIntercept = 0; - slope = 0; - dx = 0; - dy = 0; } diff --git a/plugins/paintops/libpaintop/kis_pressure_sharpness_option.h b/plugins/paintops/libpaintop/kis_pressure_sharpness_option.h --- a/plugins/paintops/libpaintop/kis_pressure_sharpness_option.h +++ b/plugins/paintops/libpaintop/kis_pressure_sharpness_option.h @@ -66,7 +66,7 @@ } private: - qint32 m_threshold; + qint32 m_threshold {40}; }; #endif diff --git a/plugins/paintops/libpaintop/kis_pressure_sharpness_option.cpp b/plugins/paintops/libpaintop/kis_pressure_sharpness_option.cpp --- a/plugins/paintops/libpaintop/kis_pressure_sharpness_option.cpp +++ b/plugins/paintops/libpaintop/kis_pressure_sharpness_option.cpp @@ -31,7 +31,6 @@ KisPressureSharpnessOption::KisPressureSharpnessOption() : KisCurveOption("Sharpness", KisPaintOpOption::GENERAL, false) { - m_threshold = 40; } void KisPressureSharpnessOption::writeOptionSetting(KisPropertiesConfigurationSP setting) const diff --git a/plugins/tools/basictools/kis_tool_measure.h b/plugins/tools/basictools/kis_tool_measure.h --- a/plugins/tools/basictools/kis_tool_measure.h +++ b/plugins/tools/basictools/kis_tool_measure.h @@ -95,8 +95,8 @@ private: KisToolMeasureOptionsWidget *m_optionsWidget; - QPointF m_startPos; - QPointF m_endPos; + QPointF m_startPos {QPointF(0, 0)}; + QPointF m_endPos {QPointF(0, 0)}; }; diff --git a/plugins/tools/basictools/kis_tool_measure.cc b/plugins/tools/basictools/kis_tool_measure.cc --- a/plugins/tools/basictools/kis_tool_measure.cc +++ b/plugins/tools/basictools/kis_tool_measure.cc @@ -96,8 +96,6 @@ KisToolMeasure::KisToolMeasure(KoCanvasBase * canvas) : KisTool(canvas, KisCursor::crossCursor()) { - m_startPos = QPointF(0, 0); - m_endPos = QPointF(0, 0); } KisToolMeasure::~KisToolMeasure() diff --git a/plugins/tools/karbonplugins/tools/filterEffectTool/FilterInputChangeCommand.cpp b/plugins/tools/karbonplugins/tools/filterEffectTool/FilterInputChangeCommand.cpp --- a/plugins/tools/karbonplugins/tools/filterEffectTool/FilterInputChangeCommand.cpp +++ b/plugins/tools/karbonplugins/tools/filterEffectTool/FilterInputChangeCommand.cpp @@ -30,9 +30,9 @@ FilterInputChangeCommand::FilterInputChangeCommand(const QList &data, KoShape *shape, KUndo2Command *parent) : KUndo2Command(parent) + , m_data(data) , m_shape(shape) { - m_data = data; } void FilterInputChangeCommand::redo() diff --git a/plugins/tools/tool_dyna/kis_tool_dyna.h b/plugins/tools/tool_dyna/kis_tool_dyna.h --- a/plugins/tools/tool_dyna/kis_tool_dyna.h +++ b/plugins/tools/tool_dyna/kis_tool_dyna.h @@ -40,16 +40,7 @@ class DynaFilter { public: - DynaFilter() { - curx = 0; - cury = 0; - lastx = 0; - lasty = 0; - velx = 0.0; - vely = 0.0; - accx = 0.0; - accy = 0.0; - } + DynaFilter() {} void init(qreal x, qreal y) { curx = x; @@ -65,13 +56,13 @@ ~DynaFilter() {} public: - qreal curx, cury; - qreal velx, vely, vel; - qreal accx, accy, acc; - qreal angx, angy; - qreal mass, drag; - qreal lastx, lasty; - bool fixedangle; + qreal curx {0.0}, cury {0.0}; + qreal velx {0.0}, vely {0.0}, vel {0.0}; + qreal accx {0.0}, accy {0.0}, acc {0.0}; + qreal angx {0.0}, angy {0.0}; + qreal mass {0.0}, drag {0.0}; + qreal lastx {0.0}, lasty {0.0}; + bool fixedangle {false}; }; diff --git a/plugins/tools/tool_smart_patch/kis_inpaint.cpp b/plugins/tools/tool_smart_patch/kis_inpaint.cpp --- a/plugins/tools/tool_smart_patch/kis_inpaint.cpp +++ b/plugins/tools/tool_smart_patch/kis_inpaint.cpp @@ -761,10 +761,10 @@ public: Inpaint(KisPaintDeviceSP dev, KisPaintDeviceSP devMask, int _radius, QRect maskRect) + : devCache(dev) + , initial(new MaskedImage(dev, devMask, maskRect)) + , radius(_radius) { - initial = new MaskedImage(dev, devMask, maskRect); - radius = _radius; - devCache = dev; } MaskedImageSP patch(void); MaskedImageSP patch_simple(void); diff --git a/plugins/tools/tool_transform2/tool_transform_args.h b/plugins/tools/tool_transform2/tool_transform_args.h --- a/plugins/tools/tool_transform2/tool_transform_args.h +++ b/plugins/tools/tool_transform2/tool_transform_args.h @@ -309,18 +309,18 @@ double m_aX; double m_aY; double m_aZ; - QVector3D m_cameraPos; + QVector3D m_cameraPos {QVector3D(0,0,1024)}; double m_scaleX; double m_scaleY; double m_shearX; double m_shearY; - bool m_keepAspectRatio; + bool m_keepAspectRatio {false}; // perspective trasform related QTransform m_flattenedPerspectiveTransform; KisFilterStrategy *m_filter; - bool m_editTransformPoints; + bool m_editTransformPoints {false}; QSharedPointer m_liquifyProperties; QScopedPointer m_liquifyWorker; diff --git a/plugins/tools/tool_transform2/tool_transform_args.cc b/plugins/tools/tool_transform2/tool_transform_args.cc --- a/plugins/tools/tool_transform2/tool_transform_args.cc +++ b/plugins/tools/tool_transform2/tool_transform_args.cc @@ -31,33 +31,28 @@ ToolTransformArgs::ToolTransformArgs() - : m_liquifyProperties(new KisLiquifyProperties()) + : m_mode(FREE_TRANSFORM) + , m_defaultPoints(true) + , m_origPoints {QVector()} + , m_transfPoints {QVector()} + , m_warpType(KisWarpTransformWorker::RIGID_TRANSFORM) + , m_alpha(1.0) + , m_transformedCenter(QPointF(0, 0)) + , m_originalCenter(QPointF(0, 0)) + , m_rotationCenterOffset(QPointF(0, 0)) + , m_aX(0) + , m_aY(0) + , m_aZ(0) + , m_scaleX(1.0) + , m_scaleY(1.0) + , m_shearX(0.0) + , m_shearY(0.0) + , m_liquifyProperties(new KisLiquifyProperties()) { - m_mode = FREE_TRANSFORM; - m_transformedCenter = QPointF(0, 0); - m_originalCenter = QPointF(0, 0); - m_rotationCenterOffset = QPointF(0, 0); - m_cameraPos = QVector3D(0,0,1024); - m_aX = 0; - m_aY = 0; - m_aZ = 0; - m_scaleX = 1.0; - m_scaleY = 1.0; - m_shearX = 0.0; - m_shearY = 0.0; - m_origPoints = QVector(); - m_transfPoints = QVector(); - m_warpType = KisWarpTransformWorker::RIGID_TRANSFORM; - m_alpha = 1.0; - m_keepAspectRatio = false; - m_defaultPoints = true; - KConfigGroup configGroup = KSharedConfig::openConfig()->group("KisToolTransform"); QString savedFilterId = configGroup.readEntry("filterId", "Bicubic"); setFilterId(savedFilterId); m_transformAroundRotationCenter = configGroup.readEntry("transformAroundRotationCenter", "0").toInt(); - - m_editTransformPoints = false; } void ToolTransformArgs::setFilterId(const QString &id) { @@ -233,29 +228,26 @@ double alpha, bool defaultPoints, const QString &filterId) - : m_liquifyProperties(new KisLiquifyProperties()) + : m_mode(mode) + , m_defaultPoints(defaultPoints) + , m_origPoints {QVector()} + , m_transfPoints {QVector()} + , m_warpType(warpType) + , m_alpha(alpha) + , m_transformedCenter(transformedCenter) + , m_originalCenter(originalCenter) + , m_rotationCenterOffset(rotationCenterOffset) + , m_transformAroundRotationCenter(transformAroundRotationCenter) + , m_aX(aX) + , m_aY(aY) + , m_aZ(aZ) + , m_scaleX(scaleX) + , m_scaleY(scaleY) + , m_shearX(shearX) + , m_shearY(shearY) + , m_liquifyProperties(new KisLiquifyProperties()) { - m_mode = mode; - m_transformedCenter = transformedCenter; - m_originalCenter = originalCenter; - m_rotationCenterOffset = rotationCenterOffset; - m_transformAroundRotationCenter = transformAroundRotationCenter; - m_cameraPos = QVector3D(0,0,1024); - m_aX = aX; - m_aY = aY; - m_aZ = aZ; - m_scaleX = scaleX; - m_scaleY = scaleY; - m_shearX = shearX; - m_shearY = shearY; - m_origPoints = QVector(); - m_transfPoints = QVector(); - m_warpType = warpType; - m_alpha = alpha; - m_defaultPoints = defaultPoints; - m_keepAspectRatio = false; setFilterId(filterId); - m_editTransformPoints = false; }