Skip to content

Commit 708bf44

Browse files
committed
[processing] Add version method to QgsProcessingProvider
Allows retrieving provider version
1 parent 67dabd7 commit 708bf44

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

python/core/auto_generated/processing/qgsprocessingprovider.sip.in

+10
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ The default implementation returns the same string as name().
8787
.. seealso:: :py:func:`name`
8888

8989
.. seealso:: :py:func:`id`
90+
%End
91+
92+
virtual QString versionInfo() const;
93+
%Docstring
94+
Returns a version information string for the provider, or an empty string if this
95+
is not applicable (e.g. for inbuilt Processing providers).
96+
97+
For plugin based providers, this should return the plugin's version identifier.
98+
99+
.. versionadded:: 3.8
90100
%End
91101

92102
virtual bool canBeActivated() const;

src/core/processing/qgsprocessingprovider.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ QString QgsProcessingProvider::longName() const
5151
return name();
5252
}
5353

54+
QString QgsProcessingProvider::versionInfo() const
55+
{
56+
return QString();
57+
}
58+
5459
QStringList QgsProcessingProvider::supportedOutputRasterLayerExtensions() const
5560
{
5661
return QgsRasterFileWriter::supportedFormatExtensions();

src/core/processing/qgsprocessingprovider.h

+10
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ class CORE_EXPORT QgsProcessingProvider : public QObject
9898
*/
9999
virtual QString longName() const;
100100

101+
/**
102+
* Returns a version information string for the provider, or an empty string if this
103+
* is not applicable (e.g. for inbuilt Processing providers).
104+
*
105+
* For plugin based providers, this should return the plugin's version identifier.
106+
*
107+
* \since QGIS 3.8
108+
*/
109+
virtual QString versionInfo() const;
110+
101111
/**
102112
* Returns TRUE if the provider can be activated, or FALSE if it cannot be activated (e.g. due to
103113
* missing external dependencies).

0 commit comments

Comments
 (0)