Skip to content

Commit

Permalink
[Feature] Save readonly mode of vector layers in project
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Mar 29, 2016
1 parent d06c4f8 commit 1c59eff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -1421,6 +1421,10 @@ bool QgsVectorLayer::readXml( const QDomNode& layer_node )
return false;
}

QDomElement mapLayerNode = layer_node.toElement();
if ( mapLayerNode.attribute( "readOnly", "0" ).toInt() == 1 )
mReadOnly = true;

QDomElement pkeyElem = pkeyNode.toElement();
if ( !pkeyElem.isNull() )
{
Expand Down Expand Up @@ -1642,6 +1646,9 @@ bool QgsVectorLayer::writeXml( QDomNode & layer_node,
layer_node.appendChild( provider );
}

// save readonly state
mapLayerNode.setAttribute( "readOnly", mReadOnly );

// save preview expression
QDomElement prevExpElem = document.createElement( "previewExpression" );
QDomText prevExpText = document.createTextNode( mDisplayExpression );
Expand Down

0 comments on commit 1c59eff

Please sign in to comment.