Skip to content

Commit 2682a74

Browse files
committed
Fix clazy pass big type by ref, small by value warnings
1 parent 010329e commit 2682a74

File tree

75 files changed

+142
-142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+142
-142
lines changed

python/core/processing/models/qgsprocessingmodelcomponent.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Returns the position of the model component within the graphical modeler.
4444
.. seealso:: :py:func:`setPosition`
4545
%End
4646

47-
void setPosition( const QPointF &position );
47+
void setPosition( QPointF position );
4848
%Docstring
4949
Sets the ``position`` of the model component within the graphical modeler.
5050

python/core/processing/qgsprocessingcontext.sip.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Returns any flags set in the context.
5252
.. seealso:: :py:func:`setFlags`
5353
%End
5454

55-
void setFlags( const QgsProcessingContext::Flags &flags );
55+
void setFlags( QgsProcessingContext::Flags flags );
5656
%Docstring
5757
Sets ``flags`` for the context.
5858

@@ -161,7 +161,7 @@ Returns the behavior used for checking invalid geometries in input layers.
161161
.. seealso:: :py:func:`setInvalidGeometryCheck`
162162
%End
163163

164-
void setInvalidGeometryCheck( const QgsFeatureRequest::InvalidGeometryCheck &check );
164+
void setInvalidGeometryCheck( QgsFeatureRequest::InvalidGeometryCheck check );
165165
%Docstring
166166
Sets the behavior used for checking invalid geometries in input layers.
167167
Settings this to anything but QgsFeatureRequest.GeometryNoCheck will also

python/core/processing/qgsprocessingparameters.sip.in

+4-4
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ Returns any flags associated with the parameter.
251251
.. seealso:: :py:func:`setFlags`
252252
%End
253253

254-
void setFlags( const Flags &flags );
254+
void setFlags( Flags flags );
255255
%Docstring
256256
Sets the ``flags`` associated with the parameter.
257257

@@ -1205,7 +1205,7 @@ Returns the acceptable data type for the parameter.
12051205
.. seealso:: :py:func:`setDataType`
12061206
%End
12071207

1208-
void setDataType( const Type &type );
1208+
void setDataType( Type type );
12091209
%Docstring
12101210
Sets the acceptable data ``type`` for the parameter.
12111211

@@ -1264,7 +1264,7 @@ Returns the acceptable data type for the range.
12641264
.. seealso:: :py:func:`setDataType`
12651265
%End
12661266

1267-
void setDataType( const QgsProcessingParameterNumber::Type &dataType );
1267+
void setDataType( QgsProcessingParameterNumber::Type dataType );
12681268
%Docstring
12691269
Sets the acceptable data ``type`` for the range.
12701270

@@ -1663,7 +1663,7 @@ Returns the acceptable data type for the field.
16631663
.. seealso:: :py:func:`setDataType`
16641664
%End
16651665

1666-
void setDataType( const DataType &type );
1666+
void setDataType( DataType type );
16671667
%Docstring
16681668
Sets the acceptable data ``type`` for the field.
16691669

python/core/processing/qgsprocessingutils.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ temporary layer store.
140140
available in Python bindings as createFeatureSink()
141141
%End
142142

143-
static QgsRectangle combineLayerExtents( const QList< QgsMapLayer *> layers, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
143+
static QgsRectangle combineLayerExtents( const QList<QgsMapLayer *> &layers, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
144144
%Docstring
145145
Combines the extent of several map ``layers``. If specified, the target ``crs``
146146
will be used to transform the layer's extent to the desired output reference system.

python/core/qgsactionmanager.sip.in

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ dialog box.
5353
Add a new action to this list.
5454
%End
5555

56-
void removeAction( const QUuid &actionId );
56+
void removeAction( QUuid actionId );
5757
%Docstring
5858
Remove an action by its id.
5959

6060
.. versionadded:: 3.0
6161
%End
6262

63-
void doAction( const QUuid &actionId, const QgsFeature &feature, int defaultValueIndex = 0, const QgsExpressionContextScope &scope = QgsExpressionContextScope() ) /PyName=doActionFeature/;
63+
void doAction( QUuid actionId, const QgsFeature &feature, int defaultValueIndex = 0, const QgsExpressionContextScope &scope = QgsExpressionContextScope() ) /PyName=doActionFeature/;
6464
%Docstring
6565
Does the given action.
6666

@@ -74,7 +74,7 @@ Does the given action.
7474
available in Python bindings as doActionFeature
7575
%End
7676

77-
void doAction( const QUuid &actionId, const QgsFeature &feature, const QgsExpressionContext &context );
77+
void doAction( QUuid actionId, const QgsFeature &feature, const QgsExpressionContext &context );
7878
%Docstring
7979
Does the action using the expression engine to replace any embedded expressions
8080
in the action definition.
@@ -112,14 +112,14 @@ Writes the actions out in XML format
112112
Reads the actions in in XML format
113113
%End
114114

115-
QgsAction action( const QUuid &id );
115+
QgsAction action( QUuid id );
116116
%Docstring
117117
Get an action by its id.
118118

119119
.. versionadded:: 3.0
120120
%End
121121

122-
void setDefaultAction( const QString &actionScope, const QUuid &actionId );
122+
void setDefaultAction( const QString &actionScope, QUuid actionId );
123123
%Docstring
124124
Each scope can have a default action. This will be saved in the project
125125
file.

python/core/qgsapplication.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ default theme if the active theme does not have the required icon.
335335
Sampler,
336336
};
337337

338-
static QCursor getThemeCursor( const Cursor &cursor );
338+
static QCursor getThemeCursor( Cursor cursor );
339339
%Docstring
340340
Helper to get a theme cursor. It will fall back to the
341341
default theme if the active theme does not have the required icon.

python/core/qgscoordinateformatter.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Optional ``flags`` can be specified to control the output format.
7272
.. seealso:: :py:func:`formatX`
7373
%End
7474

75-
static QString format( QgsPointXY point, Format format, int precision = 12, FormatFlags flags = FlagDegreesUseStringSuffix );
75+
static QString format( const QgsPointXY &point, Format format, int precision = 12, FormatFlags flags = FlagDegreesUseStringSuffix );
7676
%Docstring
7777
Formats a ``point`` according to the specified parameters.
7878

python/core/qgsdataitem.sip.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,14 @@ Returns comments of the layer
446446
.. versionadded:: 2.12
447447
%End
448448

449-
static QString layerTypeAsString( const LayerType &layerType );
449+
static QString layerTypeAsString( LayerType layerType );
450450
%Docstring
451451
Returns the string representation of the given ``layerType``
452452

453453
.. versionadded:: 3
454454
%End
455455

456-
static QString iconName( const LayerType &layerType );
456+
static QString iconName( LayerType layerType );
457457
%Docstring
458458
Returns the icon name of the given ``layerType``
459459

python/core/qgsdatumtransform.sip.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ and ``destinationTransformId`` transforms.
4040

4141
int destinationTransformId;
4242

43-
bool operator==( const QgsDatumTransform::TransformPair &other ) const;
43+
bool operator==( QgsDatumTransform::TransformPair other ) const;
4444

45-
bool operator!=( const QgsDatumTransform::TransformPair &other ) const;
45+
bool operator!=( QgsDatumTransform::TransformPair other ) const;
4646

4747
};
4848

python/core/qgsrelation.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Set an id for this relation
5959
Set a name for this relation
6060
%End
6161

62-
void setStrength( const RelationStrength &strength );
62+
void setStrength( RelationStrength strength );
6363
%Docstring
6464
Set a strength for this relation
6565

python/core/qgstaskmanager.sip.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ clean up and terminate at the earliest possible convenience.
5252
typedef QFlags<QgsTask::Flag> Flags;
5353

5454

55-
QgsTask( const QString &description = QString(), const Flags &flags = AllFlags );
55+
QgsTask( const QString &description = QString(), QgsTask::Flags flags = AllFlags );
5656
%Docstring
5757
Constructor for QgsTask.
5858

@@ -311,7 +311,7 @@ Constructor for QgsTaskManager.
311311
struct TaskDefinition
312312
{
313313

314-
explicit TaskDefinition( QgsTask *task, QgsTaskList dependentTasks = QgsTaskList() );
314+
explicit TaskDefinition( QgsTask *task, const QgsTaskList &dependentTasks = QgsTaskList() );
315315
%Docstring
316316
Constructor for TaskDefinition. Ownership of the task is not transferred to the definition,
317317
but will be transferred to a QgsTaskManager.

python/core/qgstextrenderer.sip.in

+5-5
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ and vertical margins to add to the text when calculating the size of the shape.
380380
.. seealso:: :py:func:`sizeType`
381381
%End
382382

383-
void setSize( const QSizeF &size );
383+
void setSize( QSizeF size );
384384
%Docstring
385385
Sets the size of the background shape. The meaning of the size depends on the current sizeType(),
386386
e.g., for size types of QgsTextBackgroundSettings.SizeFixed the size will represent the actual width and
@@ -490,7 +490,7 @@ via offsetUnit().
490490
.. seealso:: :py:func:`offsetUnit`
491491
%End
492492

493-
void setOffset( const QPointF &offset );
493+
void setOffset( QPointF offset );
494494
%Docstring
495495
Sets the offset used for drawing the background shape. Units are specified using
496496
setOffsetUnit().
@@ -554,7 +554,7 @@ through radiiUnit().
554554
.. seealso:: :py:func:`radiiUnit`
555555
%End
556556

557-
void setRadii( const QSizeF &radii );
557+
void setRadii( QSizeF radii );
558558
%Docstring
559559
Sets the radii used for rounding the corners of shapes. This is only used if
560560
type() is set to QgsTextBackgroundSettings.ShapeRectangle or QgsTextBackgroundSettings.ShapeSquare.
@@ -1539,7 +1539,7 @@ formats like SVG to maintain text as text objects, but at the cost of degraded
15391539
rendering and may result in side effects like misaligned text buffers.
15401540
%End
15411541

1542-
static void drawText( const QPointF &point, double rotation, HAlignment alignment, const QStringList &textLines,
1542+
static void drawText( QPointF point, double rotation, HAlignment alignment, const QStringList &textLines,
15431543
QgsRenderContext &context, const QgsTextFormat &format,
15441544
bool drawAsOutlines = true );
15451545
%Docstring
@@ -1576,7 +1576,7 @@ formats like SVG to maintain text as text objects, but at the cost of degraded
15761576
rendering and may result in side effects like misaligned text buffers.
15771577
%End
15781578

1579-
static void drawPart( const QPointF &origin, double rotation, HAlignment alignment, const QStringList &textLines,
1579+
static void drawPart( QPointF origin, double rotation, HAlignment alignment, const QStringList &textLines,
15801580
QgsRenderContext &context, const QgsTextFormat &format,
15811581
TextPart part, bool drawAsOutlines = true );
15821582
%Docstring

python/core/qgsvectorlayerundopassthroughcommand.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class QgsVectorLayerUndoPassthroughCommandChangeGeometry : QgsVectorLayerUndoPas
154154
%End
155155
public:
156156

157-
QgsVectorLayerUndoPassthroughCommandChangeGeometry( QgsVectorLayerEditBuffer *buffer /Transfer/, const QgsFeatureId &fid, const QgsGeometry &geom );
157+
QgsVectorLayerUndoPassthroughCommandChangeGeometry( QgsVectorLayerEditBuffer *buffer /Transfer/, QgsFeatureId fid, const QgsGeometry &geom );
158158
%Docstring
159159
Constructor for QgsVectorLayerUndoPassthroughCommandChangeGeometry
160160

python/gui/attributetable/qgsattributetablemodel.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Returns the layer this model uses as backend. Retrieved from the layer cache.
164164
Returns the layer cache this model uses as backend.
165165
%End
166166

167-
void executeAction( const QUuid &action, const QModelIndex &idx ) const;
167+
void executeAction( QUuid action, const QModelIndex &idx ) const;
168168
%Docstring
169169
Execute an action
170170
%End

python/gui/attributetable/qgsdualview.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class QgsAttributeTableAction : QAction
269269
%End
270270
public:
271271

272-
QgsAttributeTableAction( const QString &name, QgsDualView *dualView, const QUuid &action, const QModelIndex &fieldIdx );
272+
QgsAttributeTableAction( const QString &name, QgsDualView *dualView, QUuid action, const QModelIndex &fieldIdx );
273273
%Docstring
274274
Create a new attribute table action.
275275

python/gui/qgscheckablecombobox.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Handler for widget resizing
148148

149149
protected slots:
150150

151-
void showContextMenu( const QPoint &pos );
151+
void showContextMenu( QPoint pos );
152152
%Docstring
153153
Display context menu which allows selecting/deselecting
154154
all items at once.

python/gui/qgsfilewidget.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ returns the filters used for QDialog.getOpenFileName
9898
:param filter: Only files that match the given filter are shown, it may be an empty string. If you want multiple filters, separate them with ';;',
9999
%End
100100

101-
void setSelectedFilter( const QString selectedFilter );
101+
void setSelectedFilter( const QString &selectedFilter );
102102
%Docstring
103103
Sets the selected filter when the file dialog opens.
104104
%End

python/gui/qgsfontbutton.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Returns the current button mode.
5757
.. seealso:: :py:func:`setMode`
5858
%End
5959

60-
void setMode( const QgsFontButton::Mode &mode );
60+
void setMode( Mode mode );
6161
%Docstring
6262
Sets the current button ``mode``. This can be used to toggle between
6363
the full capabilities of the button (for configuring QgsTextFormat/QgsTextRenderer objects)

src/analysis/processing/qgsalgorithmfiledownloader.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ QVariantMap QgsFileDownloaderAlgorithm::processAlgorithm( const QVariantMap &par
9797
return outputs;
9898
}
9999

100-
void QgsFileDownloaderAlgorithm::reportErrors( QStringList errors )
100+
void QgsFileDownloaderAlgorithm::reportErrors( const QStringList &errors )
101101
{
102102
throw QgsProcessingException( errors.join( '\n' ) );
103103
}

src/analysis/processing/qgsalgorithmfiledownloader.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class QgsFileDownloaderAlgorithm : public QgsProcessingAlgorithm, public QObject
5353
QString mReceived;
5454
QgsProcessingFeedback *mFeedback = nullptr;
5555
QString mLastReport;
56-
void reportErrors( QStringList errors );
56+
void reportErrors( const QStringList &errors );
5757
void receiveProgressFromDownloader( qint64 bytesReceived, qint64 bytesTotal );
5858
void sendProgressFeedback();
5959
};

src/analysis/raster/qgsalignraster.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class ANALYSIS_EXPORT QgsAlignRaster
181181
QPointF gridOffset() const { return QPointF( mGridOffsetX, mGridOffsetY ); }
182182

183183
//! Set output cell size
184-
void setCellSize( double x, double y ) { return setCellSize( QSizeF( x, y ) ); }
184+
void setCellSize( double x, double y ) { setCellSize( QSizeF( x, y ) ); }
185185
//! Set output cell size
186186
void setCellSize( QSizeF size ) { mCellSizeX = size.width(); mCellSizeY = size.height(); }
187187
//! Get output cell size

src/core/annotations/qgsannotationregistry.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class CORE_EXPORT QgsAnnotationMetadata
4747
* Constructor for QgsAnnotationMetadata. \a typeName should be a unique string
4848
* identifying the annotation type.
4949
*/
50-
QgsAnnotationMetadata( const QString &typeName, QgsCreateAnnotationFunc createFunc )
50+
QgsAnnotationMetadata( const QString &typeName, const QgsCreateAnnotationFunc &createFunc )
5151
: mTypeName( typeName )
5252
, mCreateFunc( createFunc )
5353
{}

src/core/auth/qgsauthmanager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ class CORE_EXPORT QgsAuthManager : public QObject
769769
bool passwordHelperWrite( const QString &password );
770770

771771
//! Error message setter
772-
void passwordHelperSetErrorMessage( const QString errorMessage ) { mPasswordHelperErrorMessage = errorMessage; }
772+
void passwordHelperSetErrorMessage( const QString &errorMessage ) { mPasswordHelperErrorMessage = errorMessage; }
773773

774774
//! Clear error code and message
775775
void passwordHelperClearErrors();

src/core/geometry/qgswkbptr.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ class CORE_EXPORT QgsWkbPtr
8282
inline const QgsWkbPtr &operator>>( char &v ) const { read( v ); return *this; } SIP_SKIP
8383
inline const QgsWkbPtr &operator>>( QgsWkbTypes::Type &v ) const { read( v ); return *this; } SIP_SKIP
8484

85-
inline QgsWkbPtr &operator<<( const double &v ) { write( v ); return *this; } SIP_SKIP
86-
inline QgsWkbPtr &operator<<( const float &r ) { double v = r; write( v ); return *this; } SIP_SKIP
87-
inline QgsWkbPtr &operator<<( const int &v ) { write( v ); return *this; } SIP_SKIP
88-
inline QgsWkbPtr &operator<<( const unsigned int &v ) { write( v ); return *this; } SIP_SKIP
89-
inline QgsWkbPtr &operator<<( const char &v ) { write( v ); return *this; } SIP_SKIP
90-
inline QgsWkbPtr &operator<<( const QgsWkbTypes::Type &v ) { write( v ); return *this; } SIP_SKIP
85+
inline QgsWkbPtr &operator<<( double v ) { write( v ); return *this; } SIP_SKIP
86+
inline QgsWkbPtr &operator<<( float r ) { double v = r; write( v ); return *this; } SIP_SKIP
87+
inline QgsWkbPtr &operator<<( int v ) { write( v ); return *this; } SIP_SKIP
88+
inline QgsWkbPtr &operator<<( unsigned int v ) { write( v ); return *this; } SIP_SKIP
89+
inline QgsWkbPtr &operator<<( char v ) { write( v ); return *this; } SIP_SKIP
90+
inline QgsWkbPtr &operator<<( QgsWkbTypes::Type v ) { write( v ); return *this; } SIP_SKIP
9191
//! Append data from a byte array
9292
inline QgsWkbPtr &operator<<( const QByteArray &data ) { write( data ); return *this; } SIP_SKIP
9393

src/core/layout/qgslayoutitemregistry.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ class CORE_EXPORT QgsLayoutItemMetadata : public QgsLayoutItemAbstractMetadata
115115
* and \a visibleName, and function pointers for the various item creation functions.
116116
*/
117117
QgsLayoutItemMetadata( int type, const QString &visibleName,
118-
QgsLayoutItemCreateFunc pfCreate,
119-
QgsLayoutItemPathResolverFunc pfPathResolver = nullptr )
118+
const QgsLayoutItemCreateFunc &pfCreate,
119+
const QgsLayoutItemPathResolverFunc &pfPathResolver = nullptr )
120120
: QgsLayoutItemAbstractMetadata( type, visibleName )
121121
, mCreateFunc( pfCreate )
122122
, mPathResolverFunc( pfPathResolver )
@@ -236,8 +236,8 @@ class CORE_EXPORT QgsLayoutMultiFrameMetadata : public QgsLayoutMultiFrameAbstra
236236
* and \a visibleName, and function pointers for the various item creation functions.
237237
*/
238238
QgsLayoutMultiFrameMetadata( int type, const QString &visibleName,
239-
QgsLayoutMultiFrameCreateFunc pfCreate,
240-
QgsLayoutMultiFramePathResolverFunc pfPathResolver = nullptr )
239+
const QgsLayoutMultiFrameCreateFunc &pfCreate,
240+
const QgsLayoutMultiFramePathResolverFunc &pfPathResolver = nullptr )
241241
: QgsLayoutMultiFrameAbstractMetadata( type, visibleName )
242242
, mCreateFunc( pfCreate )
243243
, mPathResolverFunc( pfPathResolver )

src/core/processing/models/qgsprocessingmodelcomponent.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ QPointF QgsProcessingModelComponent::position() const
3838
return mPosition;
3939
}
4040

41-
void QgsProcessingModelComponent::setPosition( const QPointF &position )
41+
void QgsProcessingModelComponent::setPosition( QPointF position )
4242
{
4343
mPosition = position;
4444
}

src/core/processing/models/qgsprocessingmodelcomponent.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class CORE_EXPORT QgsProcessingModelComponent
5555
* Sets the \a position of the model component within the graphical modeler.
5656
* \see position()
5757
*/
58-
void setPosition( const QPointF &position );
58+
void setPosition( QPointF position );
5959

6060
protected:
6161

0 commit comments

Comments
 (0)