Skip to content
Permalink
Browse files
Fix for save and read layer properties
git-svn-id: http://svn.osgeo.org/qgis/trunk@15849 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Apr 29, 2011
1 parent 326d7a7 commit f1b621be744aa8c177084c3a135f6366a5853a92
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/core/qgsmaplayer.cpp
@@ -846,7 +846,10 @@ void QgsMapLayer::readCustomProperties( const QDomNode& layerNode, const QString
if ( propsNode.isNull() ) // no properties stored...
return;

mCustomProperties.clear();
if ( keyStartsWith.isEmpty() )
{
mCustomProperties.clear();
}

QDomNodeList nodes = propsNode.childNodes();

@@ -869,6 +872,13 @@ void QgsMapLayer::readCustomProperties( const QDomNode& layerNode, const QString

void QgsMapLayer::writeCustomProperties( QDomNode & layerNode, QDomDocument & doc ) const
{
//remove already existing <customproperties> tags
QDomNodeList propertyList = layerNode.toElement().elementsByTagName( "customproperties" );
for ( int i = 0; i < propertyList.size(); ++i )
{
layerNode.removeChild( propertyList.at( i ) );
}

QDomElement propsElement = doc.createElement( "customproperties" );

for ( QMap<QString, QVariant>::const_iterator it = mCustomProperties.constBegin(); it != mCustomProperties.constEnd(); ++it )

0 comments on commit f1b621b

Please sign in to comment.