Skip to content

Commit 348c886

Browse files
committed
Use a QgsMapLayerStore instead of whole QgsProject for
temporary layer storage in QgsProcessingContext
1 parent 10b1896 commit 348c886

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

python/core/processing/qgsprocessingcontext.sip

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ class QgsProcessingContext
7575
Sets the expression ``context``.
7676
%End
7777

78-
QgsProject &temporaryLayerStore();
78+
QgsMapLayerStore &temporaryLayerStore();
7979
%Docstring
80-
Returns a reference to the project used for storing temporary layers during
80+
Returns a reference to the layer store used for storing temporary layers during
8181
algorithm execution.
82-
:rtype: QgsProject
82+
:rtype: QgsMapLayerStore
8383
%End
8484

8585
QgsFeatureRequest::InvalidGeometryCheck invalidGeometryCheck() const;

src/core/processing/qgsprocessingcontext.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ class CORE_EXPORT QgsProcessingContext
9090
void setExpressionContext( const QgsExpressionContext &context ) { mExpressionContext = context; }
9191

9292
/**
93-
* Returns a reference to the project used for storing temporary layers during
93+
* Returns a reference to the layer store used for storing temporary layers during
9494
* algorithm execution.
9595
*/
96-
QgsProject &temporaryLayerStore() { return tempProject; }
96+
QgsMapLayerStore &temporaryLayerStore() { return tempLayerStore; }
9797

9898
/**
9999
* Returns the behavior used for checking invalid geometries in input layers.
@@ -147,7 +147,7 @@ class CORE_EXPORT QgsProcessingContext
147147
QgsProcessingContext::Flags mFlags = 0;
148148
QPointer< QgsProject > mProject;
149149
//! Temporary project owned by the context, used for storing temporarily loaded map layers
150-
QgsProject tempProject;
150+
QgsMapLayerStore tempLayerStore;
151151
QgsExpressionContext mExpressionContext;
152152
QgsFeatureRequest::InvalidGeometryCheck mInvalidGeometryCheck = QgsFeatureRequest::GeometryNoCheck;
153153
std::function< void( const QgsFeature & ) > mInvalidGeometryCallback;

0 commit comments

Comments
 (0)