Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Use the newly added QgsVectorLayer::supportsEditing
- Loading branch information
|
@@ -11082,7 +11082,7 @@ bool QgisApp::toggleEditing( QgsMapLayer *layer, bool allowCancel ) |
|
|
|
|
|
if ( !vlayer->isEditable() && !vlayer->readOnly() ) |
|
|
{ |
|
|
if ( !( vlayer->dataProvider()->capabilities() & QgsVectorDataProvider::EditingCapabilities ) ) |
|
|
if ( !vlayer->supportsEditing() ) |
|
|
{ |
|
|
mActionToggleEditing->setChecked( false ); |
|
|
mActionToggleEditing->setEnabled( false ); |
|
|
|
@@ -56,7 +56,7 @@ bool QgsGuiVectorLayerTools::startEditing( QgsVectorLayer *layer ) const |
|
|
|
|
|
if ( !layer->isEditable() && !layer->readOnly() ) |
|
|
{ |
|
|
if ( !( layer->dataProvider()->capabilities() & QgsVectorDataProvider::EditingCapabilities ) ) |
|
|
if ( !layer->supportsEditing() ) |
|
|
{ |
|
|
QgisApp::instance()->messageBar()->pushMessage( tr( "Start editing failed" ), |
|
|
tr( "Provider cannot be opened for editing" ), |
|
|
|
@@ -1434,12 +1434,7 @@ bool QgsVectorLayer::startEditing() |
|
|
} |
|
|
|
|
|
// allow editing if provider supports any of the capabilities |
|
|
if ( !( mDataProvider->capabilities() & QgsVectorDataProvider::EditingCapabilities ) ) |
|
|
{ |
|
|
return false; |
|
|
} |
|
|
|
|
|
if ( mReadOnly ) |
|
|
if ( supportsEditing() ) |
|
|
{ |
|
|
return false; |
|
|
} |
|
|