Skip to content

Commit 569b39b

Browse files
m-kuhnnyalldawson
authored andcommitted
Code and doc improvements
1 parent b5672d7 commit 569b39b

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

python/core/processing/qgsprocessingregistry.sip.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,11 @@ according to some user configuration.
107107
.. seealso:: :py:func:`algorithmById`
108108
%End
109109

110-
void addParameterType( QgsProcessingParameterType *type );
110+
void addParameterType( QgsProcessingParameterType *type /Transfer/ );
111111
%Docstring
112112
Register a new parameter type for processing.
113-
Will emit parameterTypeAdded
113+
Ownership is transferred to the registry.
114+
Will emit parameterTypeAdded.
114115

115116
.. seealso:: :py:func:`removeParameterType`
116117

@@ -120,7 +121,8 @@ Will emit parameterTypeAdded
120121
void removeParameterType( QgsProcessingParameterType *type );
121122
%Docstring
122123
Unregister a custom parameter type from processing.
123-
Will emit parameterTypeRemoved
124+
The type will be deleted.
125+
Will emit parameterTypeRemoved.
124126

125127
.. seealso:: :py:func:`addParameterType`
126128

src/core/processing/qgsprocessingregistry.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,19 @@ class CORE_EXPORT QgsProcessingRegistry : public QObject
134134

135135
/**
136136
* Register a new parameter type for processing.
137-
* Will emit parameterTypeAdded
137+
* Ownership is transferred to the registry.
138+
* Will emit parameterTypeAdded.
138139
*
139140
* \see removeParameterType
140141
*
141142
* \since QGIS 3.2
142143
*/
143-
void addParameterType( QgsProcessingParameterType *type );
144+
void addParameterType( QgsProcessingParameterType *type SIP_TRANSFER );
144145

145146
/**
146147
* Unregister a custom parameter type from processing.
147-
* Will emit parameterTypeRemoved
148+
* The type will be deleted.
149+
* Will emit parameterTypeRemoved.
148150
*
149151
* \see addParameterType
150152
*
@@ -196,7 +198,7 @@ class CORE_EXPORT QgsProcessingRegistry : public QObject
196198
QMap<QString, QgsProcessingProvider *> mProviders;
197199

198200
//! Hash of available parameter types by id. This object owns the pointers.
199-
QHash<QString, QgsProcessingParameterType *> mParameterTypes;
201+
QMap<QString, QgsProcessingParameterType *> mParameterTypes;
200202

201203
#ifdef SIP_RUN
202204
QgsProcessingRegistry( const QgsProcessingRegistry &other );

0 commit comments

Comments
 (0)