Skip to content

Commit cc1488f

Browse files
committedJun 2, 2020
Many classes: mark assignment operator as deleted due to existence of copy constructor
1 parent 6fd336c commit cc1488f

32 files changed

+308
-196
lines changed
 

‎python/server/auto_generated/qgsaccesscontrol.sip.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Constructor
3838

3939
~QgsAccessControl();
4040

41+
4142
void resolveFilterFeatures( const QList<QgsMapLayer *> &layers );
4243
%Docstring
4344
Resolve features' filter of layers

‎src/3d/symbols/qgspoint3dsymbol.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ class _3D_EXPORT QgsPoint3DSymbol : public QgsAbstract3DSymbol
112112
std::unique_ptr<QgsMarkerSymbol> mBillboardSymbol;
113113
#ifdef SIP_RUN
114114
QgsPoint3DSymbol &operator=( const QgsPoint3DSymbol & );
115+
#else
116+
QgsPoint3DSymbol &operator=( const QgsPoint3DSymbol & ) = delete;
115117
#endif
116118
};
117119

‎src/analysis/vector/geometry_checker/qgsgeometrycheckerutils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ class ANALYSIS_EXPORT QgsGeometryCheckerUtils
180180
QgsFeatureIds::const_iterator mFeatureIt;
181181
const LayerFeatures *mParent = nullptr;
182182
std::unique_ptr<QgsGeometryCheckerUtils::LayerFeature> mCurrentFeature;
183+
184+
iterator &operator= ( const iterator & ) = delete;
183185
};
184186

185187
/**

‎src/app/georeferencer/qgsgeorefdatapoint.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class QgsGeorefDataPoint : public QObject
6868
int mId;
6969
bool mEnabled;
7070
QPointF mResidual;
71+
72+
QgsGeorefDataPoint &operator=( const QgsGeorefDataPoint & ) = delete;
7173
};
7274

7375
#endif //QGSGEOREFDATAPOINT_H

‎src/app/georeferencer/qgsgeoreftransform.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ class QgsGeorefTransform : public QgsGeorefTransformInterface
155155
private:
156156
// shallow copy constructor
157157
QgsGeorefTransform( const QgsGeorefTransform &other );
158+
QgsGeorefTransform &operator= ( const QgsGeorefTransform & ) = delete;
158159

159160
//! Factory function which creates an implementation for the given parametrisation.
160161
static QgsGeorefTransformInterface *createImplementation( TransformParametrisation parametrisation );

‎src/core/expression/qgsexpression_p.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ class QgsExpressionPrivate
8080

8181
//! Whether prepare() has been called before evaluate()
8282
bool mIsPrepared = false;
83+
84+
QgsExpressionPrivate &operator= ( const QgsExpressionPrivate & ) = delete;
8385
};
8486

8587

‎src/core/layertree/qgslayertree.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ class CORE_EXPORT QgsLayerTree : public QgsLayerTreeGroup
228228
void addMissingLayers();
229229
QgsWeakMapLayerPointerList mCustomLayerOrder;
230230
bool mHasCustomLayerOrder = false;
231+
232+
QgsLayerTree &operator= ( const QgsLayerTree & ) = delete;
231233
};
232234

233235
#endif // QGSLAYERTREE_H

‎src/core/layertree/qgslayertreegroup.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ class CORE_EXPORT QgsLayerTreeGroup : public QgsLayerTreeNode
238238
QgsLayerTreeGroup( const QgsLayerTreeGroup &other );
239239
#endif
240240

241+
QgsLayerTreeGroup &operator= ( const QgsLayerTreeGroup & ) = delete;
242+
241243
};
242244

243245

‎src/core/layertree/qgslayertreelayer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ class CORE_EXPORT QgsLayerTreeLayer : public QgsLayerTreeNode
266266
QgsLegendPatchShape mPatchShape;
267267
QSizeF mPatchSize;
268268
LegendNodesSplitBehavior mSplitBehavior = UseDefaultLegendSetting;
269+
270+
QgsLayerTreeLayer &operator=( const QgsLayerTreeLayer & ) = delete;
269271
};
270272

271273

‎src/core/layertree/qgslayertreenode.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ class CORE_EXPORT QgsLayerTreeNode : public QObject
283283
bool mExpanded;
284284
//! custom properties attached to the node
285285
QgsObjectCustomProperties mProperties;
286+
287+
private:
288+
QgsLayerTreeNode &operator=( const QgsLayerTreeNode & ) = delete;
286289
};
287290

288291

‎src/core/pal/feature.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,8 @@ namespace pal
385385

386386
mutable std::size_t mCachedMaxLineCandidates = 0;
387387
mutable std::size_t mCachedMaxPolygonCandidates = 0;
388+
389+
FeaturePart &operator= ( const FeaturePart & ) = delete;
388390
};
389391

390392
} // end namespace pal

‎src/core/pal/labelposition.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ namespace pal
351351
bool isInConflictSinglePart( const LabelPosition *lp ) const;
352352
bool isInConflictMultiPart( const LabelPosition *lp ) const;
353353

354+
LabelPosition &operator=( const LabelPosition & ) = delete;
354355
};
355356

356357
} // end namespace

‎src/core/pal/pointset.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ namespace pal
235235

236236
mutable const GEOSPreparedGeometry *mPreparedGeom = nullptr;
237237

238+
PointSet &operator= ( const PointSet & ) = delete;
239+
238240
};
239241

240242
} // namespace pal

‎src/core/qgscoordinatereferencesystem_p.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,8 @@ class QgsCoordinateReferenceSystemPrivate : public QSharedData
243243
}
244244
#endif
245245

246+
private:
247+
QgsCoordinateReferenceSystemPrivate &operator= ( const QgsCoordinateReferenceSystemPrivate & ) = delete;
246248

247249
};
248250

‎src/core/qgscoordinatetransform_p.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ class QgsCoordinateTransformPrivate : public QSharedData
235235
static std::function< void( const QgsCoordinateReferenceSystem &sourceCrs,
236236
const QgsCoordinateReferenceSystem &destinationCrs,
237237
const QgsDatumTransform::TransformDetails &desiredOperation )> sMissingGridUsedByContextHandler;
238+
239+
QgsCoordinateTransformPrivate &operator= ( const QgsCoordinateTransformPrivate & ) = delete;
238240
};
239241

240242
/// @endcond

‎src/core/qgscoordinatetransformcontext_p.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ class QgsCoordinateTransformContextPrivate : public QSharedData
7878
//! Mutex for making QgsCoordinateTransformContextPrivate thread safe
7979
mutable QReadWriteLock mLock{};
8080

81+
private:
82+
QgsCoordinateTransformContextPrivate &operator= ( const QgsCoordinateTransformContextPrivate & ) = delete;
8183
};
8284

8385

‎src/core/qgsdiagramrenderer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,8 @@ class CORE_EXPORT QgsLinearlyInterpolatedDiagramRenderer : public QgsDiagramRend
932932

933933
//! Stores more settings about how legend for varying size of symbols should be rendered
934934
QgsDataDefinedSizeLegend *mDataDefinedSizeLegend = nullptr;
935+
936+
QgsLinearlyInterpolatedDiagramRenderer &operator=( const QgsLinearlyInterpolatedDiagramRenderer & ) = delete;
935937
};
936938

937939
#endif // QGSDIAGRAMRENDERER_H

‎src/core/qgseditformconfig_p.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ class QgsEditFormConfigPrivate : public QSharedData
9797

9898
QgsFields mFields;
9999

100+
private:
101+
QgsEditFormConfigPrivate &operator= ( const QgsEditFormConfigPrivate & ) = delete;
100102
};
101103

102104

‎src/core/qgsfeature_p.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ class QgsFeaturePrivate : public QSharedData
7676
//! Optional field map for name-based attribute lookups
7777
QgsFields fields;
7878

79+
private:
80+
QgsFeaturePrivate &operator=( const QgsFeaturePrivate & ) = delete;
81+
7982
};
8083

8184
/// @endcond

‎src/core/qgsfield_p.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ class QgsFieldPrivate : public QSharedData
119119
QgsFieldConstraints constraints;
120120

121121
QgsEditorWidgetSetup editorWidgetSetup;
122+
123+
private:
124+
QgsFieldPrivate &operator=( const QgsFieldPrivate & ) = delete;
122125
};
123126

124127
/// @endcond

‎src/core/qgsfields.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,8 @@ class CORE_EXPORT QgsFields
432432
inline const_iterator operator+( difference_type j ) const { return const_iterator( d + j ); }
433433
inline const_iterator operator-( difference_type j ) const { return const_iterator( d - j ); }
434434
inline int operator-( const_iterator j ) const { return int( d - j.d ); } // clazy:exclude=function-args-by-ref
435+
private:
436+
const_iterator &operator= ( const const_iterator & ) = delete;
435437
};
436438
friend class const_iterator;
437439
///@endcond

‎src/core/qgsfields_p.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ class QgsFieldsPrivate : public QSharedData
6161
//! map for quick resolution of name to index
6262
QHash<QString, int> nameToIndex;
6363

64+
private:
65+
QgsFieldsPrivate &operator= ( const QgsFieldsPrivate & ) = delete;
6466
};
6567

6668
/// @endcond

‎src/core/qgsproperty_p.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ class QgsPropertyPrivate : public QSharedData
8383
//! Cached set of referenced columns
8484
mutable QSet< QString > expressionReferencedCols;
8585

86+
private:
87+
QgsPropertyPrivate &operator=( const QgsPropertyPrivate & ) = delete;
8688
};
8789

8890
///@endcond PRIVATE

‎src/core/raster/qgscontrastenhancementfunction.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ class CORE_EXPORT QgsContrastEnhancementFunction
9393
double mMaximumValuePossible = std::numeric_limits< double >::max() SIP_SKIP;
9494
double mMinimumValuePossible = std::numeric_limits< double >::lowest() SIP_SKIP;
9595

96+
private:
97+
QgsContrastEnhancementFunction &operator=( const QgsContrastEnhancementFunction & ) = delete;
9698
};
9799

98100
#endif

‎src/core/textrenderer/qgstextrenderer_p.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ class QgsTextBufferSettingsPrivate : public QSharedData
7777
Qt::PenJoinStyle joinStyle = Qt::RoundJoin;
7878
QPainter::CompositionMode blendMode = QPainter::CompositionMode_SourceOver;
7979
std::unique_ptr< QgsPaintEffect > paintEffect;
80+
81+
private:
82+
QgsTextBufferSettingsPrivate &operator=( const QgsTextBufferSettingsPrivate & ) = delete;
8083
};
8184

8285

@@ -148,6 +151,9 @@ class QgsTextBackgroundSettingsPrivate : public QSharedData
148151
Qt::PenJoinStyle joinStyle = Qt::BevelJoin;
149152
std::unique_ptr< QgsPaintEffect > paintEffect;
150153
std::unique_ptr< QgsMarkerSymbol > markerSymbol;
154+
155+
private:
156+
QgsTextBackgroundSettingsPrivate &operator=( const QgsTextBackgroundSettingsPrivate & ) = delete;
151157
};
152158

153159

@@ -197,6 +203,9 @@ class QgsTextShadowSettingsPrivate : public QSharedData
197203
QColor color;
198204
double opacity = 0.7;
199205
QPainter::CompositionMode blendMode = QPainter::CompositionMode_Multiply;
206+
207+
private:
208+
QgsTextShadowSettingsPrivate &operator=( const QgsTextShadowSettingsPrivate & ) = delete;
200209
};
201210

202211

@@ -232,6 +241,9 @@ class QgsTextMaskSettingsPrivate : public QSharedData
232241
double opacity = 1.0;
233242
std::unique_ptr< QgsPaintEffect > paintEffect;
234243
QgsSymbolLayerReferenceList maskedSymbolLayers;
244+
245+
private:
246+
QgsTextMaskSettingsPrivate &operator=( const QgsTextMaskSettingsPrivate & ) = delete;
235247
};
236248

237249

@@ -279,7 +291,8 @@ class QgsTextSettingsPrivate : public QSharedData
279291
//! Property collection for data defined settings
280292
QgsPropertyCollection mDataDefinedProperties;
281293

282-
294+
private:
295+
QgsTextSettingsPrivate &operator=( const QgsTextSettingsPrivate & ) = delete;
283296
};
284297

285298

‎src/plugins/grass/qtermwidget/CharacterColor.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,6 @@ class ColorEntry
7878
*/
7979
ColorEntry() : transparent(false), fontWeight(UseCurrentFormat) {}
8080

81-
/**
82-
* Sets the color, transparency and boldness of this color to those of @p rhs.
83-
*/
84-
void operator=(const ColorEntry& rhs)
85-
{
86-
color = rhs.color;
87-
transparent = rhs.transparent;
88-
fontWeight = rhs.fontWeight;
89-
}
90-
9181
/** The color value of this entry for display. */
9282
QColor color;
9383

‎src/plugins/grass/qtermwidget/ColorScheme.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ class ColorScheme
200200
static const char* const translatedColorNames[TABLE_COLORS];
201201

202202
static const ColorEntry defaultTable[]; // table of default color entries
203+
204+
ColorScheme& operator=(const ColorScheme&) = delete;
203205
};
204206

205207
/**

‎src/providers/oracle/ocispatial/qsql_ocispatial.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static QString qOraWarn( OCIError *err, int *errorCode = nullptr );
152152
#ifndef Q_CC_SUN
153153
static // for some reason, Sun CC can't use qOraWarning when it's declared static
154154
#endif
155-
void qOraWarningAt( const char *msg, OCIError *err, const char *file, const char *function, int line );
155+
void qOraWarningAt( const char *msg, OCIError *err, const char *function, const char *file, int line );
156156
static QSqlError qMakeError( const QString &errString, QSqlError::ErrorType type, OCIError *err );
157157

158158
#ifndef _MSC_VER
@@ -309,6 +309,7 @@ class QOCISpatialRowId: public QSharedData
309309

310310
private:
311311
QOCISpatialRowId( const QOCISpatialRowId &other ): QSharedData( other ) { Q_ASSERT( false ); }
312+
QOCISpatialRowId &operator= ( const QOCISpatialRowId & ) = delete;
312313
};
313314

314315
QOCISpatialRowId::QOCISpatialRowId( OCIEnv *env )

‎src/providers/oracle/qgsoracleprovider.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ class QgsOracleProvider final: public QgsVectorDataProvider
313313

314314
private:
315315
QString mWhat;
316+
317+
OracleException &operator= ( const OracleException & ) = delete;
316318
};
317319

318320
// A function that determines if the given schema.table.column

‎src/providers/wcs/qgswcscapabilities.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,8 @@ class QgsWcsCapabilities : public QObject
385385

386386
//! Cache load control
387387
QNetworkRequest::CacheLoadControl mCacheLoadControl = QNetworkRequest::PreferNetwork;
388+
389+
QgsWcsCapabilities &operator=( const QgsWcsCapabilities & ) = delete;
388390
};
389391

390392

‎src/server/qgsaccesscontrol.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,19 @@ class SERVER_EXPORT QgsAccessControl : public QgsFeatureFilterProvider
6161
delete mPluginsAccessControls;
6262
}
6363

64+
//! Assignment operator
65+
QgsAccessControl &operator= ( const QgsAccessControl &other )
66+
{
67+
if ( this != &other )
68+
{
69+
delete mPluginsAccessControls;
70+
mPluginsAccessControls = new QgsAccessControlFilterMap( *other.mPluginsAccessControls );
71+
mFilterFeaturesExpressions = other.mFilterFeaturesExpressions;
72+
mResolved = other.mResolved;
73+
}
74+
return *this;
75+
}
76+
6477
/**
6578
* Resolve features' filter of layers
6679
* \param layers to filter

‎tests/src/core/testqgslabelingengine.cpp

Lines changed: 225 additions & 184 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.