Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cppcheck uninitMemberVar warnings in src/core/ #34135

Merged
merged 4 commits into from
Jan 30, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/core/diagram/qgsdiagram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@

#include <QPainter>

QgsDiagram::QgsDiagram( const QgsDiagram &other )
QgsDiagram::QgsDiagram( const QgsDiagram & ): mExpressions{}
{
Q_UNUSED( other )
// do not copy the cached expression map - the expressions need to be created and prepared with getExpression(...) call
}

Expand Down
17 changes: 5 additions & 12 deletions src/core/effects/qgsgloweffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,8 @@ QgsGlowEffect::QgsGlowEffect()

QgsGlowEffect::QgsGlowEffect( const QgsGlowEffect &other )
: QgsPaintEffect( other )
, mSpread( other.spread() )
, mSpreadUnit( other.spreadUnit() )
, mSpreadMapUnitScale( other.spreadMapUnitScale() )
, mBlurLevel( other.blurLevel() )
, mOpacity( other.opacity() )
, mColor( other.color() )
, mBlendMode( other.blendMode() )
, mColorType( other.colorType() )
{
if ( other.ramp() )
{
mRamp = other.ramp()->clone();
}
operator=( other );
}

QgsGlowEffect::~QgsGlowEffect()
Expand Down Expand Up @@ -214,8 +203,12 @@ QgsGlowEffect &QgsGlowEffect::operator=( const QgsGlowEffect &rhs )
delete mRamp;

mSpread = rhs.spread();
mSpreadUnit = rhs.spreadUnit();
mSpreadMapUnitScale = rhs.spreadMapUnitScale();
mRamp = rhs.ramp() ? rhs.ramp()->clone() : nullptr;
mBlurLevel = rhs.blurLevel();
mBlurUnit = rhs.mBlurUnit;
mBlurMapUnitScale = rhs.mBlurMapUnitScale;
mOpacity = rhs.opacity();
mColor = rhs.color();
mBlendMode = rhs.blendMode();
Expand Down
2 changes: 1 addition & 1 deletion src/core/expression/qgsexpressioncontextutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ class CORE_EXPORT QgsExpressionContextUtils

QList< QPointer< QgsMapLayer > > mLayers;
QMap< QPointer< QgsMapLayer >, QPair< double, double > > mScaleBasedVisibilityDetails;
double mScale;
double mScale = 0.0;

};

Expand Down
2 changes: 1 addition & 1 deletion src/core/mesh/qgsmeshtracerenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ class QgsMeshStreamField
QPoint mFieldTopLeftInDeviceCoordinates;
bool mValid = false;
double mMaximumMagnitude = 0;
double mPixelFillingDensity;
double mPixelFillingDensity = 0;
double mMinMagFilter = -1;
double mMaxMagFilter = -1;
const QgsRenderContext &mRenderContext; //keep the renderer context only to know if the renderer is stopped
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsexpressioncontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ QgsExpressionContext::QgsExpressionContext( const QList<QgsExpressionContextScop
{
}

QgsExpressionContext::QgsExpressionContext( const QgsExpressionContext &other )
QgsExpressionContext::QgsExpressionContext( const QgsExpressionContext &other ) : mStack{}
{
for ( const QgsExpressionContextScope *scope : qgis::as_const( other.mStack ) )
{
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsfeaturerequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ QgsFeatureRequest &QgsFeatureRequest::operator=( const QgsFeatureRequest &rh )
mLimit = rh.mLimit;
mOrderBy = rh.mOrderBy;
mCrs = rh.mCrs;
mTransformContext = rh.mTransformContext;
mTransformErrorCallback = rh.mTransformErrorCallback;
mTimeout = rh.mTimeout;
mRequestMayBeNested = rh.mRequestMayBeNested;
Expand Down