Skip to content

Commit

Permalink
Removes 'toggle editing' from context menu of read-only layers. Fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
suricactus authored and nyalldawson committed Dec 21, 2020
1 parent ccd5c28 commit a2beeba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/qgsapplayertreeviewmenuprovider.cpp
Expand Up @@ -238,8 +238,9 @@ QMenu *QgsAppLayerTreeViewMenuProvider::createContextMenu()

// allow editing
const QgsVectorDataProvider *provider = vlayer->dataProvider();
if ( provider &&
( provider->capabilities() & QgsVectorDataProvider::EditingCapabilities ) )
if ( provider
&& ( provider->capabilities() & QgsVectorDataProvider::EditingCapabilities )
&& !vlayer->readOnly() )
{
if ( toggleEditingAction )
{
Expand Down

0 comments on commit a2beeba

Please sign in to comment.