Skip to content
Permalink
Browse files

Fix clazy pass big type by ref, small by value warnings

  • Loading branch information
nyalldawson committed Feb 2, 2018
1 parent 010329e commit 2682a74a1b513ec14e61fa13b366b45d85575f00
Showing with 142 additions and 142 deletions.
  1. +1 −1 python/core/processing/models/qgsprocessingmodelcomponent.sip.in
  2. +2 −2 python/core/processing/qgsprocessingcontext.sip.in
  3. +4 −4 python/core/processing/qgsprocessingparameters.sip.in
  4. +1 −1 python/core/processing/qgsprocessingutils.sip.in
  5. +5 −5 python/core/qgsactionmanager.sip.in
  6. +1 −1 python/core/qgsapplication.sip.in
  7. +1 −1 python/core/qgscoordinateformatter.sip.in
  8. +2 −2 python/core/qgsdataitem.sip.in
  9. +2 −2 python/core/qgsdatumtransform.sip.in
  10. +1 −1 python/core/qgsrelation.sip.in
  11. +2 −2 python/core/qgstaskmanager.sip.in
  12. +5 −5 python/core/qgstextrenderer.sip.in
  13. +1 −1 python/core/qgsvectorlayerundopassthroughcommand.sip.in
  14. +1 −1 python/gui/attributetable/qgsattributetablemodel.sip.in
  15. +1 −1 python/gui/attributetable/qgsdualview.sip.in
  16. +1 −1 python/gui/qgscheckablecombobox.sip.in
  17. +1 −1 python/gui/qgsfilewidget.sip.in
  18. +1 −1 python/gui/qgsfontbutton.sip.in
  19. +1 −1 src/analysis/processing/qgsalgorithmfiledownloader.cpp
  20. +1 −1 src/analysis/processing/qgsalgorithmfiledownloader.h
  21. +1 −1 src/analysis/raster/qgsalignraster.h
  22. +1 −1 src/core/annotations/qgsannotationregistry.h
  23. +1 −1 src/core/auth/qgsauthmanager.h
  24. +6 −6 src/core/geometry/qgswkbptr.h
  25. +4 −4 src/core/layout/qgslayoutitemregistry.h
  26. +1 −1 src/core/processing/models/qgsprocessingmodelcomponent.cpp
  27. +1 −1 src/core/processing/models/qgsprocessingmodelcomponent.h
  28. +4 −4 src/core/processing/qgsprocessingcontext.h
  29. +3 −3 src/core/processing/qgsprocessingparameters.cpp
  30. +4 −4 src/core/processing/qgsprocessingparameters.h
  31. +1 −1 src/core/processing/qgsprocessingutils.cpp
  32. +1 −1 src/core/processing/qgsprocessingutils.h
  33. +5 −5 src/core/qgsactionmanager.cpp
  34. +5 −5 src/core/qgsactionmanager.h
  35. +1 −1 src/core/qgsapplication.cpp
  36. +1 −1 src/core/qgsapplication.h
  37. +1 −1 src/core/qgscoordinateformatter.cpp
  38. +1 −1 src/core/qgscoordinateformatter.h
  39. +2 −2 src/core/qgsdataitem.cpp
  40. +2 −2 src/core/qgsdataitem.h
  41. +2 −2 src/core/qgsdatumtransform.h
  42. +1 −1 src/core/qgsfeaturefiltermodel.h
  43. +2 −2 src/core/qgsmaplayerlistutils.h
  44. +1 −1 src/core/qgsrelation.cpp
  45. +1 −1 src/core/qgsrelation.h
  46. +1 −1 src/core/qgsrulebasedlabeling.cpp
  47. +1 −1 src/core/qgstaskmanager.cpp
  48. +3 −3 src/core/qgstaskmanager.h
  49. +5 −5 src/core/qgstextrenderer.cpp
  50. +5 −5 src/core/qgstextrenderer.h
  51. +1 −1 src/core/qgsvectorlayerundopassthroughcommand.cpp
  52. +1 −1 src/core/qgsvectorlayerundopassthroughcommand.h
  53. +1 −1 src/core/qgsvectorlayerutils.cpp
  54. +1 −1 src/core/qgsvectorlayerutils.h
  55. +1 −1 src/gui/attributetable/qgsattributetablemodel.cpp
  56. +1 −1 src/gui/attributetable/qgsattributetablemodel.h
  57. +1 −1 src/gui/attributetable/qgsdualview.h
  58. +8 −8 src/gui/layout/qgslayoutitemguiregistry.h
  59. +1 −1 src/gui/qgsattributeformwidget.cpp
  60. +1 −1 src/gui/qgscheckablecombobox.cpp
  61. +1 −1 src/gui/qgscheckablecombobox.h
  62. +1 −1 src/gui/qgscolorbutton.cpp
  63. +1 −1 src/gui/qgscolorbutton.h
  64. +1 −1 src/gui/qgscompoundcolorwidget.cpp
  65. +1 −1 src/gui/qgscompoundcolorwidget.h
  66. +1 −1 src/gui/qgsfilewidget.h
  67. +1 −1 src/gui/qgsfontbutton.cpp
  68. +1 −1 src/gui/qgsfontbutton.h
  69. +1 −1 src/gui/qgsmessagebar.h
  70. +7 −7 src/gui/qgsoptionsdialogbase.cpp
  71. +2 −2 src/gui/qgsoptionsdialogbase.h
  72. +1 −1 src/gui/qgspropertyoverridebutton.h
  73. +1 −1 src/gui/qgsscalewidget.h
  74. +1 −1 src/gui/raster/qgspalettedrendererwidget.cpp
  75. +1 −1 src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp
@@ -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.

@@ -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.

@@ -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
@@ -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.

@@ -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.

@@ -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.

@@ -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.

@@ -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.
@@ -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.

@@ -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.
@@ -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.
@@ -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.
@@ -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.

@@ -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``

@@ -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;

};

@@ -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

@@ -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.

@@ -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.
@@ -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
@@ -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().
@@ -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.
@@ -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
@@ -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
@@ -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

@@ -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
@@ -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.

@@ -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.
@@ -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
@@ -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)
@@ -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' ) );
}
@@ -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();
};
@@ -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
@@ -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 )
{}
@@ -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();
@@ -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

@@ -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 )
@@ -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 )
@@ -38,7 +38,7 @@ QPointF QgsProcessingModelComponent::position() const
return mPosition;
}

void QgsProcessingModelComponent::setPosition( const QPointF &position )
void QgsProcessingModelComponent::setPosition( QPointF position )
{
mPosition = position;
}
@@ -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:

0 comments on commit 2682a74

Please sign in to comment.
You can’t perform that action at this time.