Use a QgsMapLayerStore instead of whole QgsProject for

temporary layer storage in QgsProcessingContext
This commit is contained in:
Nyall Dawson 2017-05-02 11:07:42 +10:00
parent 10b1896a3c
commit 348c886602
2 changed files with 6 additions and 6 deletions

View File

@ -75,11 +75,11 @@ class QgsProcessingContext
Sets the expression ``context``.
%End
QgsProject &temporaryLayerStore();
QgsMapLayerStore &temporaryLayerStore();
%Docstring
Returns a reference to the project used for storing temporary layers during
Returns a reference to the layer store used for storing temporary layers during
algorithm execution.
:rtype: QgsProject
:rtype: QgsMapLayerStore
%End
QgsFeatureRequest::InvalidGeometryCheck invalidGeometryCheck() const;

View File

@ -90,10 +90,10 @@ class CORE_EXPORT QgsProcessingContext
void setExpressionContext( const QgsExpressionContext &context ) { mExpressionContext = context; }
/**
* Returns a reference to the project used for storing temporary layers during
* Returns a reference to the layer store used for storing temporary layers during
* algorithm execution.
*/
QgsProject &temporaryLayerStore() { return tempProject; }
QgsMapLayerStore &temporaryLayerStore() { return tempLayerStore; }
/**
* Returns the behavior used for checking invalid geometries in input layers.
@ -147,7 +147,7 @@ class CORE_EXPORT QgsProcessingContext
QgsProcessingContext::Flags mFlags = 0;
QPointer< QgsProject > mProject;
//! Temporary project owned by the context, used for storing temporarily loaded map layers
QgsProject tempProject;
QgsMapLayerStore tempLayerStore;
QgsExpressionContext mExpressionContext;
QgsFeatureRequest::InvalidGeometryCheck mInvalidGeometryCheck = QgsFeatureRequest::GeometryNoCheck;
std::function< void( const QgsFeature & ) > mInvalidGeometryCallback;