Skip to content
Permalink
Browse files

restore QgsVectorLayer::setReadOnly (followup 4cd1e38)

  • Loading branch information
jef-n committed Nov 20, 2015
1 parent bbbf8a5 commit 79640ef8051fe75b6db0b9182272fd647c3783aa
@@ -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.
@@ -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 )
@@ -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.
@@ -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 );
@@ -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 );
@@ -261,7 +261,7 @@ void QgsGeometrySnapperDialog::run()
}
}

layer->setFieldEditable( true );
layer->setReadOnly( true );
if ( ui.radioButtonOutputNew->isChecked() )
{
QgsMapLayerRegistry::instance()->addMapLayers( QList<QgsMapLayer*>() << layer );
@@ -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();

0 comments on commit 79640ef

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