Commit 06c60f2b authored by Tusooa Zhu's avatar Tusooa Zhu 🅱

Explicitly initialize QSharedData in flake private classes

parent 32b563fa
......@@ -30,14 +30,17 @@
struct Q_DECL_HIDDEN KoClipMask::Private : public QSharedData
{
Private() {}
Private()
: QSharedData()
{}
Private(const Private &rhs)
: coordinates(rhs.coordinates),
contentCoordinates(rhs.contentCoordinates),
maskRect(rhs.maskRect),
extraShapeTransform(rhs.extraShapeTransform)
: QSharedData()
, coordinates(rhs.coordinates)
, contentCoordinates(rhs.contentCoordinates)
, maskRect(rhs.maskRect)
, extraShapeTransform(rhs.extraShapeTransform)
{
// XXX: Use KisDescendent<KoShape> instead of this
Q_FOREACH (KoShape *shape, rhs.shapes) {
KoShape *clonedShape = shape->cloneShape();
KIS_ASSERT_RECOVER(clonedShape) { continue; }
......
......@@ -49,14 +49,16 @@ class Q_DECL_HIDDEN KoClipPath::Private : public QSharedData
{
public:
Private()
: QSharedData()
{}
Private(const Private &rhs)
: clipPath(rhs.clipPath),
clipRule(rhs.clipRule),
coordinates(rhs.coordinates),
initialTransformToShape(rhs.initialTransformToShape),
initialShapeSize(rhs.initialShapeSize)
: QSharedData()
, clipPath(rhs.clipPath)
, clipRule(rhs.clipRule)
, coordinates(rhs.coordinates)
, initialTransformToShape(rhs.initialTransformToShape)
, initialShapeSize(rhs.initialShapeSize)
{
Q_FOREACH (KoShape *shape, rhs.shapes) {
KoShape *clonedShape = shape->cloneShape();
......
......@@ -39,26 +39,26 @@
KoConnectionShape::Private::Private()
: QSharedData()
, shape1(0),
shape2(0),
connectionPointId1(-1),
connectionPointId2(-1),
connectionType(KoConnectionShape::Standard),
forceUpdate(false),
hasCustomPath(false)
, shape1(0)
, shape2(0)
, connectionPointId1(-1)
, connectionPointId2(-1)
, connectionType(KoConnectionShape::Standard)
, forceUpdate(false)
, hasCustomPath(false)
{
}
KoConnectionShape::Private::Private(const KoConnectionShape::Private &rhs)
: QSharedData()
, path(rhs.path),
shape1(0), // FIXME: it should point to the new shapes!!!
shape2(0), // FIXME: it should point to the new shapes!!!
connectionPointId1(rhs.connectionPointId1),
connectionPointId2(rhs.connectionPointId2),
connectionType(rhs.connectionType),
forceUpdate(rhs.forceUpdate),
hasCustomPath(rhs.hasCustomPath)
, path(rhs.path)
, shape1(0) // FIXME: it should point to the new shapes!!!
, shape2(0) // FIXME: it should point to the new shapes!!!
, connectionPointId1(rhs.connectionPointId1)
, connectionPointId2(rhs.connectionPointId2)
, connectionType(rhs.connectionType)
, forceUpdate(rhs.forceUpdate)
, hasCustomPath(rhs.hasCustomPath)
{
}
......
......@@ -29,11 +29,13 @@ class KoSelection::Private : public QSharedData
{
public:
explicit Private()
: activeLayer(0)
: QSharedData()
, activeLayer(0)
, selectionChangedCompressor(1, KisSignalCompressor::FIRST_INACTIVE)
{}
explicit Private(const Private &)
: activeLayer(0)
: QSharedData()
, activeLayer(0)
, selectionChangedCompressor(1, KisSignalCompressor::FIRST_INACTIVE)
{
}
......
......@@ -80,28 +80,29 @@
// KoShape::Private
KoShape::Private::Private()
: size(50, 50),
parent(0),
shadow(0),
border(0),
filterEffectStack(0),
transparency(0.0),
zIndex(0),
runThrough(0),
visible(true),
printable(true),
geometryProtected(false),
keepAspect(false),
selectable(true),
detectCollision(false),
protectContent(false),
textRunAroundSide(KoShape::BiggestRunAroundSide),
textRunAroundDistanceLeft(0.0),
textRunAroundDistanceTop(0.0),
textRunAroundDistanceRight(0.0),
textRunAroundDistanceBottom(0.0),
textRunAroundThreshold(0.0),
textRunAroundContour(KoShape::ContourFull)
: QSharedData()
, size(50, 50)
, parent(0)
, shadow(0)
, border(0)
, filterEffectStack(0)
, transparency(0.0)
, zIndex(0)
, runThrough(0)
, visible(true)
, printable(true)
, geometryProtected(false)
, keepAspect(false)
, selectable(true)
, detectCollision(false)
, protectContent(false)
, textRunAroundSide(KoShape::BiggestRunAroundSide)
, textRunAroundDistanceLeft(0.0)
, textRunAroundDistanceTop(0.0)
, textRunAroundDistanceRight(0.0)
, textRunAroundDistanceBottom(0.0)
, textRunAroundThreshold(0.0)
, textRunAroundContour(KoShape::ContourFull)
{
connectors[KoConnectionPoint::TopConnectionPoint] = KoConnectionPoint::defaultConnectionPoint(KoConnectionPoint::TopConnectionPoint);
connectors[KoConnectionPoint::RightConnectionPoint] = KoConnectionPoint::defaultConnectionPoint(KoConnectionPoint::RightConnectionPoint);
......@@ -112,47 +113,47 @@ KoShape::Private::Private()
KoShape::Private::Private(const Private &rhs)
: QSharedData()
, size(rhs.size),
shapeId(rhs.shapeId),
name(rhs.name),
localMatrix(rhs.localMatrix),
connectors(rhs.connectors),
parent(0), // to be initialized later
shapeManagers(), // to be initialized later
toolDelegates(), // FIXME: how to initialize them?
userData(rhs.userData ? rhs.userData->clone() : 0),
stroke(rhs.stroke),
fill(rhs.fill),
inheritBackground(rhs.inheritBackground),
inheritStroke(rhs.inheritStroke),
dependees(), // FIXME: how to initialize them?
shadow(0), // WARNING: not implemented in Krita
border(0), // WARNING: not implemented in Krita
clipPath(rhs.clipPath ? rhs.clipPath->clone() : 0),
clipMask(rhs.clipMask ? rhs.clipMask->clone() : 0),
additionalAttributes(rhs.additionalAttributes),
additionalStyleAttributes(rhs.additionalStyleAttributes),
filterEffectStack(0), // WARNING: not implemented in Krita
transparency(rhs.transparency),
hyperLink(rhs.hyperLink),
zIndex(rhs.zIndex),
runThrough(rhs.runThrough),
visible(rhs.visible),
printable(rhs.visible),
geometryProtected(rhs.geometryProtected),
keepAspect(rhs.keepAspect),
selectable(rhs.selectable),
detectCollision(rhs.detectCollision),
protectContent(rhs.protectContent),
textRunAroundSide(rhs.textRunAroundSide),
textRunAroundDistanceLeft(rhs.textRunAroundDistanceLeft),
textRunAroundDistanceTop(rhs.textRunAroundDistanceTop),
textRunAroundDistanceRight(rhs.textRunAroundDistanceRight),
textRunAroundDistanceBottom(rhs.textRunAroundDistanceBottom),
textRunAroundThreshold(rhs.textRunAroundThreshold),
textRunAroundContour(rhs.textRunAroundContour)
, size(rhs.size)
, shapeId(rhs.shapeId)
, name(rhs.name)
, localMatrix(rhs.localMatrix)
, connectors(rhs.connectors)
, parent(0) // to be initialized later
, shapeManagers() // to be initialized later
, toolDelegates() // FIXME: how to initialize them?
, userData(rhs.userData ? rhs.userData->clone() : 0)
, stroke(rhs.stroke)
, fill(rhs.fill)
, inheritBackground(rhs.inheritBackground)
, inheritStroke(rhs.inheritStroke)
, dependees() // FIXME: how to initialize them?
, shadow(0) // WARNING: not implemented in Krita
, border(0) // WARNING: not implemented in Krita
, clipPath(rhs.clipPath ? rhs.clipPath->clone() : 0)
, clipMask(rhs.clipMask ? rhs.clipMask->clone() : 0)
, additionalAttributes(rhs.additionalAttributes)
, additionalStyleAttributes(rhs.additionalStyleAttributes)
, filterEffectStack(0) // WARNING: not implemented in Krita
, transparency(rhs.transparency)
, hyperLink(rhs.hyperLink)
, zIndex(rhs.zIndex)
, runThrough(rhs.runThrough)
, visible(rhs.visible)
, printable(rhs.visible)
, geometryProtected(rhs.geometryProtected)
, keepAspect(rhs.keepAspect)
, selectable(rhs.selectable)
, detectCollision(rhs.detectCollision)
, protectContent(rhs.protectContent)
, textRunAroundSide(rhs.textRunAroundSide)
, textRunAroundDistanceLeft(rhs.textRunAroundDistanceLeft)
, textRunAroundDistanceTop(rhs.textRunAroundDistanceTop)
, textRunAroundDistanceRight(rhs.textRunAroundDistanceRight)
, textRunAroundDistanceBottom(rhs.textRunAroundDistanceBottom)
, textRunAroundThreshold(rhs.textRunAroundThreshold)
, textRunAroundContour(rhs.textRunAroundContour)
{
}
......
......@@ -33,8 +33,8 @@
#include "kis_assert.h"
KoShapeContainer::Private::Private(KoShapeContainer *q)
: shapeInterface(q),
model(0)
: shapeInterface(q)
, model(0)
{
}
......
......@@ -22,14 +22,12 @@
#include "KoShapeContainer.h"
#include "kritaflake_export.h"
#include <QSharedData>
class KoShapeContainerModel;
/**
* \internal used private d-pointer class for the \a KoShapeContainer class.
*/
class KRITAFLAKE_EXPORT KoShapeContainer::Private : public QSharedData
class KRITAFLAKE_EXPORT KoShapeContainer::Private
{
public:
explicit Private(KoShapeContainer *q);
......
......@@ -38,12 +38,14 @@
#include <QTextDocument>
KoTosContainer::Private::Private()
: resizeBehavior(KoTosContainer::IndependentSizes)
: QSharedData()
, resizeBehavior(KoTosContainer::IndependentSizes)
{
}
KoTosContainer::Private::Private(const Private &rhs)
: resizeBehavior(rhs.resizeBehavior)
: QSharedData()
, resizeBehavior(rhs.resizeBehavior)
, preferredTextRect(rhs.preferredTextRect)
, alignment(rhs.alignment)
{
......
......@@ -856,14 +856,15 @@ KoSvgTextChunkShape::Private::Private()
}
KoSvgTextChunkShape::Private::Private(const Private &rhs)
: properties(rhs.properties),
font(rhs.font),
fontFamiliesList(rhs.fontFamiliesList),
localTransformations(rhs.localTransformations),
textLength(rhs.textLength),
lengthAdjust(rhs.lengthAdjust),
text(rhs.text),
isRichTextPreferred(rhs.isRichTextPreferred)
: QSharedData()
, properties(rhs.properties)
, font(rhs.font)
, fontFamiliesList(rhs.fontFamiliesList)
, localTransformations(rhs.localTransformations)
, textLength(rhs.textLength)
, lengthAdjust(rhs.lengthAdjust)
, text(rhs.text)
, isRichTextPreferred(rhs.isRichTextPreferred)
{
}
......
......@@ -33,7 +33,7 @@
class Q_DECL_HIDDEN KoTableColumnAndRowStyleManager::Private : public QSharedData
{
public:
Private() { }
Private() : QSharedData() { }
~Private() {
}
QVector<KoTableColumnStyle> tableColumnStyles;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment