Skip to content
Permalink
Browse files
Optimise passing of variables by ref/value
  • Loading branch information
nyalldawson committed Oct 24, 2016
1 parent 8a742e9 commit 44289084e966b42921ce0b789d2f22d0d8310596
Show file tree
Hide file tree
Showing 257 changed files with 477 additions and 469 deletions.
@@ -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*/
@@ -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 );
};
@@ -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
@@ -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.
@@ -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
@@ -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 );
@@ -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;
@@ -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();
@@ -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 */
@@ -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 );

@@ -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 */
@@ -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 );

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

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