Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #3663 from nyalldawson/clazy3
Clazy qt5 optimisations - round 2
  • Loading branch information
nyalldawson committed Oct 24, 2016
2 parents b4e3101 + 2fab1b8 commit 7967110
Show file tree
Hide file tree
Showing 294 changed files with 622 additions and 491 deletions.
2 changes: 1 addition & 1 deletion python/analysis/vector/qgszonalstatistics.sip
Expand Up @@ -31,7 +31,7 @@ class QgsZonalStatistics
typedef QFlags<QgsZonalStatistics::Statistic> Statistics;

QgsZonalStatistics( QgsVectorLayer* polygonLayer, const QString& rasterFile, const QString& attributePrefix = "", int rasterBand = 1,
const QgsZonalStatistics::Statistics& stats = QgsZonalStatistics::Statistics( QgsZonalStatistics::Count | QgsZonalStatistics::Sum | QgsZonalStatistics::Mean) );
QgsZonalStatistics::Statistics stats = QgsZonalStatistics::Statistics( QgsZonalStatistics::Count | QgsZonalStatistics::Sum | QgsZonalStatistics::Mean) );

/** Starts the calculation
@return 0 in case of success*/
Expand Down
2 changes: 1 addition & 1 deletion python/core/auth/qgsauthmethod.sip
Expand Up @@ -105,7 +105,7 @@ class QgsAuthMethod : QObject
void setVersion( int version );

/** Set the support expansions (points in providers where the authentication is injected) of the auth method */
void setExpansions( const QgsAuthMethod::Expansions& expansions );
void setExpansions( QgsAuthMethod::Expansions expansions );
/** Set list of data providers this auth method supports */
void setDataProviders( const QStringList& dataproviders );
};
Expand Down
2 changes: 1 addition & 1 deletion python/core/composer/qgscomposermapgrid.sip
Expand Up @@ -684,7 +684,7 @@ class QgsComposerMapGrid : QgsComposerMapItem
* @see frameSideFlags
* @see testFrameSideFlag
*/
void setFrameSideFlags( const FrameSideFlags& flags );
void setFrameSideFlags( FrameSideFlags flags );

/** Sets whether the grid frame is drawn for a certain side of the map item.
* @param flag flag for grid frame side
Expand Down
12 changes: 6 additions & 6 deletions python/core/composer/qgscomposernodesitem.sip
Expand Up @@ -5,8 +5,8 @@ class QgsComposerNodesItem: QgsComposerItem
%End
public:

QgsComposerNodesItem( QString mTagName, QgsComposition* c );
QgsComposerNodesItem( QString mTagName, QPolygonF polygon, QgsComposition* c );
QgsComposerNodesItem( const QString& mTagName, QgsComposition* c );
QgsComposerNodesItem( const QString& mTagName, const QPolygonF& polygon, QgsComposition* c );
~QgsComposerNodesItem();

/** Add a node in current shape.
Expand All @@ -16,7 +16,7 @@ class QgsComposerNodesItem: QgsComposerItem
* true. Typically, if this flag is true, the new node has to be nearest
* than radius to the shape to be added.
*/
bool addNode( const QPointF &pt, const bool checkArea = true, const double radius = 10 );
bool addNode( QPointF pt, const bool checkArea = true, const double radius = 10 );

/** Set a tag to indicate if we want to draw or not the shape's nodes.
* @param display
Expand All @@ -27,7 +27,7 @@ class QgsComposerNodesItem: QgsComposerItem
* @param index the index of the node to move
* @param node is the new position in scene coordinate
*/
bool moveNode( const int index, const QPointF &node );
bool moveNode( const int index, QPointF node );

/** \brief Reimplementation of QCanvasItem::paint - draw on canvas */
void paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
Expand Down Expand Up @@ -85,7 +85,7 @@ class QgsComposerNodesItem: QgsComposerItem
protected:

/** Method called in addNode. */
virtual bool _addNode( const int nodeIndex, const QPointF &newPoint, const double radius ) = 0;
virtual bool _addNode( const int nodeIndex, QPointF newPoint, const double radius ) = 0;

/** Method called in removeNode. */
virtual bool _removeNode( const int nodeIndex ) = 0;
Expand All @@ -104,7 +104,7 @@ class QgsComposerNodesItem: QgsComposerItem
void rescaleToFitBoundingBox();

/** Compute an euclidian distance between 2 nodes. */
double computeDistance(const QPointF &pt1, const QPointF &pt2) const;
double computeDistance( QPointF pt1, QPointF pt2) const;

/** Update the current scene rectangle for this item. */
void updateSceneRect();
Expand Down
4 changes: 2 additions & 2 deletions python/core/composer/qgscomposerpolygon.sip
Expand Up @@ -6,7 +6,7 @@ class QgsComposerPolygon: QgsComposerNodesItem
public:

QgsComposerPolygon( QgsComposition* c );
QgsComposerPolygon( QPolygonF polygon, QgsComposition* c );
QgsComposerPolygon( const QPolygonF& polygon, QgsComposition* c );
~QgsComposerPolygon();

/** Overridden to return shape name */
Expand All @@ -23,7 +23,7 @@ class QgsComposerPolygon: QgsComposerNodesItem

protected:

bool _addNode( const int indexPoint, const QPointF &newPoint, const double radius );
bool _addNode( const int indexPoint, QPointF newPoint, const double radius );

bool _removeNode( const int indexPoint );

Expand Down
4 changes: 2 additions & 2 deletions python/core/composer/qgscomposerpolyline.sip
Expand Up @@ -6,7 +6,7 @@ class QgsComposerPolyline: QgsComposerNodesItem
public:

QgsComposerPolyline( QgsComposition* c );
QgsComposerPolyline( QPolygonF polyline, QgsComposition* c );
QgsComposerPolyline( const QPolygonF& polyline, QgsComposition* c );
~QgsComposerPolyline();

/** Overridden to return shape name */
Expand All @@ -23,7 +23,7 @@ class QgsComposerPolyline: QgsComposerNodesItem

protected:

bool _addNode( const int indexPoint, const QPointF &newPoint, const double radius );
bool _addNode( const int indexPoint, QPointF newPoint, const double radius );

bool _removeNode( const int indexPoint );

Expand Down
2 changes: 1 addition & 1 deletion python/core/dxf/qgsdxfexport.sip
Expand Up @@ -301,6 +301,6 @@ class QgsDxfExport
* @param fid id of feature
* @param layer dxf layer of feature
*/
void registerDxfLayer( QString layerId, QgsFeatureId fid, QString layer );
void registerDxfLayer( const QString& layerId, QgsFeatureId fid, const QString& layer );

};
2 changes: 1 addition & 1 deletion python/core/layertree/qgslayertreemodel.sip
Expand Up @@ -65,7 +65,7 @@ class QgsLayerTreeModel : QAbstractItemModel
typedef QFlags<QgsLayerTreeModel::Flag> Flags;

//! Set OR-ed combination of model flags
void setFlags( const Flags& f );
void setFlags( Flags f );
//! Enable or disable a model flag
void setFlag( Flag f, bool on = true );
//! Return OR-ed combination of model flags
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsattributetableconfig.sip
Expand Up @@ -107,7 +107,7 @@ class QgsAttributeTableConfig
/**
* Set the style of the action widget
*/
void setActionWidgetStyle( const ActionWidgetStyle& actionWidgetStyle );
void setActionWidgetStyle( ActionWidgetStyle actionWidgetStyle );

/**
* Serialize to XML on layer save
Expand Down Expand Up @@ -165,5 +165,5 @@ class QgsAttributeTableConfig
* Set the sort order
* @note Added in 2.16
*/
void setSortOrder( const Qt::SortOrder& sortOrder );
void setSortOrder( Qt::SortOrder sortOrder );
};
10 changes: 5 additions & 5 deletions python/core/qgsdataitem.sip
Expand Up @@ -160,12 +160,12 @@ class QgsDataItem : QObject
typedef QFlags<QgsDataItem::Capability> Capabilities;

// This will _write_ selected crs in data source
virtual bool setCrs( QgsCoordinateReferenceSystem crs );
virtual bool setCrs( const QgsCoordinateReferenceSystem& crs );

// ### QGIS 3 - rename to capabilities()
virtual Capabilities capabilities2() const;

virtual void setCapabilities( const Capabilities& capabilities );
virtual void setCapabilities( Capabilities capabilities );

// static methods

Expand Down Expand Up @@ -208,7 +208,7 @@ class QgsDataItem : QObject

protected:
virtual void populate( const QVector<QgsDataItem*>& children );
virtual void refresh( QVector<QgsDataItem*> children );
virtual void refresh( const QVector<QgsDataItem*>& children );
/** The item is scheduled to be deleted. E.g. if deleteLater() is called when
* item is in Populating state (createChildren() running in another thread),
* the deferredDelete() returns true and item will be deleted once Populating finished.
Expand Down Expand Up @@ -378,7 +378,7 @@ class QgsDirectoryItem : QgsDataCollectionItem
// static QVector<QLibrary*> mLibraries;

/** Check if the given path is hidden from the browser model */
static bool hiddenPath( QString path );
static bool hiddenPath( const QString& path );

public slots:
virtual void childrenCreated();
Expand Down Expand Up @@ -482,7 +482,7 @@ class QgsZipItem : QgsDataCollectionItem

static QString vsiPrefix( const QString& uri );

static QgsDataItem* itemFromPath( QgsDataItem* parent, QString path, QString name ) /Factory/;
static QgsDataItem* itemFromPath( QgsDataItem* parent, const QString& path, const QString& name ) /Factory/;
//! @note available in python as itemFromFilePath
static QgsDataItem* itemFromPath( QgsDataItem* parent, const QString& filePath, const QString& name, const QString& path ) /Factory,PyName=itemFromFilePath/;

Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsdatetimestatisticalsummary.sip
Expand Up @@ -34,7 +34,7 @@ class QgsDateTimeStatisticalSummary
/** Constructor for QgsDateTimeStatisticalSummary
* @param stats flags for statistics to calculate
*/
QgsDateTimeStatisticalSummary( const QgsDateTimeStatisticalSummary::Statistics& stats = All );
QgsDateTimeStatisticalSummary( QgsDateTimeStatisticalSummary::Statistics stats = All );

/** Returns flags which specify which statistics will be calculated. Some statistics
* are always calculated (eg count).
Expand All @@ -47,7 +47,7 @@ class QgsDateTimeStatisticalSummary
* @param stats flags for statistics to calculate
* @see statistics
*/
void setStatistics( const Statistics& stats );
void setStatistics( Statistics stats );

/** Resets the calculated values
*/
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsinterval.sip
Expand Up @@ -124,7 +124,7 @@ class QgsInterval
*/
void setValid( bool valid );

bool operator==( const QgsInterval& other ) const;
bool operator==( QgsInterval other ) const;

/** Converts a string to an interval
* @param string string to parse
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsmaplayerdependency.sip
Expand Up @@ -19,7 +19,7 @@ class QgsMapLayerDependency
};

//! Standard constructor
QgsMapLayerDependency( QString layerId, Type type = DataDependency, Origin origin = FromUser );
QgsMapLayerDependency( const QString& layerId, Type type = DataDependency, Origin origin = FromUser );

//! Return the dependency type
Type type() const;
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsmaplayerproxymodel.sip
Expand Up @@ -41,7 +41,7 @@ class QgsMapLayerProxyModel : QSortFilterProxyModel
* @param filters are Filter flags
* @note added in 2.3
*/
QgsMapLayerProxyModel* setFilters( const Filters& filters );
QgsMapLayerProxyModel* setFilters( Filters filters );
const Filters& filters() const;

//! offer the possibility to except some layers to be listed
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsmaprenderercustompainterjob.sip
Expand Up @@ -38,7 +38,7 @@ class QgsMapRendererCustomPainterJob : QgsMapRendererJob
* Ideally the "wait for finished" method should not be used at all. The code triggering
* rendering should not need to actively wait for rendering to finish.
*/
void waitForFinishedWithEventLoop( const QEventLoop::ProcessEventsFlags& flags = QEventLoop::AllEvents );
void waitForFinishedWithEventLoop( QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents );

/**
* Render the map synchronously in this thread. The function does not return until the map
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsmapsettings.sip
Expand Up @@ -122,7 +122,7 @@ class QgsMapSettings
typedef QFlags<QgsMapSettings::Flag> Flags;

//! Set combination of flags that will be used for rendering
void setFlags( const Flags& flags );
void setFlags( Flags flags );
//! Enable or disable a particular flag (other flags are not affected)
void setFlag( Flag flag, bool on = true );
//! Return combination of flags used for rendering
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsproject.sip
Expand Up @@ -336,7 +336,7 @@ class QgsProject : QObject
/**
* Set a list of layers which should not be taken into account on map identification
*/
void setNonIdentifiableLayers( QList<QgsMapLayer*> layers );
void setNonIdentifiableLayers( const QList<QgsMapLayer*>& layers );

/**
* Set a list of layers which should not be taken into account on map identification
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsrendercontext.sip
Expand Up @@ -30,7 +30,7 @@ class QgsRenderContext
/** Set combination of flags that will be used for rendering.
* @note added in QGIS 2.14
*/
void setFlags( const QgsRenderContext::Flags& flags );
void setFlags( QgsRenderContext::Flags flags );

/** Enable or disable a particular flag (other flags are not affected)
* @note added in QGIS 2.14
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgssnappingconfig.sip
Expand Up @@ -176,7 +176,7 @@ class QgsSnappingConfig
QgsSnappingConfig::IndividualLayerSettings individualLayerSettings( QgsVectorLayer* vl ) const;

//! set individual layer snappings settings (applied if mode is AdvancedConfiguration)
void setIndividualLayerSettings( QgsVectorLayer* vl, QgsSnappingConfig::IndividualLayerSettings individualLayerSettings );
void setIndividualLayerSettings( QgsVectorLayer* vl, const QgsSnappingConfig::IndividualLayerSettings& individualLayerSettings );

/**
* Compare this configuration to other.
Expand Down
10 changes: 5 additions & 5 deletions python/core/qgssqlstatement.sip
Expand Up @@ -113,7 +113,7 @@ class QgsSQLStatement
* otherwise the original string.
* @see quotedString(), quotedIdentifier()
*/
static QString quotedIdentifierIfNeeded( QString name );
static QString quotedIdentifierIfNeeded( const QString& name );

/** Remove double quotes from an identifier.
* @see quotedIdentifier()
Expand Down Expand Up @@ -340,7 +340,7 @@ class QgsSQLStatement
class NodeFunction : QgsSQLStatement::Node
{
public:
NodeFunction( QString name, QgsSQLStatement::NodeList* args /Transfer/ );
NodeFunction( const QString name, QgsSQLStatement::NodeList* args /Transfer/ );
~NodeFunction();

/** Return function name */
Expand Down Expand Up @@ -474,7 +474,7 @@ class QgsSQLStatement
{
public:
NodeJoin( QgsSQLStatement::NodeTableDef* tabledef /Transfer/, QgsSQLStatement::Node* onExpr /Transfer/, QgsSQLStatement::JoinType type );
NodeJoin( QgsSQLStatement::NodeTableDef* tabledef /Transfer/, QList<QString> usingColumns, QgsSQLStatement::JoinType type );
NodeJoin( QgsSQLStatement::NodeTableDef* tabledef /Transfer/, const QList<QString>& usingColumns, QgsSQLStatement::JoinType type );

/** Table definition */
QgsSQLStatement::NodeTableDef* tableDef() const;
Expand Down Expand Up @@ -525,13 +525,13 @@ class QgsSQLStatement
NodeSelect( QList<QgsSQLStatement::NodeTableDef*> tableList /Transfer/, QList<QgsSQLStatement::NodeSelectedColumn*> columns /Transfer/, bool distinct );

/** Set joins */
void setJoins( QList<QgsSQLStatement::NodeJoin*> joins /Transfer/ );
void setJoins( const QList<QgsSQLStatement::NodeJoin*>& joins /Transfer/ );
/** Append a join */
void appendJoin( QgsSQLStatement::NodeJoin* join /Transfer/ );
/** Set where clause */
void setWhere( QgsSQLStatement::Node* where /Transfer/ );
/** Set order by columns */
void setOrderBy( QList<QgsSQLStatement::NodeColumnSorted*> orderBy /Transfer/ );
void setOrderBy( const QList<QgsSQLStatement::NodeColumnSorted*>& orderBy /Transfer/ );

/** Return the list of tables */
QList<QgsSQLStatement::NodeTableDef*> tables() const;
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsstatisticalsummary.sip
Expand Up @@ -44,7 +44,7 @@ class QgsStatisticalSummary
/** Constructor for QgsStatisticalSummary
* @param stats flags for statistics to calculate
*/
QgsStatisticalSummary( const QgsStatisticalSummary::Statistics& stats = QgsStatisticalSummary::All );
QgsStatisticalSummary( QgsStatisticalSummary::Statistics stats = QgsStatisticalSummary::All );

virtual ~QgsStatisticalSummary();

Expand All @@ -59,7 +59,7 @@ class QgsStatisticalSummary
* @param stats flags for statistics to calculate
* @see statistics
*/
void setStatistics( const QgsStatisticalSummary::Statistics& stats );
void setStatistics( QgsStatisticalSummary::Statistics stats );

/** Resets the calculated values
*/
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsstringstatisticalsummary.sip
Expand Up @@ -38,7 +38,7 @@ class QgsStringStatisticalSummary
/** Constructor for QgsStringStatistics
* @param stats flags for statistics to calculate
*/
QgsStringStatisticalSummary( const QgsStringStatisticalSummary::Statistics& stats = All );
QgsStringStatisticalSummary( QgsStringStatisticalSummary::Statistics stats = All );

/** Returns flags which specify which statistics will be calculated. Some statistics
* are always calculated (eg count).
Expand All @@ -51,7 +51,7 @@ class QgsStringStatisticalSummary
* @param stats flags for statistics to calculate
* @see statistics
*/
void setStatistics( const Statistics& stats );
void setStatistics( Statistics stats );

/** Resets the calculated values
*/
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsvectorfilewriter.sip
Expand Up @@ -208,7 +208,7 @@ class QgsVectorFileWriter
QgsWkbTypes::Type overrideGeometryType = QgsWkbTypes::Unknown,
bool forceMulti = false,
bool includeZ = false,
QgsAttributeList attributes = QgsAttributeList(),
const QgsAttributeList& attributes = QgsAttributeList(),
FieldValueConverter* fieldValueConverter = nullptr
);

Expand Down Expand Up @@ -253,7 +253,7 @@ class QgsVectorFileWriter
QgsWkbTypes::Type overrideGeometryType = QgsWkbTypes::Unknown,
bool forceMulti = false,
bool includeZ = false,
QgsAttributeList attributes = QgsAttributeList(),
const QgsAttributeList& attributes = QgsAttributeList(),
FieldValueConverter* fieldValueConverter = nullptr
);

Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsvectorlayer.sip
Expand Up @@ -547,7 +547,7 @@ class QgsVectorLayer : QgsMapLayer
* @see deselect(QgsFeatureId)
* @see selectByExpression()
*/
void modifySelection( QgsFeatureIds selectIds, QgsFeatureIds deselectIds );
void modifySelection( const QgsFeatureIds& selectIds, const QgsFeatureIds& deselectIds );

/** Select not selected features and deselect selected ones */
void invertSelection();
Expand Down Expand Up @@ -728,7 +728,7 @@ class QgsVectorLayer : QgsMapLayer
*/
bool writeStyle( QDomNode& node, QDomDocument& doc, QString& errorMessage ) const;

bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage, QgsStringMap& props ) const;
bool writeSld( QDomNode& node, QDomDocument& doc, QString& errorMessage, const QgsStringMap& props ) const;
bool readSld( const QDomNode& node, QString& errorMessage );

/**
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsvectorlayereditbuffer.sip
Expand Up @@ -31,7 +31,7 @@ class QgsVectorLayerEditBuffer : QObject
virtual bool deleteFeatures( const QgsFeatureIds& fid );

/** Change feature's geometry */
virtual bool changeGeometry( QgsFeatureId fid, QgsGeometry geom );
virtual bool changeGeometry( QgsFeatureId fid, const QgsGeometry& geom );

/** Changed an attribute value (but does not commit it) */
virtual bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant() );
Expand Down

0 comments on commit 7967110

Please sign in to comment.