Skip to content
Permalink
Browse files

Merge pull request #6200 from nyalldawson/non_file_default

[processing] Default to supporting non-file based outputs for providers
  • Loading branch information
alexbruy committed Jan 29, 2018
2 parents 5ab5d09 + 0f963df commit 10fbe5c30aa89724fbba09796a0f08602465a0ab
@@ -148,6 +148,10 @@ indicates that none of the outputs from any of the provider's algorithms have
support for non-file based outputs. Returning true indicates that the algorithm's
parameters will each individually declare their non-file based support.

The default behavior for providers is to support non-file based outputs, and most
providers which rely solely on QGIS API (and which do not depend on third-party scripts
or external dependencies) will automatically support this.

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

@@ -199,6 +199,12 @@ def loadAlgorithms(self):
def supportedOutputRasterLayerExtensions(self):
return GdalUtils.getSupportedRasterExtensions()

def supportsNonFileBasedOutput(self):
"""
GDAL Provider doesn't support non file based outputs
"""
return False

def tr(self, string, context=''):
if context == '':
context = 'GdalAlgorithmProvider'
@@ -127,6 +127,12 @@ def defaultRasterFileExtension(self):
def supportedOutputTableExtensions(self):
return ['dbf']

def supportsNonFileBasedOutput(self):
"""
SAGA Provider doesn't support non file based outputs
"""
return False

def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'saga.png'))

@@ -140,3 +140,8 @@ QString QgsProcessingProvider::defaultRasterFileExtension() const
return defaultExtension;
}
}

bool QgsProcessingProvider::supportsNonFileBasedOutput() const
{
return true;
}
@@ -150,9 +150,14 @@ class CORE_EXPORT QgsProcessingProvider : public QObject
* indicates that none of the outputs from any of the provider's algorithms have
* support for non-file based outputs. Returning true indicates that the algorithm's
* parameters will each individually declare their non-file based support.
*
* The default behavior for providers is to support non-file based outputs, and most
* providers which rely solely on QGIS API (and which do not depend on third-party scripts
* or external dependencies) will automatically support this.
*
* \see supportedOutputVectorLayerExtensions()
*/
virtual bool supportsNonFileBasedOutput() const { return false; }
virtual bool supportsNonFileBasedOutput() const;

/**
* Loads the provider. This will be called when the plugin is being loaded, and any general

0 comments on commit 10fbe5c

Please sign in to comment.
You can’t perform that action at this time.