Skip to content
Permalink
Browse files

read source from provider before saving memory layer (fixes #8997)

(cherry picked from commit dbc0f07)
  • Loading branch information
SebDieBln authored and jef-n committed Jan 15, 2016
1 parent 9d13f5b commit bc61f758e38963dbfe1f630c2e782ae4e3d90fae
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/core/qgsmaplayer.cpp
@@ -46,6 +46,7 @@
#include "qgsrasterlayer.h"
#include "qgsrectangle.h"
#include "qgsvectorlayer.h"
#include "qgsvectordataprovider.h"


QgsMapLayer::QgsMapLayer( QgsMapLayer::LayerType type,
@@ -559,6 +560,11 @@ bool QgsMapLayer::writeLayerXML( QDomElement& layerElement, QDomDocument& docume
urlDest.setQueryItems( urlSource.queryItems() );
src = QString::fromAscii( urlDest.toEncoded() );
}
else if ( vlayer && vlayer->providerType() == "memory" )
{
// Refetch the source from the provider, because adding fields actually changes the source for this provider.
src = vlayer->dataProvider()->dataSourceUri();
}
else
{
bool handled = false;

0 comments on commit bc61f75

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