Skip to content

Commit

Permalink
[processing] Add version method to QgsProcessingProvider
Browse files Browse the repository at this point in the history
Allows retrieving provider version
  • Loading branch information
nyalldawson committed Apr 8, 2019
1 parent 67dabd7 commit 708bf44
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions python/core/auto_generated/processing/qgsprocessingprovider.sip.in
Expand Up @@ -87,6 +87,16 @@ The default implementation returns the same string as name().
.. seealso:: :py:func:`name`

.. seealso:: :py:func:`id`
%End

virtual QString versionInfo() const;
%Docstring
Returns a version information string for the provider, or an empty string if this
is not applicable (e.g. for inbuilt Processing providers).

For plugin based providers, this should return the plugin's version identifier.

.. versionadded:: 3.8
%End

virtual bool canBeActivated() const;
Expand Down
5 changes: 5 additions & 0 deletions src/core/processing/qgsprocessingprovider.cpp
Expand Up @@ -51,6 +51,11 @@ QString QgsProcessingProvider::longName() const
return name();
}

QString QgsProcessingProvider::versionInfo() const
{
return QString();
}

QStringList QgsProcessingProvider::supportedOutputRasterLayerExtensions() const
{
return QgsRasterFileWriter::supportedFormatExtensions();
Expand Down
10 changes: 10 additions & 0 deletions src/core/processing/qgsprocessingprovider.h
Expand Up @@ -98,6 +98,16 @@ class CORE_EXPORT QgsProcessingProvider : public QObject
*/
virtual QString longName() const;

/**
* Returns a version information string for the provider, or an empty string if this
* is not applicable (e.g. for inbuilt Processing providers).
*
* For plugin based providers, this should return the plugin's version identifier.
*
* \since QGIS 3.8
*/
virtual QString versionInfo() const;

/**
* Returns TRUE if the provider can be activated, or FALSE if it cannot be activated (e.g. due to
* missing external dependencies).
Expand Down

0 comments on commit 708bf44

Please sign in to comment.