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 1, 2016
1 parent 4c3cf64 commit a6f10f4c355f9cdbc55313fd10c8ff029d9c000f
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/core/qgsmaplayer.cpp
@@ -45,6 +45,7 @@
#include "qgsrasterlayer.h"
#include "qgsrectangle.h"
#include "qgsvectorlayer.h"
#include "qgsvectordataprovider.h"


QgsMapLayer::QgsMapLayer( QgsMapLayer::LayerType type,
@@ -549,6 +550,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 a6f10f4

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