Skip to content

Commit 3272964

Browse files
committed
Fix classes which violate the rule-of-three
(identified using clazy analyser)
1 parent 12a7bb3 commit 3272964

18 files changed

+64
-9
lines changed

python/core/raster/qgsrasterprojector.sip

+1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ class QgsRasterProjector : QgsRasterInterface
5858
static bool extentSize( const QgsCoordinateTransform& ct,
5959
const QgsRectangle& theSrcExtent, int theSrcXSize, int theSrcYSize,
6060
QgsRectangle& theDestExtent, int& theDestXSize, int& theDestYSize );
61+
6162
};

python/gui/layertree/qgslayertreeembeddedwidgetregistry.sip

+4
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,8 @@ class QgsLayerTreeEmbeddedWidgetRegistry
6969
protected:
7070
//! Protected constructor - use instance() to access the registry.
7171
QgsLayerTreeEmbeddedWidgetRegistry();
72+
73+
private:
74+
75+
QgsLayerTreeEmbeddedWidgetRegistry( const QgsLayerTreeEmbeddedWidgetRegistry& other );
7276
};

src/analysis/openstreetmap/qgsosmdatabase.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class ANALYSIS_EXPORT QgsOSMDatabase
129129
* Encapsulate iteration over table of nodes/
130130
* @note not available in Python bindings
131131
*/
132-
class ANALYSIS_EXPORT QgsOSMNodeIterator
132+
class ANALYSIS_EXPORT QgsOSMNodeIterator // clazy:exclude=rule-of-three
133133
{
134134
public:
135135
~QgsOSMNodeIterator();
@@ -145,6 +145,7 @@ class ANALYSIS_EXPORT QgsOSMNodeIterator
145145
sqlite3_stmt* mStmt;
146146

147147
friend class QgsOSMDatabase;
148+
148149
};
149150

150151

@@ -153,7 +154,7 @@ class ANALYSIS_EXPORT QgsOSMNodeIterator
153154
* Encapsulate iteration over table of ways
154155
* @note not available in Python bindings
155156
*/
156-
class ANALYSIS_EXPORT QgsOSMWayIterator
157+
class ANALYSIS_EXPORT QgsOSMWayIterator // clazy:exclude=rule-of-three
157158
{
158159
public:
159160
~QgsOSMWayIterator();
@@ -168,9 +169,8 @@ class ANALYSIS_EXPORT QgsOSMWayIterator
168169

169170
sqlite3_stmt* mStmt;
170171

171-
private:
172-
173172
friend class QgsOSMDatabase;
173+
174174
};
175175

176176

src/core/pal/pal.h

+6
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,12 @@ namespace pal
322322
* @return maximum # of iteration
323323
*/
324324
int getMaxIt();
325+
326+
private:
327+
328+
Pal( const Pal& other );
329+
Pal& operator=( const Pal& other );
330+
325331
};
326332

327333
} // end namespace pal

src/core/pal/palstat.h

+2
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ namespace pal
9696
int *layersNbLabelledObjects; // [nbLayers]
9797

9898
PalStat();
99+
PalStat( const PalStat& other );
100+
PalStat& operator=( const PalStat& other );
99101
};
100102

101103
} // end namespace pal

src/core/pal/problem.h

+3
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ namespace pal
175175

176176
private:
177177

178+
Problem( const Problem& other );
179+
Problem& operator=( const Problem& other );
180+
178181
/**
179182
* How many layers are labelled ?
180183
*/

src/core/pal/rtree.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,11 @@ namespace pal
444444
ASSERT( m_file );
445445
return fread( static_cast< void* >( a_array ), sizeof( TYPE ) * a_count, 1, m_file );
446446
}
447+
448+
private:
449+
450+
RTFileStream( const RTFileStream& other );
451+
RTFileStream& operator=( const RTFileStream& other );
447452
};
448453

449454

src/core/qgis.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class CORE_EXPORT Qgis
135135
* @note not available in Python bindings
136136
*/
137137
// based on Boojum's code from http://stackoverflow.com/questions/3556687/prevent-firing-signals-in-qt
138-
template<class Object> class QgsSignalBlocker
138+
template<class Object> class QgsSignalBlocker // clazy:exclude=rule-of-three
139139
{
140140
public:
141141

src/core/qgsconnectionpool.h

+6
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ class QgsConnectionPoolGroup
213213
QMutex connMutex;
214214
QSemaphore sem;
215215
QTimer* expirationTimer;
216+
217+
private:
218+
219+
QgsConnectionPoolGroup( const QgsConnectionPoolGroup& other );
220+
QgsConnectionPoolGroup& operator=( const QgsConnectionPoolGroup& other );
221+
216222
};
217223

218224

src/core/qgsgml.h

+3
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ class CORE_EXPORT QgsGmlStreamingParser
131131

132132
private:
133133

134+
QgsGmlStreamingParser( const QgsGmlStreamingParser& other );
135+
QgsGmlStreamingParser& operator=( const QgsGmlStreamingParser& other );
136+
134137
enum ParseMode
135138
{
136139
none,

src/core/qgslogger.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class CORE_EXPORT QgsLogger
112112

113113
/** \ingroup core
114114
*/
115-
class QgsScopeLogger
115+
class QgsScopeLogger // clazy:exclude=rule-of-three
116116
{
117117
public:
118118
QgsScopeLogger( const char* file, const char* func, int line )

src/core/raster/qgsrasterprojector.h

+3
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ class ProjectorData
134134
int srcCols() const { return mSrcCols; }
135135

136136
private:
137+
ProjectorData( const ProjectorData& other );
138+
ProjectorData& operator=( const ProjectorData& other );
139+
137140
/** \brief get destination point for _current_ destination position */
138141
void destPointOnCPMatrix( int theRow, int theCol, double *theX, double *theY );
139142

src/core/simplify/effectivearea.h

+6
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ struct EFFECTIVE_AREAS
9090
QgsPointSequence inpts;
9191
areanode *initial_arealist;
9292
double *res_arealist;
93+
94+
private:
95+
96+
EFFECTIVE_AREAS( const EFFECTIVE_AREAS& other );
97+
EFFECTIVE_AREAS& operator=( const EFFECTIVE_AREAS& other );
98+
9399
};
94100

95101
void ptarray_calc_areas( EFFECTIVE_AREAS *ea, int avoid_collaps, int set_area, double trshld );

src/gui/layertree/qgslayertreeembeddedwidgetregistry.h

+5
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ class GUI_EXPORT QgsLayerTreeEmbeddedWidgetRegistry
8787

8888
//! storage of all the providers
8989
QMap<QString, QgsLayerTreeEmbeddedWidgetProvider*> mProviders;
90+
91+
private:
92+
93+
QgsLayerTreeEmbeddedWidgetRegistry( const QgsLayerTreeEmbeddedWidgetRegistry& other );
94+
QgsLayerTreeEmbeddedWidgetRegistry& operator=( const QgsLayerTreeEmbeddedWidgetRegistry& other );
9095
};
9196

9297

src/gui/symbology-ng/qgssymbolwidgetcontext.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class QgsMapCanvas;
2727
*
2828
* \note added in QGIS 3.0
2929
*/
30-
class GUI_EXPORT QgsSymbolWidgetContext
30+
class GUI_EXPORT QgsSymbolWidgetContext // clazy:exclude=rule-of-three
3131
{
3232
public:
3333

src/providers/ogr/qgsogrprovider.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ class QgsCPLErrorHandler
8383
{
8484
CPLPopErrorHandler();
8585
}
86+
87+
private:
88+
QgsCPLErrorHandler( const QgsCPLErrorHandler& other );
89+
QgsCPLErrorHandler& operator=( const QgsCPLErrorHandler& other );
90+
8691
};
8792
8893
@@ -1974,7 +1979,7 @@ static QString createFileFilter_( QString const &longName, QString const &glob )
19741979
} // createFileFilter_
19751980

19761981

1977-
QString createFilters( QString type )
1982+
QString createFilters( const QString& type )
19781983
{
19791984
/** Database drivers available*/
19801985
static QString myDatabaseDrivers;
@@ -2904,7 +2909,7 @@ QVariant QgsOgrProvider::maximumValue( int index ) const
29042909
return value;
29052910
}
29062911

2907-
QByteArray QgsOgrProvider::quotedIdentifier( QByteArray field ) const
2912+
QByteArray QgsOgrProvider::quotedIdentifier( const QByteArray& field ) const
29082913
{
29092914
return QgsOgrProviderUtils::quotedIdentifier( field, ogrDriverName );
29102915
}

src/providers/spatialite/qgsspatialiteprovider.h

+2
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ class QgsSpatiaLiteProvider: public QgsVectorDataProvider
244244

245245
private:
246246
char *errMsg;
247+
248+
SLException& operator=( const SLException& other );
247249
};
248250

249251
/**

src/providers/virtual/qgsvirtuallayersqlitemodule.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ struct VTable
163163
QgsFields fields() const { return mFields; }
164164

165165
private:
166+
167+
VTable( const VTable& other );
168+
VTable& operator=( const VTable& other );
169+
166170
// connection
167171
sqlite3* mSql;
168172

0 commit comments

Comments
 (0)