Skip to content
Permalink
Browse files

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

  • Loading branch information
SebDieBln committed Dec 30, 2015
1 parent 766bfa1 commit dbc0f072c638981db982011776d7b110215e80b7
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,
@@ -569,6 +570,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 dbc0f07

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