Skip to content
Permalink
Browse files

Remove duplicate selectionChanged signal from QgsVectorLayer

If you don't want the extra info, just don't capture it...
  • Loading branch information
nyalldawson committed Nov 14, 2016
1 parent d3f5314 commit 4a5faa083f1e737edb7ee680c9d1f841fdb369c9
@@ -1504,7 +1504,7 @@ displayExpression instead. For the map tip use mapTipTemplate() instead.
- saveStyleToDatabase(): msgError argument is correctly declared as output argument
- getStyleFromDatabase(): msgError argument is correctly declared as output argument
- loadNamedStyle(): theResultFlag argument is correctly declared as output argument

- The duplicate selectionChanged() signal was removed. Use selectionChanged( const QgsFeatureIds&, const QgsFeatureIds&, const bool ) instead.

QgsVectorLayerEditBuffer {#qgis_api_break_3_0_QgsVectorLayerEditBuffer}
------------------------
@@ -1548,9 +1548,6 @@ class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator
*/
void selectionChanged( const QgsFeatureIds& selected, const QgsFeatureIds& deselected, const bool clearAndSelect );

/** This signal is emitted when selection was changed */
void selectionChanged();

/** This signal is emitted when modifications has been done on layer */
void layerModified();

@@ -181,7 +181,7 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
connect( mLayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) );
connect( mLayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
connect( mLayer, SIGNAL( destroyed() ), this, SLOT( close() ) );
connect( mLayer, SIGNAL( selectionChanged() ), this, SLOT( updateTitle() ) );
connect( mLayer, &QgsVectorLayer::selectionChanged, this, &QgsAttributeTableDialog::updateTitle );
connect( mLayer, SIGNAL( featureAdded( QgsFeatureId ) ), this, SLOT( updateTitle() ) );
connect( mLayer, SIGNAL( featuresDeleted( QgsFeatureIds ) ), this, SLOT( updateTitle() ) );
connect( mLayer, SIGNAL( attributeAdded( int ) ), this, SLOT( columnBoxInit() ) );
@@ -251,14 +251,14 @@ void QgsStatisticalSummaryDockWidget::layerChanged( QgsMapLayer *layer )
QgsVectorLayer* newLayer = dynamic_cast< QgsVectorLayer* >( layer );
if ( mLayer && mLayer != newLayer )
{
disconnect( mLayer, SIGNAL( selectionChanged() ), this, SLOT( layerSelectionChanged() ) );
disconnect( mLayer, &QgsVectorLayer::selectionChanged, this, &QgsStatisticalSummaryDockWidget::layerSelectionChanged );
}

mLayer = newLayer;

if ( mLayer )
{
connect( mLayer, SIGNAL( selectionChanged() ), this, SLOT( layerSelectionChanged() ) );
connect( mLayer, &QgsVectorLayer::selectionChanged, this, &QgsStatisticalSummaryDockWidget::layerSelectionChanged );
}

mFieldExpressionWidget->setLayer( mLayer );
@@ -294,7 +294,7 @@ void QgsStatisticalSummaryDockWidget::layersRemoved( const QStringList& layers )
{
if ( mLayer && layers.contains( mLayer->id() ) )
{
disconnect( mLayer, SIGNAL( selectionChanged() ), this, SLOT( layerSelectionChanged() ) );
disconnect( mLayer, &QgsVectorLayer::selectionChanged, this, &QgsStatisticalSummaryDockWidget::layerSelectionChanged );
mLayer = nullptr;
}
}
@@ -155,8 +155,7 @@ QgsVectorLayer::QgsVectorLayer( const QString& vectorLayerPath,
setDataSource( vectorLayerPath, baseName, providerKey, loadDefaultStyleFlag );
}

connect( this, SIGNAL( selectionChanged( QgsFeatureIds, QgsFeatureIds, bool ) ), this, SIGNAL( selectionChanged() ) );
connect( this, SIGNAL( selectionChanged( QgsFeatureIds, QgsFeatureIds, bool ) ), this, SIGNAL( repaintRequested() ) );
connect( this, &QgsVectorLayer::selectionChanged, this, &QgsVectorLayer::repaintRequested );
connect( QgsProject::instance()->relationManager(), &QgsRelationManager::relationsLoaded, this, &QgsVectorLayer::onRelationsLoaded );

// Default simplify drawing settings
@@ -1691,9 +1691,6 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
*/
void selectionChanged( const QgsFeatureIds& selected, const QgsFeatureIds& deselected, const bool clearAndSelect );

//! This signal is emitted when selection was changed
void selectionChanged();

//! This signal is emitted when modifications has been done on layer
void layerModified();

@@ -38,7 +38,7 @@ QgsAttributeTableFilterModel::QgsAttributeTableFilterModel( QgsMapCanvas* canvas
setSourceModel( sourceModel );
setDynamicSortFilter( true );
setSortRole( QgsAttributeTableModel::SortRole );
connect( layer(), SIGNAL( selectionChanged() ), SLOT( selectionChanged() ) );
connect( layer(), &QgsVectorLayer::selectionChanged, this, &QgsAttributeTableFilterModel::selectionChanged );
}

bool QgsAttributeTableFilterModel::lessThan( const QModelIndex &left, const QModelIndex &right ) const
@@ -21,7 +21,7 @@ QgsVectorLayerSelectionManager::QgsVectorLayerSelectionManager( QgsVectorLayer*
: QgsIFeatureSelectionManager( parent )
, mLayer( layer )
{
connect( mLayer, SIGNAL( selectionChanged( QgsFeatureIds, QgsFeatureIds, bool ) ), this, SIGNAL( selectionChanged( QgsFeatureIds, QgsFeatureIds, bool ) ) );
connect( mLayer, &QgsVectorLayer::selectionChanged, this, &QgsVectorLayerSelectionManager::selectionChanged );
}

int QgsVectorLayerSelectionManager::selectedFeatureCount()
@@ -78,7 +78,7 @@ QgsAttributeForm::QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &featur
connect( vl, &QgsVectorLayer::updatedFields, this, &QgsAttributeForm::onUpdatedFields );
connect( vl, &QgsVectorLayer::beforeAddingExpressionField, this, &QgsAttributeForm::preventFeatureRefresh );
connect( vl, &QgsVectorLayer::beforeRemovingExpressionField, this, &QgsAttributeForm::preventFeatureRefresh );
connect( vl, SIGNAL( selectionChanged() ), this, SLOT( layerSelectionChanged() ) );
connect( vl, &QgsVectorLayer::selectionChanged, this, &QgsAttributeForm::layerSelectionChanged );

// constraints management
updateAllConstraints();
@@ -336,7 +336,7 @@ void QgsMapCanvas::setLayerSet( QList<QgsMapCanvasLayer> &layers )
QgsVectorLayer *isVectLyr = qobject_cast<QgsVectorLayer *>( currentLayer );
if ( isVectLyr )
{
disconnect( currentLayer, SIGNAL( selectionChanged() ), this, SLOT( selectionChangedSlot() ) );
disconnect( isVectLyr, &QgsVectorLayer::selectionChanged, this, &QgsMapCanvas::selectionChangedSlot );
}
}

@@ -354,7 +354,7 @@ void QgsMapCanvas::setLayerSet( QList<QgsMapCanvasLayer> &layers )
QgsVectorLayer *isVectLyr = qobject_cast<QgsVectorLayer *>( currentLayer );
if ( isVectLyr )
{
connect( currentLayer, SIGNAL( selectionChanged() ), this, SLOT( selectionChangedSlot() ) );
connect( isVectLyr, &QgsVectorLayer::selectionChanged, this, &QgsMapCanvas::selectionChangedSlot );
}
}

@@ -1388,8 +1388,7 @@ void QgsGrassModuleSelection::onModeChanged()
if ( vectorLayer )
{
onLayerSelectionChanged();
connect( vectorLayer, SIGNAL( selectionChanged( const QgsFeatureIds, const QgsFeatureIds, const bool ) ),
SLOT( onLayerSelectionChanged() ) );
connect( vectorLayer, &QgsVectorLayer::selectionChanged, this, &QgsGrassModuleSelection::onLayerSelectionChanged );
}
}
}
@@ -125,23 +125,23 @@ void QgsSpatialQueryDialog::setLayer( bool isTarget, int index )
{
if ( mLayerTarget )
{
disconnect( mLayerTarget, SIGNAL( selectionChanged() ),
this, SLOT( signal_layerTarget_selectionFeaturesChanged() ) );
disconnect( mLayerTarget, &QgsVectorLayer::selectionChanged,
this, &QgsSpatialQueryDialog::signal_layerTarget_selectionFeaturesChanged );
}
mLayerTarget = getLayerFromCombobox( isTarget, index );
connect( mLayerTarget, SIGNAL( selectionChanged() ),
this, SLOT( signal_layerTarget_selectionFeaturesChanged() ) );
connect( mLayerTarget, &QgsVectorLayer::selectionChanged,
this, &QgsSpatialQueryDialog::signal_layerTarget_selectionFeaturesChanged );
}
else
{
if ( mLayerReference )
{
disconnect( mLayerReference, SIGNAL( selectionChanged() ),
this, SLOT( signal_layerReference_selectionFeaturesChanged() ) );
disconnect( mLayerReference, &QgsVectorLayer::selectionChanged,
this, &QgsSpatialQueryDialog::signal_layerReference_selectionFeaturesChanged );
}
mLayerReference = getLayerFromCombobox( isTarget, index );
connect( mLayerReference, SIGNAL( selectionChanged() ),
this, SLOT( signal_layerReference_selectionFeaturesChanged() ) );
connect( mLayerReference, &QgsVectorLayer::selectionChanged,
this, &QgsSpatialQueryDialog::signal_layerReference_selectionFeaturesChanged );
}
} // void QgsSpatialQueryDialog::setLayer(bool isTarget, int index)

@@ -369,14 +369,14 @@ void QgsSpatialQueryDialog::disconnectAll()

if ( mLayerTarget )
{
disconnect( mLayerTarget, SIGNAL( selectionChanged() ),
this, SLOT( signal_layerTarget_selectionFeaturesChanged() ) );
disconnect( mLayerTarget, &QgsVectorLayer::selectionChanged,
this, &QgsSpatialQueryDialog::signal_layerTarget_selectionFeaturesChanged );

}
if ( mLayerReference )
{
disconnect( mLayerReference, SIGNAL( selectionChanged() ),
this, SLOT( signal_layerReference_selectionFeaturesChanged() ) );
disconnect( mLayerReference, &QgsVectorLayer::selectionChanged,
this, &QgsSpatialQueryDialog::signal_layerReference_selectionFeaturesChanged );
}
} // QgsSpatialQueryDialog::disconnectAll()

0 comments on commit 4a5faa0

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