Skip to content

Commit

Permalink
Many classes: mark assignment operator as deleted due to existence of…
Browse files Browse the repository at this point in the history
… copy constructor
  • Loading branch information
rouault committed Jun 2, 2020
1 parent 6fd336c commit cc1488f
Show file tree
Hide file tree
Showing 32 changed files with 308 additions and 196 deletions.
1 change: 1 addition & 0 deletions python/server/auto_generated/qgsaccesscontrol.sip.in
Expand Up @@ -38,6 +38,7 @@ Constructor

~QgsAccessControl();


void resolveFilterFeatures( const QList<QgsMapLayer *> &layers );
%Docstring
Resolve features' filter of layers
Expand Down
2 changes: 2 additions & 0 deletions src/3d/symbols/qgspoint3dsymbol.h
Expand Up @@ -112,6 +112,8 @@ class _3D_EXPORT QgsPoint3DSymbol : public QgsAbstract3DSymbol
std::unique_ptr<QgsMarkerSymbol> mBillboardSymbol;
#ifdef SIP_RUN
QgsPoint3DSymbol &operator=( const QgsPoint3DSymbol & );
#else
QgsPoint3DSymbol &operator=( const QgsPoint3DSymbol & ) = delete;
#endif
};

Expand Down
Expand Up @@ -180,6 +180,8 @@ class ANALYSIS_EXPORT QgsGeometryCheckerUtils
QgsFeatureIds::const_iterator mFeatureIt;
const LayerFeatures *mParent = nullptr;
std::unique_ptr<QgsGeometryCheckerUtils::LayerFeature> mCurrentFeature;

iterator &operator= ( const iterator & ) = delete;
};

/**
Expand Down
2 changes: 2 additions & 0 deletions src/app/georeferencer/qgsgeorefdatapoint.h
Expand Up @@ -68,6 +68,8 @@ class QgsGeorefDataPoint : public QObject
int mId;
bool mEnabled;
QPointF mResidual;

QgsGeorefDataPoint &operator=( const QgsGeorefDataPoint & ) = delete;
};

#endif //QGSGEOREFDATAPOINT_H
1 change: 1 addition & 0 deletions src/app/georeferencer/qgsgeoreftransform.h
Expand Up @@ -155,6 +155,7 @@ class QgsGeorefTransform : public QgsGeorefTransformInterface
private:
// shallow copy constructor
QgsGeorefTransform( const QgsGeorefTransform &other );
QgsGeorefTransform &operator= ( const QgsGeorefTransform & ) = delete;

//! Factory function which creates an implementation for the given parametrisation.
static QgsGeorefTransformInterface *createImplementation( TransformParametrisation parametrisation );
Expand Down
2 changes: 2 additions & 0 deletions src/core/expression/qgsexpression_p.h
Expand Up @@ -80,6 +80,8 @@ class QgsExpressionPrivate

//! Whether prepare() has been called before evaluate()
bool mIsPrepared = false;

QgsExpressionPrivate &operator= ( const QgsExpressionPrivate & ) = delete;
};


Expand Down
2 changes: 2 additions & 0 deletions src/core/layertree/qgslayertree.h
Expand Up @@ -228,6 +228,8 @@ class CORE_EXPORT QgsLayerTree : public QgsLayerTreeGroup
void addMissingLayers();
QgsWeakMapLayerPointerList mCustomLayerOrder;
bool mHasCustomLayerOrder = false;

QgsLayerTree &operator= ( const QgsLayerTree & ) = delete;
};

#endif // QGSLAYERTREE_H
2 changes: 2 additions & 0 deletions src/core/layertree/qgslayertreegroup.h
Expand Up @@ -238,6 +238,8 @@ class CORE_EXPORT QgsLayerTreeGroup : public QgsLayerTreeNode
QgsLayerTreeGroup( const QgsLayerTreeGroup &other );
#endif

QgsLayerTreeGroup &operator= ( const QgsLayerTreeGroup & ) = delete;

};


Expand Down
2 changes: 2 additions & 0 deletions src/core/layertree/qgslayertreelayer.h
Expand Up @@ -266,6 +266,8 @@ class CORE_EXPORT QgsLayerTreeLayer : public QgsLayerTreeNode
QgsLegendPatchShape mPatchShape;
QSizeF mPatchSize;
LegendNodesSplitBehavior mSplitBehavior = UseDefaultLegendSetting;

QgsLayerTreeLayer &operator=( const QgsLayerTreeLayer & ) = delete;
};


Expand Down
3 changes: 3 additions & 0 deletions src/core/layertree/qgslayertreenode.h
Expand Up @@ -283,6 +283,9 @@ class CORE_EXPORT QgsLayerTreeNode : public QObject
bool mExpanded;
//! custom properties attached to the node
QgsObjectCustomProperties mProperties;

private:
QgsLayerTreeNode &operator=( const QgsLayerTreeNode & ) = delete;
};


Expand Down
2 changes: 2 additions & 0 deletions src/core/pal/feature.h
Expand Up @@ -385,6 +385,8 @@ namespace pal

mutable std::size_t mCachedMaxLineCandidates = 0;
mutable std::size_t mCachedMaxPolygonCandidates = 0;

FeaturePart &operator= ( const FeaturePart & ) = delete;
};

} // end namespace pal
Expand Down
1 change: 1 addition & 0 deletions src/core/pal/labelposition.h
Expand Up @@ -351,6 +351,7 @@ namespace pal
bool isInConflictSinglePart( const LabelPosition *lp ) const;
bool isInConflictMultiPart( const LabelPosition *lp ) const;

LabelPosition &operator=( const LabelPosition & ) = delete;
};

} // end namespace
Expand Down
2 changes: 2 additions & 0 deletions src/core/pal/pointset.h
Expand Up @@ -235,6 +235,8 @@ namespace pal

mutable const GEOSPreparedGeometry *mPreparedGeom = nullptr;

PointSet &operator= ( const PointSet & ) = delete;

};

} // namespace pal
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgscoordinatereferencesystem_p.h
Expand Up @@ -243,6 +243,8 @@ class QgsCoordinateReferenceSystemPrivate : public QSharedData
}
#endif

private:
QgsCoordinateReferenceSystemPrivate &operator= ( const QgsCoordinateReferenceSystemPrivate & ) = delete;

};

Expand Down
2 changes: 2 additions & 0 deletions src/core/qgscoordinatetransform_p.h
Expand Up @@ -235,6 +235,8 @@ class QgsCoordinateTransformPrivate : public QSharedData
static std::function< void( const QgsCoordinateReferenceSystem &sourceCrs,
const QgsCoordinateReferenceSystem &destinationCrs,
const QgsDatumTransform::TransformDetails &desiredOperation )> sMissingGridUsedByContextHandler;

QgsCoordinateTransformPrivate &operator= ( const QgsCoordinateTransformPrivate & ) = delete;
};

/// @endcond
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgscoordinatetransformcontext_p.h
Expand Up @@ -78,6 +78,8 @@ class QgsCoordinateTransformContextPrivate : public QSharedData
//! Mutex for making QgsCoordinateTransformContextPrivate thread safe
mutable QReadWriteLock mLock{};

private:
QgsCoordinateTransformContextPrivate &operator= ( const QgsCoordinateTransformContextPrivate & ) = delete;
};


Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsdiagramrenderer.h
Expand Up @@ -932,6 +932,8 @@ class CORE_EXPORT QgsLinearlyInterpolatedDiagramRenderer : public QgsDiagramRend

//! Stores more settings about how legend for varying size of symbols should be rendered
QgsDataDefinedSizeLegend *mDataDefinedSizeLegend = nullptr;

QgsLinearlyInterpolatedDiagramRenderer &operator=( const QgsLinearlyInterpolatedDiagramRenderer & ) = delete;
};

#endif // QGSDIAGRAMRENDERER_H
2 changes: 2 additions & 0 deletions src/core/qgseditformconfig_p.h
Expand Up @@ -97,6 +97,8 @@ class QgsEditFormConfigPrivate : public QSharedData

QgsFields mFields;

private:
QgsEditFormConfigPrivate &operator= ( const QgsEditFormConfigPrivate & ) = delete;
};


Expand Down
3 changes: 3 additions & 0 deletions src/core/qgsfeature_p.h
Expand Up @@ -76,6 +76,9 @@ class QgsFeaturePrivate : public QSharedData
//! Optional field map for name-based attribute lookups
QgsFields fields;

private:
QgsFeaturePrivate &operator=( const QgsFeaturePrivate & ) = delete;

};

/// @endcond
Expand Down
3 changes: 3 additions & 0 deletions src/core/qgsfield_p.h
Expand Up @@ -119,6 +119,9 @@ class QgsFieldPrivate : public QSharedData
QgsFieldConstraints constraints;

QgsEditorWidgetSetup editorWidgetSetup;

private:
QgsFieldPrivate &operator=( const QgsFieldPrivate & ) = delete;
};

/// @endcond
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsfields.h
Expand Up @@ -432,6 +432,8 @@ class CORE_EXPORT QgsFields
inline const_iterator operator+( difference_type j ) const { return const_iterator( d + j ); }
inline const_iterator operator-( difference_type j ) const { return const_iterator( d - j ); }
inline int operator-( const_iterator j ) const { return int( d - j.d ); } // clazy:exclude=function-args-by-ref
private:
const_iterator &operator= ( const const_iterator & ) = delete;
};
friend class const_iterator;
///@endcond
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsfields_p.h
Expand Up @@ -61,6 +61,8 @@ class QgsFieldsPrivate : public QSharedData
//! map for quick resolution of name to index
QHash<QString, int> nameToIndex;

private:
QgsFieldsPrivate &operator= ( const QgsFieldsPrivate & ) = delete;
};

/// @endcond
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsproperty_p.h
Expand Up @@ -83,6 +83,8 @@ class QgsPropertyPrivate : public QSharedData
//! Cached set of referenced columns
mutable QSet< QString > expressionReferencedCols;

private:
QgsPropertyPrivate &operator=( const QgsPropertyPrivate & ) = delete;
};

///@endcond PRIVATE
Expand Down
2 changes: 2 additions & 0 deletions src/core/raster/qgscontrastenhancementfunction.h
Expand Up @@ -93,6 +93,8 @@ class CORE_EXPORT QgsContrastEnhancementFunction
double mMaximumValuePossible = std::numeric_limits< double >::max() SIP_SKIP;
double mMinimumValuePossible = std::numeric_limits< double >::lowest() SIP_SKIP;

private:
QgsContrastEnhancementFunction &operator=( const QgsContrastEnhancementFunction & ) = delete;
};

#endif
15 changes: 14 additions & 1 deletion src/core/textrenderer/qgstextrenderer_p.h
Expand Up @@ -77,6 +77,9 @@ class QgsTextBufferSettingsPrivate : public QSharedData
Qt::PenJoinStyle joinStyle = Qt::RoundJoin;
QPainter::CompositionMode blendMode = QPainter::CompositionMode_SourceOver;
std::unique_ptr< QgsPaintEffect > paintEffect;

private:
QgsTextBufferSettingsPrivate &operator=( const QgsTextBufferSettingsPrivate & ) = delete;
};


Expand Down Expand Up @@ -148,6 +151,9 @@ class QgsTextBackgroundSettingsPrivate : public QSharedData
Qt::PenJoinStyle joinStyle = Qt::BevelJoin;
std::unique_ptr< QgsPaintEffect > paintEffect;
std::unique_ptr< QgsMarkerSymbol > markerSymbol;

private:
QgsTextBackgroundSettingsPrivate &operator=( const QgsTextBackgroundSettingsPrivate & ) = delete;
};


Expand Down Expand Up @@ -197,6 +203,9 @@ class QgsTextShadowSettingsPrivate : public QSharedData
QColor color;
double opacity = 0.7;
QPainter::CompositionMode blendMode = QPainter::CompositionMode_Multiply;

private:
QgsTextShadowSettingsPrivate &operator=( const QgsTextShadowSettingsPrivate & ) = delete;
};


Expand Down Expand Up @@ -232,6 +241,9 @@ class QgsTextMaskSettingsPrivate : public QSharedData
double opacity = 1.0;
std::unique_ptr< QgsPaintEffect > paintEffect;
QgsSymbolLayerReferenceList maskedSymbolLayers;

private:
QgsTextMaskSettingsPrivate &operator=( const QgsTextMaskSettingsPrivate & ) = delete;
};


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


private:
QgsTextSettingsPrivate &operator=( const QgsTextSettingsPrivate & ) = delete;
};


Expand Down
10 changes: 0 additions & 10 deletions src/plugins/grass/qtermwidget/CharacterColor.h
Expand Up @@ -78,16 +78,6 @@ class ColorEntry
*/
ColorEntry() : transparent(false), fontWeight(UseCurrentFormat) {}

/**
* Sets the color, transparency and boldness of this color to those of @p rhs.
*/
void operator=(const ColorEntry& rhs)
{
color = rhs.color;
transparent = rhs.transparent;
fontWeight = rhs.fontWeight;
}

/** The color value of this entry for display. */
QColor color;

Expand Down
2 changes: 2 additions & 0 deletions src/plugins/grass/qtermwidget/ColorScheme.h
Expand Up @@ -200,6 +200,8 @@ class ColorScheme
static const char* const translatedColorNames[TABLE_COLORS];

static const ColorEntry defaultTable[]; // table of default color entries

ColorScheme& operator=(const ColorScheme&) = delete;
};

/**
Expand Down
3 changes: 2 additions & 1 deletion src/providers/oracle/ocispatial/qsql_ocispatial.cpp
Expand Up @@ -152,7 +152,7 @@ static QString qOraWarn( OCIError *err, int *errorCode = nullptr );
#ifndef Q_CC_SUN
static // for some reason, Sun CC can't use qOraWarning when it's declared static
#endif
void qOraWarningAt( const char *msg, OCIError *err, const char *file, const char *function, int line );
void qOraWarningAt( const char *msg, OCIError *err, const char *function, const char *file, int line );
static QSqlError qMakeError( const QString &errString, QSqlError::ErrorType type, OCIError *err );

#ifndef _MSC_VER
Expand Down Expand Up @@ -309,6 +309,7 @@ class QOCISpatialRowId: public QSharedData

private:
QOCISpatialRowId( const QOCISpatialRowId &other ): QSharedData( other ) { Q_ASSERT( false ); }
QOCISpatialRowId &operator= ( const QOCISpatialRowId & ) = delete;
};

QOCISpatialRowId::QOCISpatialRowId( OCIEnv *env )
Expand Down
2 changes: 2 additions & 0 deletions src/providers/oracle/qgsoracleprovider.h
Expand Up @@ -313,6 +313,8 @@ class QgsOracleProvider final: public QgsVectorDataProvider

private:
QString mWhat;

OracleException &operator= ( const OracleException & ) = delete;
};

// A function that determines if the given schema.table.column
Expand Down
2 changes: 2 additions & 0 deletions src/providers/wcs/qgswcscapabilities.h
Expand Up @@ -385,6 +385,8 @@ class QgsWcsCapabilities : public QObject

//! Cache load control
QNetworkRequest::CacheLoadControl mCacheLoadControl = QNetworkRequest::PreferNetwork;

QgsWcsCapabilities &operator=( const QgsWcsCapabilities & ) = delete;
};


Expand Down
13 changes: 13 additions & 0 deletions src/server/qgsaccesscontrol.h
Expand Up @@ -61,6 +61,19 @@ class SERVER_EXPORT QgsAccessControl : public QgsFeatureFilterProvider
delete mPluginsAccessControls;
}

//! Assignment operator
QgsAccessControl &operator= ( const QgsAccessControl &other )
{
if ( this != &other )
{
delete mPluginsAccessControls;
mPluginsAccessControls = new QgsAccessControlFilterMap( *other.mPluginsAccessControls );
mFilterFeaturesExpressions = other.mFilterFeaturesExpressions;
mResolved = other.mResolved;
}
return *this;
}

/**
* Resolve features' filter of layers
* \param layers to filter
Expand Down

0 comments on commit cc1488f

Please sign in to comment.