Skip to content
Permalink
Browse files
Save and read provider encoding from project file. Fixes bug #1310
git-svn-id: http://svn.osgeo.org/qgis/trunk@10546 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Apr 12, 2009
1 parent a012920 commit de8ea4fc62bb5fbcb3525d29ab36f29b0bd30d68
Showing with 15 additions and 8 deletions.
  1. +15 −8 src/core/qgsvectorlayer.cpp
@@ -2116,11 +2116,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;
@@ -2252,10 +2255,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 de8ea4f

Please sign in to comment.