Skip to content
Permalink
Browse files

[Feature] Save readonly mode of vector layers in project

  • Loading branch information
m-kuhn committed Mar 29, 2016
1 parent d06c4f8 commit 1c59eff12dfe0aa8824cf0e89535864c48ef1041
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/core/qgsvectorlayer.cpp
@@ -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() )
{
@@ -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 );

0 comments on commit 1c59eff

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