Skip to content
Permalink
Browse files
backport fix for #1310
git-svn-id: http://svn.osgeo.org/qgis/branches/Version-1_0@10547 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Apr 12, 2009
1 parent dac06fe commit c9743b552ab0644ecb295e9eb57c53123e42a02a
Showing with 15 additions and 8 deletions.
  1. +15 −8 src/core/qgsvectorlayer.cpp
@@ -2102,11 +2102,14 @@ bool QgsVectorLayer::readXml( QDomNode & layer_node )
return false;
}

//read provider encoding
QDomNode encodingNode = layer_node.namedItem( "encoding" );
if ( ! encodingNode.isNull() && mDataProvider )
QDomElement pkeyElem = pkeyNode.toElement();
if(!pkeyElem.isNull())
{
mDataProvider->setEncoding( encodingNode.toElement().text() );
QString encodingString = pkeyElem.attribute("encoding");
if(!encodingString.isEmpty())
{
mDataProvider->setEncoding(encodingString);
}
}

QString errorMsg;
@@ -2226,10 +2229,14 @@ bool QgsVectorLayer::writeXml( QDomNode & layer_node,
mapLayerNode.setAttribute( "geometry", QGis::qgisVectorGeometryType[geometryType()] );

// add provider node
QDomElement provider = document.createElement( "provider" );
QDomText providerText = document.createTextNode( providerType() );
provider.appendChild( providerText );
layer_node.appendChild( provider );
if(mDataProvider)
{
QDomElement provider = document.createElement( "provider" );
provider.setAttribute("encoding", mDataProvider->encoding());
QDomText providerText = document.createTextNode( providerType() );
provider.appendChild( providerText );
layer_node.appendChild( provider );
}

// renderer specific settings

0 comments on commit c9743b5

Please sign in to comment.