Skip to content

Commit

Permalink
restore QgsVectorLayer::setReadOnly (followup 4cd1e38)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Nov 20, 2015
1 parent bbbf8a5 commit 79640ef
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion python/core/qgsvectorlayer.sip
Expand Up @@ -1006,7 +1006,7 @@ class QgsVectorLayer : QgsMapLayer
/** Make layer read-only (editing disabled) or not
* @return false if the layer is in editing yet
*/
bool setFieldEditable( bool editable = true );
bool setReadOnly( bool readonly = true );

/**
* Make layer editable.
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.cpp
Expand Up @@ -2719,7 +2719,7 @@ bool QgsVectorLayer::isReadOnly() const
return mReadOnly;
}

bool QgsVectorLayer::setFieldEditable( bool readonly )
bool QgsVectorLayer::setReadOnly( bool readonly )
{
// exit if the layer is in editing mode
if ( readonly && mEditBuffer )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.h
Expand Up @@ -1126,7 +1126,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
/** Make layer read-only (editing disabled) or not
* @return false if the layer is in editing yet
*/
bool setFieldEditable( bool editable = true );
bool setReadOnly( bool readonly = true );

/**
* Make layer editable.
Expand Down
Expand Up @@ -78,7 +78,7 @@ QgsGeometryCheckerResultTab::QgsGeometryCheckerResultTab( QgisInterface* iface,
QgsGeometryCheckerResultTab::~QgsGeometryCheckerResultTab()
{
if ( mFeaturePool->getLayer() )
mFeaturePool->getLayer()->setFieldEditable( false );
mFeaturePool->getLayer()->setReadOnly( false );
delete mChecker;
delete mFeaturePool;
qDeleteAll( mCurrentRubberBands );
Expand Down
Expand Up @@ -286,7 +286,7 @@ void QgsGeometryCheckerSetupTab::runChecks()
emit checkerStarted( checker, featurePool );

/** Add result layer (do this after checkerStarted, otherwise warning about removing of result layer may appear) **/
layer->setFieldEditable( true );
layer->setReadOnly( true );
if ( ui.radioButtonOutputNew->isChecked() )
{
QgsMapLayerRegistry::instance()->addMapLayers( QList<QgsMapLayer*>() << layer );
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/geometry_snapper/qgsgeometrysnapperdialog.cpp
Expand Up @@ -261,7 +261,7 @@ void QgsGeometrySnapperDialog::run()
}
}

layer->setFieldEditable( true );
layer->setReadOnly( true );
if ( ui.radioButtonOutputNew->isChecked() )
{
QgsMapLayerRegistry::instance()->addMapLayers( QList<QgsMapLayer*>() << layer );
Expand Down Expand Up @@ -294,7 +294,7 @@ void QgsGeometrySnapperDialog::run()
ui.progressBar->hide();
ui.widgetInputs->setEnabled( true );

layer->setFieldEditable( false );
layer->setReadOnly( false );

/** Refresh canvas **/
mIface->mapCanvas()->refresh();
Expand Down

0 comments on commit 79640ef

Please sign in to comment.