Skip to content

Commit

Permalink
Change all signals to use const refs for non trivial objects
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 26, 2015
1 parent 70bff3f commit f1633a1
Show file tree
Hide file tree
Showing 87 changed files with 126 additions and 126 deletions.
2 changes: 1 addition & 1 deletion python/analysis/network/qgsgraphdirector.sip
Expand Up @@ -23,7 +23,7 @@ class QgsGraphDirector : QObject

signals:
void buildProgress( int, int ) const;
void buildMessage( QString ) const;
void buildMessage( const QString& ) const;

public:
//! Destructor
Expand Down
2 changes: 1 addition & 1 deletion python/core/composer/qgsatlascomposition.sip
Expand Up @@ -280,7 +280,7 @@ public:
void toggled( bool );

/** Is emitted when the atlas has an updated status bar message for the composer window*/
void statusMsgChanged( QString message );
void statusMsgChanged( const QString& message );

/** Is emitted when the coverage layer for an atlas changes*/
void coverageLayerChanged( QgsVectorLayer* layer );
Expand Down
2 changes: 1 addition & 1 deletion python/core/layertree/qgslayertreenode.sip
Expand Up @@ -116,7 +116,7 @@ class QgsLayerTreeNode : QObject
//! Emitted when check state of a node within the tree has been changed
void visibilityChanged( QgsLayerTreeNode *node, Qt::CheckState state );
//! Emitted when a custom property of a node within the tree has been changed or removed
void customPropertyChanged( QgsLayerTreeNode *node, QString key );
void customPropertyChanged( QgsLayerTreeNode *node, const QString& key );
//! Emitted when the collapsed/expanded state of a node within the tree has been changed
void expandedChanged( QgsLayerTreeNode *node, bool expanded );

Expand Down
2 changes: 1 addition & 1 deletion python/core/layertree/qgslayertreeregistrybridge.sip
Expand Up @@ -32,6 +32,6 @@ class QgsLayerTreeRegistryBridge : QObject
signals:
//! Tell others we have just added layers to the tree (used in QGIS to auto-select first newly added layer)
//! @note added in 2.6
void addedLayersToLayerTree( QList<QgsMapLayer*> layers );
void addedLayersToLayerTree( const QList<QgsMapLayer*>& layers );

};
2 changes: 1 addition & 1 deletion python/core/qgsgeometryvalidator.sip
Expand Up @@ -16,7 +16,7 @@ class QgsGeometryValidator : QThread
static void validateGeometry( const QgsGeometry *g, QList<QgsGeometry::Error> &errors );

signals:
void errorFound( QgsGeometry::Error );
void errorFound( const QgsGeometry::Error& );

public slots:
void addError( const QgsGeometry::Error& );
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgshttptransaction.sip
Expand Up @@ -93,5 +93,5 @@ class QgsHttpTransaction : QObject
void totalSteps( int theTotalSteps );

/** \brief emit a signal to be caught by qgisapp and display a msg on status bar */
void statusChanged( QString theStatusQString );
void statusChanged( const QString& theStatusQString );
};
2 changes: 1 addition & 1 deletion python/core/qgsmaplayer.sip
Expand Up @@ -471,7 +471,7 @@ class QgsMapLayer : QObject
void drawingProgress( int theProgress, int theTotalSteps );

/** Emit a signal with status (e.g. to be caught by QgisApp and display a msg on status bar) */
void statusChanged( QString theStatus );
void statusChanged( const QString& theStatus );

/** Emit a signal that the layer name has been changed */
void layerNameChanged();
Expand Down
12 changes: 6 additions & 6 deletions python/core/qgsmaplayerregistry.sip
Expand Up @@ -138,7 +138,7 @@ class QgsMapLayerRegistry : QObject
*
* @param theLayerIds A list of ids of the layers which are removed.
*/
void layersWillBeRemoved( QStringList theLayerIds );
void layersWillBeRemoved( const QStringList& theLayerIds );

/**
* Emitted when a layer is removed from the registry
Expand All @@ -147,14 +147,14 @@ class QgsMapLayerRegistry : QObject
*
* @note Consider using {@link layersWillBeRemoved()} instead
*/
void layerWillBeRemoved( QString theLayerId );
void layerWillBeRemoved( const QString& theLayerId );

/**
* Emitted after one or more layers were removed from the registry
*
* @param theLayerIds A list of ids of the layers which were removed.
*/
void layersRemoved( QStringList theLayerIds );
void layersRemoved( const QStringList& theLayerIds );

/**
* Emitted after a layer was removed from the registry
Expand All @@ -163,7 +163,7 @@ class QgsMapLayerRegistry : QObject
*
* @note Consider using {@link layersRemoved()} instead
*/
void layerRemoved( QString theLayerId );
void layerRemoved( const QString& theLayerId );


/**
Expand All @@ -183,7 +183,7 @@ class QgsMapLayerRegistry : QObject
*
* @see legendLayersAdded()
*/
void layersAdded( QList<QgsMapLayer *> theMapLayers );
void layersAdded( const QList<QgsMapLayer *>& theMapLayers );

/**
* Emitted when a layer is added to the registry.
Expand All @@ -202,7 +202,7 @@ class QgsMapLayerRegistry : QObject
*
* @param theMapLayers The {@link QgsMapLayer}s which are added to the legend.
*/
void legendLayersAdded( QList<QgsMapLayer*> theMapLayers );
void legendLayersAdded( const QList<QgsMapLayer*>& theMapLayers );

private:
QgsMapLayerRegistry(); // private 'cause it's a singleton
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsmessagelog.sip
Expand Up @@ -18,7 +18,7 @@ class QgsMessageLog : QObject
static void logMessage( const QString& message, const QString& tag = QString::null, MessageLevel level = WARNING );

signals:
void messageReceived( QString message, QString tag, MessageLevel level );
void messageReceived( const QString& message, const QString& tag, MessageLevel level );

private:
QgsMessageLog();
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsproject.sip
Expand Up @@ -317,14 +317,14 @@ class QgsProject : QObject
void projectSaved();

//! emitted when an old project file is read.
void oldProjectVersionWarning( QString );
void oldProjectVersionWarning( const QString& );

//! emitted when a layer from a projects was read
// @param i current layer
// @param n number of layers
void layerLoaded( int i, int n );

void loadingLayer( QString );
void loadingLayer( const QString& );

void snapSettingsChanged();

Expand Down
6 changes: 3 additions & 3 deletions python/core/qgsvectorlayer.sip
Expand Up @@ -435,7 +435,7 @@ class QgsVectorLayer : QgsMapLayer

/**
* Change selection to the new set of features. Dismisses the current selection.
* Will emit the { @link selectionChanged( QgsFeatureIds, QgsFeatureIds, bool ) } signal with the
* Will emit the { @link selectionChanged( const QgsFeatureIds&, const QgsFeatureIds&, bool ) } signal with the
* clearAndSelect flag set.
*
* @param ids The ids which will be the new selection
Expand Down Expand Up @@ -1317,7 +1317,7 @@ class QgsVectorLayer : QgsMapLayer
* @param deselected Ids of all features which have previously been selected but are not any more
* @param clearAndSelect In case this is set to true, the old selection was dismissed and the new selection corresponds to selected
*/
void selectionChanged( const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect );
void selectionChanged( const QgsFeatureIds& selected, const QgsFeatureIds& deselected, const bool clearAndSelect );

/** This signal is emitted when selection was changed */
void selectionChanged();
Expand Down Expand Up @@ -1369,7 +1369,7 @@ class QgsVectorLayer : QgsMapLayer
*
* @param fids The feature ids that have been deleted.
*/
void featuresDeleted( QgsFeatureIds fids );
void featuresDeleted( const QgsFeatureIds& fids );
/**
* Is emitted, whenever the fields available from this layer have been changed.
* This can be due to manually adding attributes or due to a join.
Expand Down
2 changes: 1 addition & 1 deletion python/core/raster/qgsrasterdataprovider.sip
Expand Up @@ -276,7 +276,7 @@ class QgsRasterDataProvider : QgsDataProvider, QgsRasterInterface
signals:
/** Emit a signal to notify of the progress event.
* Emitted theProgress is in percents (0.0-100.0) */
void progress( int theType, double theProgress, QString theMessage );
void progress( int theType, double theProgress, const QString& theMessage );
void progressUpdate( int theProgress );

protected:
Expand Down
2 changes: 1 addition & 1 deletion python/core/symbology-ng/qgsstylev2.sip
Expand Up @@ -252,7 +252,7 @@ class QgsStyleV2 : QObject
bool importXML( const QString& filename );

signals:
void symbolSaved( QString name, QgsSymbolV2* symbol );
void symbolSaved( const QString& name, QgsSymbolV2* symbol );

protected:
//! convenience function to open the DB and return a sqlite3 object
Expand Down
2 changes: 1 addition & 1 deletion python/gui/attributetable/qgsattributetableview.sip
Expand Up @@ -85,7 +85,7 @@ class QgsAttributeTableView : QTableView
* @param atIndex The QModelIndex, to which the context menu belongs. Relative to the source model.
* In most cases, this will be a @link QgsAttributeTableFilterModel @endlink
*/
void willShowContextMenu( QMenu* menu, QModelIndex atIndex );
void willShowContextMenu( QMenu* menu, const QModelIndex& atIndex );

void finished();

Expand Down
2 changes: 1 addition & 1 deletion python/gui/attributetable/qgsdualview.sip
Expand Up @@ -133,7 +133,7 @@ class QgsDualView : QStackedWidget
* Is emitted, whenever the display expression is successfully changed
* @param expression The expression that was applied
*/
void displayExpressionChanged( const QString expression );
void displayExpressionChanged( const QString& expression );

/**
* Is emitted, whenever the filter changes
Expand Down
2 changes: 1 addition & 1 deletion python/gui/attributetable/qgsfeaturelistview.sip
Expand Up @@ -94,7 +94,7 @@ class QgsFeatureListView : QListView
* Is emitted, whenever the display expression is successfully changed
* @param expression The expression that was applied
*/
void displayExpressionChanged( const QString expression );
void displayExpressionChanged( const QString& expression );

//void aboutToChangeEditSelection( bool& ok );

Expand Down
2 changes: 1 addition & 1 deletion python/gui/attributetable/qgsfeatureselectionmodel.sip
Expand Up @@ -42,7 +42,7 @@ class QgsFeatureSelectionModel : QItemSelectionModel
*
* @param indexes The model indexes which need to be repainted
*/
void requestRepaint( QModelIndexList indexes );
void requestRepaint( const QModelIndexList& indexes );

/**
* Request a repaint of the visible items of connected views.
Expand Down
4 changes: 2 additions & 2 deletions python/gui/attributetable/qgsifeatureselectionmanager.sip
Expand Up @@ -50,7 +50,7 @@ class QgsIFeatureSelectionManager : QObject

/**
* Change selection to the new set of features. Dismisses the current selection.
* Will emit the { @link selectionChanged( QgsFeatureIds, QgsFeatureIds, bool ) } signal with the
* Will emit the { @link selectionChanged( const QgsFeatureIds&, const QgsFeatureIds&, bool ) } signal with the
* clearAndSelect flag set.
*
* @param ids The ids which will be the new selection
Expand All @@ -73,5 +73,5 @@ class QgsIFeatureSelectionManager : QObject
* @param deselected Ids of all features which have previously been selected but are not any more
* @param clearAndSelect In case this is set to true, the old selection was dismissed and the new selection corresponds to selected
*/
void selectionChanged( const QgsFeatureIds selected, const QgsFeatureIds deselected, const bool clearAndSelect );
void selectionChanged( const QgsFeatureIds& selected, const QgsFeatureIds& deselected, const bool clearAndSelect );
};
2 changes: 1 addition & 1 deletion python/gui/editorwidgets/qgsrelationreferencewidget.sip
Expand Up @@ -70,5 +70,5 @@ class QgsRelationReferenceWidget : QWidget
void init();

signals:
void foreignKeyChanged( QVariant );
void foreignKeyChanged( const QVariant& );
};
2 changes: 1 addition & 1 deletion python/gui/qgisinterface.sip
Expand Up @@ -543,5 +543,5 @@ class QgisInterface : QObject
@note
added in version 2.7
*/
void layerSavedAs( QgsMapLayer* l, QString path );
void layerSavedAs( QgsMapLayer* l, const QString& path );
};
2 changes: 1 addition & 1 deletion python/gui/qgsattributeform.sip
Expand Up @@ -94,7 +94,7 @@ class QgsAttributeForm : QWidget
* @param attribute The name of the attribute that changed.
* @param value The new value of the attribute.
*/
void attributeChanged( QString attribute, const QVariant& value );
void attributeChanged( const QString& attribute, const QVariant& value );

/**
* Will be emitted before the feature is saved. Use this signal to perform sanity checks.
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsfieldcombobox.sip
Expand Up @@ -33,7 +33,7 @@ class QgsFieldComboBox : QComboBox

signals:
//! the signal is emitted when the currently selected field changes
void fieldChanged( QString fieldName );
void fieldChanged( const QString& fieldName );

public slots:
//! set the layer of which the fields are listed
Expand Down
4 changes: 2 additions & 2 deletions python/gui/qgsfieldexpressionwidget.sip
Expand Up @@ -63,10 +63,10 @@ class QgsFieldExpressionWidget : QWidget

signals:
//! the signal is emitted when the currently selected field changes
void fieldChanged( QString fieldName );
void fieldChanged( const QString& fieldName );

//! fieldChanged signal with indication of the validity of the expression
void fieldChanged( QString fieldName, bool isValid );
void fieldChanged( const QString& fieldName, bool isValid );

// void returnPressed();

Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgslegendinterface.sip
Expand Up @@ -75,7 +75,7 @@ class QgsLegendInterface : QObject
void groupRelationsChanged();

/* //! emitted when an item (group/layer) is added */
void itemAdded( QModelIndex index );
void itemAdded( const QModelIndex& index );

/* //! emitted when an item (group/layer) is removed */
void itemRemoved();
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmaplayeractionregistry.sip
Expand Up @@ -45,7 +45,7 @@ class QgsMapLayerAction : QAction

signals:
/** Triggered when action has been run for a specific list of features */
void triggeredForFeatures( QgsMapLayer* layer, const QList<QgsFeature> featureList );
void triggeredForFeatures( QgsMapLayer* layer, const QList<QgsFeature>& featureList );

/** Triggered when action has been run for a specific feature */
void triggeredForFeature( QgsMapLayer* layer, const QgsFeature& feature );
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmaptool.sip
Expand Up @@ -126,7 +126,7 @@ class QgsMapTool : QObject

signals:
//! emit a message
void messageEmitted( QString message, QgsMessageBar::MessageLevel = QgsMessageBar::INFO );
void messageEmitted( const QString& message, QgsMessageBar::MessageLevel = QgsMessageBar::INFO );

//! emit signal to clear previous message
void messageDiscarded();
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmaptoolidentify.sip
Expand Up @@ -87,7 +87,7 @@ class QgsMapToolIdentify : QgsMapTool

signals:
void identifyProgress( int, int );
void identifyMessage( QString );
void identifyMessage( const QString& );
void changedRasterResults( QList<QgsMapToolIdentify::IdentifyResult>& );

protected:
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsmessagebaritem.sip
Expand Up @@ -41,6 +41,6 @@ class QgsMessageBarItem: QWidget

signals:
//! emitted when the message level has changed
void styleChanged( QString styleSheet );
void styleChanged( const QString& styleSheet );
};

2 changes: 1 addition & 1 deletion python/gui/qgsprojectionselectionwidget.sip
Expand Up @@ -46,7 +46,7 @@ class QgsProjectionSelectionWidget : QWidget

/** Emitted when the selected CRS is changed
*/
void crsChanged( QgsCoordinateReferenceSystem );
void crsChanged( const QgsCoordinateReferenceSystem& );

public slots:

Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsprojectionselector.sip
Expand Up @@ -97,7 +97,7 @@ class QgsProjectionSelector : QWidget
void resizeEvent( QResizeEvent * theEvent );

signals:
void sridSelected( QString theSRID );
void sridSelected( const QString& theSRID );
//! Refresh any listening canvases
void refresh();
//! Let listeners know if find has focus so they can adjust the default button
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/network/qgsgraphdirector.h
Expand Up @@ -38,7 +38,7 @@ class ANALYSIS_EXPORT QgsGraphDirector : public QObject

signals:
void buildProgress( int, int ) const;
void buildMessage( QString ) const;
void buildMessage( const QString& ) const;

public:
//! Destructor
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscompositionwidget.h
Expand Up @@ -70,7 +70,7 @@ class QgsCompositionWidget: public QWidget, private Ui::QgsCompositionWidgetBase

signals:
/** Is emitted when page orientation changes*/
void pageOrientationChanged( QString orientation );
void pageOrientationChanged( const QString& orientation );

private slots:
/* when a new map is added */
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgisapp.h
Expand Up @@ -1281,7 +1281,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow

/** Signal emitted when the current theme is changed so plugins
* can change there tool button icons. */
void currentThemeChanged( QString );
void currentThemeChanged( const QString& );

/** This signal is emitted when a new composer instance has been created
*/
Expand All @@ -1303,7 +1303,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
/** This signal is emitted when a layer has been saved using save as
@note added in version 2.7
*/
void layerSavedAs( QgsMapLayer* l, QString path );
void layerSavedAs( QgsMapLayer* l, const QString& path );

private:
/** This method will open a dialog so the user can select GDAL sublayers to load
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisappinterface.h
Expand Up @@ -478,7 +478,7 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
virtual int messageTimeout() override;

signals:
void currentThemeChanged( QString );
void currentThemeChanged( const QString& );

private slots:

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolidentifyaction.h
Expand Up @@ -68,7 +68,7 @@ class APP_EXPORT QgsMapToolIdentifyAction : public QgsMapToolIdentify

signals:
void identifyProgress( int, int );
void identifyMessage( QString );
void identifyMessage( const QString& );
void copyToClipboard( QgsFeatureStore & );

private slots:
Expand Down

0 comments on commit f1633a1

Please sign in to comment.