@@ -8940,6 +8940,7 @@ void QgisApp::layerSubsetString()
8940
8940
if ( qb->exec() && ( subsetBefore != qb->sql() ) && mLayerTreeView )
8941
8941
{
8942
8942
mLayerTreeView->refreshLayerSymbology( vlayer->id() );
8943
+ activateDeactivateLayerRelatedActions( vlayer );
8943
8944
}
8944
8945
}
8945
8946
@@ -11089,14 +11090,13 @@ void QgisApp::layersWereAdded( const QList<QgsMapLayer *> &layers )
11089
11090
connect( vlayer, &QgsVectorLayer::labelingFontNotFound, this, &QgisApp::labelingFontNotFound );
11090
11091
11091
11092
QgsVectorDataProvider *vProvider = vlayer->dataProvider();
11092
- if ( vProvider && vProvider->capabilities() & QgsVectorDataProvider::EditingCapabilities )
11093
- {
11094
- connect( vlayer, &QgsVectorLayer::layerModified, this, &QgisApp::updateLayerModifiedActions );
11095
- connect( vlayer, &QgsVectorLayer::editingStarted, this, &QgisApp::layerEditStateChanged );
11096
- connect( vlayer, &QgsVectorLayer::editingStopped, this, &QgisApp::layerEditStateChanged );
11097
- connect( vlayer, &QgsVectorLayer::readOnlyChanged, this, &QgisApp::layerEditStateChanged );
11098
- }
11099
-
11093
+ // Do not check for layer editing capabilities because they may change
11094
+ // (for example when subsetString is added/removed) and signals need to
11095
+ // be in place in order to update the GUI
11096
+ connect( vlayer, &QgsVectorLayer::layerModified, this, &QgisApp::updateLayerModifiedActions );
11097
+ connect( vlayer, &QgsVectorLayer::editingStarted, this, &QgisApp::layerEditStateChanged );
11098
+ connect( vlayer, &QgsVectorLayer::editingStopped, this, &QgisApp::layerEditStateChanged );
11099
+ connect( vlayer, &QgsVectorLayer::readOnlyChanged, this, &QgisApp::layerEditStateChanged );
11100
11100
connect( vlayer, &QgsVectorLayer::raiseError, this, &QgisApp::onLayerError );
11101
11101
11102
11102
provider = vProvider;
0 commit comments