Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix clazy pass big type by ref, small by value warnings
  • Loading branch information
nyalldawson committed Feb 2, 2018
1 parent 010329e commit 2682a74
Show file tree
Hide file tree
Showing 75 changed files with 142 additions and 142 deletions.
Expand Up @@ -44,7 +44,7 @@ Returns the position of the model component within the graphical modeler.
.. seealso:: :py:func:`setPosition`
%End

void setPosition( const QPointF &position );
void setPosition( QPointF position );
%Docstring
Sets the ``position`` of the model component within the graphical modeler.

Expand Down
4 changes: 2 additions & 2 deletions python/core/processing/qgsprocessingcontext.sip.in
Expand Up @@ -52,7 +52,7 @@ Returns any flags set in the context.
.. seealso:: :py:func:`setFlags`
%End

void setFlags( const QgsProcessingContext::Flags &flags );
void setFlags( QgsProcessingContext::Flags flags );
%Docstring
Sets ``flags`` for the context.

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

void setInvalidGeometryCheck( const QgsFeatureRequest::InvalidGeometryCheck &check );
void setInvalidGeometryCheck( QgsFeatureRequest::InvalidGeometryCheck check );
%Docstring
Sets the behavior used for checking invalid geometries in input layers.
Settings this to anything but QgsFeatureRequest.GeometryNoCheck will also
Expand Down
8 changes: 4 additions & 4 deletions python/core/processing/qgsprocessingparameters.sip.in
Expand Up @@ -251,7 +251,7 @@ Returns any flags associated with the parameter.
.. seealso:: :py:func:`setFlags`
%End

void setFlags( const Flags &flags );
void setFlags( Flags flags );
%Docstring
Sets the ``flags`` associated with the parameter.

Expand Down Expand Up @@ -1205,7 +1205,7 @@ Returns the acceptable data type for the parameter.
.. seealso:: :py:func:`setDataType`
%End

void setDataType( const Type &type );
void setDataType( Type type );
%Docstring
Sets the acceptable data ``type`` for the parameter.

Expand Down Expand Up @@ -1264,7 +1264,7 @@ Returns the acceptable data type for the range.
.. seealso:: :py:func:`setDataType`
%End

void setDataType( const QgsProcessingParameterNumber::Type &dataType );
void setDataType( QgsProcessingParameterNumber::Type dataType );
%Docstring
Sets the acceptable data ``type`` for the range.

Expand Down Expand Up @@ -1663,7 +1663,7 @@ Returns the acceptable data type for the field.
.. seealso:: :py:func:`setDataType`
%End

void setDataType( const DataType &type );
void setDataType( DataType type );
%Docstring
Sets the acceptable data ``type`` for the field.

Expand Down
2 changes: 1 addition & 1 deletion python/core/processing/qgsprocessingutils.sip.in
Expand Up @@ -140,7 +140,7 @@ temporary layer store.
available in Python bindings as createFeatureSink()
%End

static QgsRectangle combineLayerExtents( const QList< QgsMapLayer *> layers, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
static QgsRectangle combineLayerExtents( const QList<QgsMapLayer *> &layers, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
%Docstring
Combines the extent of several map ``layers``. If specified, the target ``crs``
will be used to transform the layer's extent to the desired output reference system.
Expand Down
10 changes: 5 additions & 5 deletions python/core/qgsactionmanager.sip.in
Expand Up @@ -53,14 +53,14 @@ dialog box.
Add a new action to this list.
%End

void removeAction( const QUuid &actionId );
void removeAction( QUuid actionId );
%Docstring
Remove an action by its id.

.. versionadded:: 3.0
%End

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

Expand All @@ -74,7 +74,7 @@ Does the given action.
available in Python bindings as doActionFeature
%End

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

QgsAction action( const QUuid &id );
QgsAction action( QUuid id );
%Docstring
Get an action by its id.

.. versionadded:: 3.0
%End

void setDefaultAction( const QString &actionScope, const QUuid &actionId );
void setDefaultAction( const QString &actionScope, QUuid actionId );
%Docstring
Each scope can have a default action. This will be saved in the project
file.
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsapplication.sip.in
Expand Up @@ -335,7 +335,7 @@ default theme if the active theme does not have the required icon.
Sampler,
};

static QCursor getThemeCursor( const Cursor &cursor );
static QCursor getThemeCursor( Cursor cursor );
%Docstring
Helper to get a theme cursor. It will fall back to the
default theme if the active theme does not have the required icon.
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgscoordinateformatter.sip.in
Expand Up @@ -72,7 +72,7 @@ Optional ``flags`` can be specified to control the output format.
.. seealso:: :py:func:`formatX`
%End

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

Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsdataitem.sip.in
Expand Up @@ -446,14 +446,14 @@ Returns comments of the layer
.. versionadded:: 2.12
%End

static QString layerTypeAsString( const LayerType &layerType );
static QString layerTypeAsString( LayerType layerType );
%Docstring
Returns the string representation of the given ``layerType``

.. versionadded:: 3
%End

static QString iconName( const LayerType &layerType );
static QString iconName( LayerType layerType );
%Docstring
Returns the icon name of the given ``layerType``

Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsdatumtransform.sip.in
Expand Up @@ -40,9 +40,9 @@ and ``destinationTransformId`` transforms.

int destinationTransformId;

bool operator==( const QgsDatumTransform::TransformPair &other ) const;
bool operator==( QgsDatumTransform::TransformPair other ) const;

bool operator!=( const QgsDatumTransform::TransformPair &other ) const;
bool operator!=( QgsDatumTransform::TransformPair other ) const;

};

Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsrelation.sip.in
Expand Up @@ -59,7 +59,7 @@ Set an id for this relation
Set a name for this relation
%End

void setStrength( const RelationStrength &strength );
void setStrength( RelationStrength strength );
%Docstring
Set a strength for this relation

Expand Down
4 changes: 2 additions & 2 deletions python/core/qgstaskmanager.sip.in
Expand Up @@ -52,7 +52,7 @@ clean up and terminate at the earliest possible convenience.
typedef QFlags<QgsTask::Flag> Flags;


QgsTask( const QString &description = QString(), const Flags &flags = AllFlags );
QgsTask( const QString &description = QString(), QgsTask::Flags flags = AllFlags );
%Docstring
Constructor for QgsTask.

Expand Down Expand Up @@ -311,7 +311,7 @@ Constructor for QgsTaskManager.
struct TaskDefinition
{

explicit TaskDefinition( QgsTask *task, QgsTaskList dependentTasks = QgsTaskList() );
explicit TaskDefinition( QgsTask *task, const QgsTaskList &dependentTasks = QgsTaskList() );
%Docstring
Constructor for TaskDefinition. Ownership of the task is not transferred to the definition,
but will be transferred to a QgsTaskManager.
Expand Down
10 changes: 5 additions & 5 deletions python/core/qgstextrenderer.sip.in
Expand Up @@ -380,7 +380,7 @@ and vertical margins to add to the text when calculating the size of the shape.
.. seealso:: :py:func:`sizeType`
%End

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

void setOffset( const QPointF &offset );
void setOffset( QPointF offset );
%Docstring
Sets the offset used for drawing the background shape. Units are specified using
setOffsetUnit().
Expand Down Expand Up @@ -554,7 +554,7 @@ through radiiUnit().
.. seealso:: :py:func:`radiiUnit`
%End

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

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

static void drawPart( const QPointF &origin, double rotation, HAlignment alignment, const QStringList &textLines,
static void drawPart( QPointF origin, double rotation, HAlignment alignment, const QStringList &textLines,
QgsRenderContext &context, const QgsTextFormat &format,
TextPart part, bool drawAsOutlines = true );
%Docstring
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsvectorlayerundopassthroughcommand.sip.in
Expand Up @@ -154,7 +154,7 @@ class QgsVectorLayerUndoPassthroughCommandChangeGeometry : QgsVectorLayerUndoPas
%End
public:

QgsVectorLayerUndoPassthroughCommandChangeGeometry( QgsVectorLayerEditBuffer *buffer /Transfer/, const QgsFeatureId &fid, const QgsGeometry &geom );
QgsVectorLayerUndoPassthroughCommandChangeGeometry( QgsVectorLayerEditBuffer *buffer /Transfer/, QgsFeatureId fid, const QgsGeometry &geom );
%Docstring
Constructor for QgsVectorLayerUndoPassthroughCommandChangeGeometry

Expand Down
2 changes: 1 addition & 1 deletion python/gui/attributetable/qgsattributetablemodel.sip.in
Expand Up @@ -164,7 +164,7 @@ Returns the layer this model uses as backend. Retrieved from the layer cache.
Returns the layer cache this model uses as backend.
%End

void executeAction( const QUuid &action, const QModelIndex &idx ) const;
void executeAction( QUuid action, const QModelIndex &idx ) const;
%Docstring
Execute an action
%End
Expand Down
2 changes: 1 addition & 1 deletion python/gui/attributetable/qgsdualview.sip.in
Expand Up @@ -269,7 +269,7 @@ class QgsAttributeTableAction : QAction
%End
public:

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

Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgscheckablecombobox.sip.in
Expand Up @@ -148,7 +148,7 @@ Handler for widget resizing

protected slots:

void showContextMenu( const QPoint &pos );
void showContextMenu( QPoint pos );
%Docstring
Display context menu which allows selecting/deselecting
all items at once.
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsfilewidget.sip.in
Expand Up @@ -98,7 +98,7 @@ returns the filters used for QDialog.getOpenFileName
: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 ';;',
%End

void setSelectedFilter( const QString selectedFilter );
void setSelectedFilter( const QString &selectedFilter );
%Docstring
Sets the selected filter when the file dialog opens.
%End
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsfontbutton.sip.in
Expand Up @@ -57,7 +57,7 @@ Returns the current button mode.
.. seealso:: :py:func:`setMode`
%End

void setMode( const QgsFontButton::Mode &mode );
void setMode( Mode mode );
%Docstring
Sets the current button ``mode``. This can be used to toggle between
the full capabilities of the button (for configuring QgsTextFormat/QgsTextRenderer objects)
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmfiledownloader.cpp
Expand Up @@ -97,7 +97,7 @@ QVariantMap QgsFileDownloaderAlgorithm::processAlgorithm( const QVariantMap &par
return outputs;
}

void QgsFileDownloaderAlgorithm::reportErrors( QStringList errors )
void QgsFileDownloaderAlgorithm::reportErrors( const QStringList &errors )
{
throw QgsProcessingException( errors.join( '\n' ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmfiledownloader.h
Expand Up @@ -53,7 +53,7 @@ class QgsFileDownloaderAlgorithm : public QgsProcessingAlgorithm, public QObject
QString mReceived;
QgsProcessingFeedback *mFeedback = nullptr;
QString mLastReport;
void reportErrors( QStringList errors );
void reportErrors( const QStringList &errors );
void receiveProgressFromDownloader( qint64 bytesReceived, qint64 bytesTotal );
void sendProgressFeedback();
};
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/raster/qgsalignraster.h
Expand Up @@ -181,7 +181,7 @@ class ANALYSIS_EXPORT QgsAlignRaster
QPointF gridOffset() const { return QPointF( mGridOffsetX, mGridOffsetY ); }

//! Set output cell size
void setCellSize( double x, double y ) { return setCellSize( QSizeF( x, y ) ); }
void setCellSize( double x, double y ) { setCellSize( QSizeF( x, y ) ); }
//! Set output cell size
void setCellSize( QSizeF size ) { mCellSizeX = size.width(); mCellSizeY = size.height(); }
//! Get output cell size
Expand Down
2 changes: 1 addition & 1 deletion src/core/annotations/qgsannotationregistry.h
Expand Up @@ -47,7 +47,7 @@ class CORE_EXPORT QgsAnnotationMetadata
* Constructor for QgsAnnotationMetadata. \a typeName should be a unique string
* identifying the annotation type.
*/
QgsAnnotationMetadata( const QString &typeName, QgsCreateAnnotationFunc createFunc )
QgsAnnotationMetadata( const QString &typeName, const QgsCreateAnnotationFunc &createFunc )
: mTypeName( typeName )
, mCreateFunc( createFunc )
{}
Expand Down
2 changes: 1 addition & 1 deletion src/core/auth/qgsauthmanager.h
Expand Up @@ -769,7 +769,7 @@ class CORE_EXPORT QgsAuthManager : public QObject
bool passwordHelperWrite( const QString &password );

//! Error message setter
void passwordHelperSetErrorMessage( const QString errorMessage ) { mPasswordHelperErrorMessage = errorMessage; }
void passwordHelperSetErrorMessage( const QString &errorMessage ) { mPasswordHelperErrorMessage = errorMessage; }

//! Clear error code and message
void passwordHelperClearErrors();
Expand Down
12 changes: 6 additions & 6 deletions src/core/geometry/qgswkbptr.h
Expand Up @@ -82,12 +82,12 @@ class CORE_EXPORT QgsWkbPtr
inline const QgsWkbPtr &operator>>( char &v ) const { read( v ); return *this; } SIP_SKIP
inline const QgsWkbPtr &operator>>( QgsWkbTypes::Type &v ) const { read( v ); return *this; } SIP_SKIP

inline QgsWkbPtr &operator<<( const double &v ) { write( v ); return *this; } SIP_SKIP
inline QgsWkbPtr &operator<<( const float &r ) { double v = r; write( v ); return *this; } SIP_SKIP
inline QgsWkbPtr &operator<<( const int &v ) { write( v ); return *this; } SIP_SKIP
inline QgsWkbPtr &operator<<( const unsigned int &v ) { write( v ); return *this; } SIP_SKIP
inline QgsWkbPtr &operator<<( const char &v ) { write( v ); return *this; } SIP_SKIP
inline QgsWkbPtr &operator<<( const QgsWkbTypes::Type &v ) { write( v ); return *this; } SIP_SKIP
inline QgsWkbPtr &operator<<( double v ) { write( v ); return *this; } SIP_SKIP
inline QgsWkbPtr &operator<<( float r ) { double v = r; write( v ); return *this; } SIP_SKIP
inline QgsWkbPtr &operator<<( int v ) { write( v ); return *this; } SIP_SKIP
inline QgsWkbPtr &operator<<( unsigned int v ) { write( v ); return *this; } SIP_SKIP
inline QgsWkbPtr &operator<<( char v ) { write( v ); return *this; } SIP_SKIP
inline QgsWkbPtr &operator<<( QgsWkbTypes::Type v ) { write( v ); return *this; } SIP_SKIP
//! Append data from a byte array
inline QgsWkbPtr &operator<<( const QByteArray &data ) { write( data ); return *this; } SIP_SKIP

Expand Down
8 changes: 4 additions & 4 deletions src/core/layout/qgslayoutitemregistry.h
Expand Up @@ -115,8 +115,8 @@ class CORE_EXPORT QgsLayoutItemMetadata : public QgsLayoutItemAbstractMetadata
* and \a visibleName, and function pointers for the various item creation functions.
*/
QgsLayoutItemMetadata( int type, const QString &visibleName,
QgsLayoutItemCreateFunc pfCreate,
QgsLayoutItemPathResolverFunc pfPathResolver = nullptr )
const QgsLayoutItemCreateFunc &pfCreate,
const QgsLayoutItemPathResolverFunc &pfPathResolver = nullptr )
: QgsLayoutItemAbstractMetadata( type, visibleName )
, mCreateFunc( pfCreate )
, mPathResolverFunc( pfPathResolver )
Expand Down Expand Up @@ -236,8 +236,8 @@ class CORE_EXPORT QgsLayoutMultiFrameMetadata : public QgsLayoutMultiFrameAbstra
* and \a visibleName, and function pointers for the various item creation functions.
*/
QgsLayoutMultiFrameMetadata( int type, const QString &visibleName,
QgsLayoutMultiFrameCreateFunc pfCreate,
QgsLayoutMultiFramePathResolverFunc pfPathResolver = nullptr )
const QgsLayoutMultiFrameCreateFunc &pfCreate,
const QgsLayoutMultiFramePathResolverFunc &pfPathResolver = nullptr )
: QgsLayoutMultiFrameAbstractMetadata( type, visibleName )
, mCreateFunc( pfCreate )
, mPathResolverFunc( pfPathResolver )
Expand Down
2 changes: 1 addition & 1 deletion src/core/processing/models/qgsprocessingmodelcomponent.cpp
Expand Up @@ -38,7 +38,7 @@ QPointF QgsProcessingModelComponent::position() const
return mPosition;
}

void QgsProcessingModelComponent::setPosition( const QPointF &position )
void QgsProcessingModelComponent::setPosition( QPointF position )
{
mPosition = position;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/processing/models/qgsprocessingmodelcomponent.h
Expand Up @@ -55,7 +55,7 @@ class CORE_EXPORT QgsProcessingModelComponent
* Sets the \a position of the model component within the graphical modeler.
* \see position()
*/
void setPosition( const QPointF &position );
void setPosition( QPointF position );

protected:

Expand Down

0 comments on commit 2682a74

Please sign in to comment.