Skip to content

Commit 9d04f87

Browse files
committedJul 8, 2017
Rename "output" style parameters for clarity
The previous naming was too easily confused with processing outputs. Rename them to QgsProcessingParameterFileDestination, etc... to make it clearer what they are used for.
1 parent f82b41e commit 9d04f87

18 files changed

+237
-221
lines changed
 

‎python/core/processing/qgsprocessingparameters.sip

Lines changed: 53 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,14 @@ class QgsProcessingParameterDefinition
181181
sipType = sipType_QgsProcessingParameterFeatureSource;
182182
else if ( sipCpp->type() == QgsProcessingParameterFeatureSink::typeName() )
183183
sipType = sipType_QgsProcessingParameterFeatureSink;
184-
else if ( sipCpp->type() == QgsProcessingParameterVectorOutput::typeName() )
185-
sipType = sipType_QgsProcessingParameterVectorOutput;
186-
else if ( sipCpp->type() == QgsProcessingParameterRasterOutput::typeName() )
187-
sipType = sipType_QgsProcessingParameterRasterOutput;
188-
else if ( sipCpp->type() == QgsProcessingParameterFileOutput::typeName() )
189-
sipType = sipType_QgsProcessingParameterFileOutput;
190-
else if ( sipCpp->type() == QgsProcessingParameterFolderOutput::typeName() )
191-
sipType = sipType_QgsProcessingParameterFolderOutput;
184+
else if ( sipCpp->type() == QgsProcessingParameterVectorDestination::typeName() )
185+
sipType = sipType_QgsProcessingParameterVectorDestination;
186+
else if ( sipCpp->type() == QgsProcessingParameterRasterDestination::typeName() )
187+
sipType = sipType_QgsProcessingParameterRasterDestination;
188+
else if ( sipCpp->type() == QgsProcessingParameterFileDestination::typeName() )
189+
sipType = sipType_QgsProcessingParameterFileDestination;
190+
else if ( sipCpp->type() == QgsProcessingParameterFolderDestination::typeName() )
191+
sipType = sipType_QgsProcessingParameterFolderDestination;
192192
%End
193193
public:
194194

@@ -1712,10 +1712,15 @@ class QgsProcessingParameterFeatureSink : QgsProcessingDestinationParameter
17121712
};
17131713

17141714

1715-
class QgsProcessingParameterVectorOutput : QgsProcessingDestinationParameter
1715+
class QgsProcessingParameterVectorDestination : QgsProcessingDestinationParameter
17161716
{
17171717
%Docstring
1718-
A vector layer output parameter. Consider using the more flexible QgsProcessingParameterFeatureSink wherever
1718+
A vector layer destination parameter, for specifying the destination path for a vector layer
1719+
created by the algorithm.
1720+
1721+
.. note::
1722+
1723+
Consider using the more flexible QgsProcessingParameterFeatureSink wherever
17191724
possible.
17201725
.. versionadded:: 3.0
17211726
%End
@@ -1725,10 +1730,10 @@ class QgsProcessingParameterVectorOutput : QgsProcessingDestinationParameter
17251730
%End
17261731
public:
17271732

1728-
QgsProcessingParameterVectorOutput( const QString &name, const QString &description = QString(), QgsProcessing::LayerType type = QgsProcessing::TypeVectorAny, const QVariant &defaultValue = QVariant(),
1729-
bool optional = false );
1733+
QgsProcessingParameterVectorDestination( const QString &name, const QString &description = QString(), QgsProcessing::LayerType type = QgsProcessing::TypeVectorAny, const QVariant &defaultValue = QVariant(),
1734+
bool optional = false );
17301735
%Docstring
1731-
Constructor for QgsProcessingParameterVectorOutput.
1736+
Constructor for QgsProcessingParameterVectorDestination.
17321737
%End
17331738

17341739
static QString typeName();
@@ -1750,21 +1755,21 @@ class QgsProcessingParameterVectorOutput : QgsProcessingDestinationParameter
17501755

17511756
QgsProcessing::LayerType dataType() const;
17521757
%Docstring
1753-
Returns the layer type for layers associated with the parameter.
1758+
Returns the layer type for this created vector layer.
17541759
.. seealso:: setDataType()
17551760
:rtype: QgsProcessing.LayerType
17561761
%End
17571762

17581763
bool hasGeometry() const;
17591764
%Docstring
1760-
Returns true if the layer is likely to include geometries. In cases were presence of geometry
1765+
Returns true if the created layer is likely to include geometries. In cases were presence of geometry
17611766
cannot be reliably determined in advance, this method will default to returning true.
17621767
:rtype: bool
17631768
%End
17641769

17651770
void setDataType( QgsProcessing::LayerType type );
17661771
%Docstring
1767-
Sets the layer ``type`` for the layers associated with the parameter.
1772+
Sets the layer ``type`` for the created vector layer.
17681773
.. seealso:: dataType()
17691774
%End
17701775

@@ -1773,19 +1778,20 @@ class QgsProcessingParameterVectorOutput : QgsProcessingDestinationParameter
17731778
virtual bool fromVariantMap( const QVariantMap &map );
17741779

17751780

1776-
static QgsProcessingParameterVectorOutput *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
1781+
static QgsProcessingParameterVectorDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
17771782
%Docstring
17781783
Creates a new parameter using the definition from a script code.
1779-
:rtype: QgsProcessingParameterVectorOutput
1784+
:rtype: QgsProcessingParameterVectorDestination
17801785
%End
17811786

17821787

17831788
};
17841789

1785-
class QgsProcessingParameterRasterOutput : QgsProcessingDestinationParameter
1790+
class QgsProcessingParameterRasterDestination : QgsProcessingDestinationParameter
17861791
{
17871792
%Docstring
1788-
A raster layer output parameter.
1793+
A raster layer destination parameter, for specifying the destination path for a raster layer
1794+
created by the algorithm.
17891795
.. versionadded:: 3.0
17901796
%End
17911797

@@ -1794,11 +1800,11 @@ class QgsProcessingParameterRasterOutput : QgsProcessingDestinationParameter
17941800
%End
17951801
public:
17961802

1797-
QgsProcessingParameterRasterOutput( const QString &name, const QString &description = QString(),
1798-
const QVariant &defaultValue = QVariant(),
1799-
bool optional = false );
1803+
QgsProcessingParameterRasterDestination( const QString &name, const QString &description = QString(),
1804+
const QVariant &defaultValue = QVariant(),
1805+
bool optional = false );
18001806
%Docstring
1801-
Constructor for QgsProcessingParameterRasterOutput.
1807+
Constructor for QgsProcessingParameterRasterDestination.
18021808
%End
18031809

18041810
static QString typeName();
@@ -1816,17 +1822,18 @@ class QgsProcessingParameterRasterOutput : QgsProcessingDestinationParameter
18161822
virtual QString defaultFileExtension() const;
18171823

18181824

1819-
static QgsProcessingParameterRasterOutput *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
1825+
static QgsProcessingParameterRasterDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
18201826
%Docstring
18211827
Creates a new parameter using the definition from a script code.
1822-
:rtype: QgsProcessingParameterRasterOutput
1828+
:rtype: QgsProcessingParameterRasterDestination
18231829
%End
18241830
};
18251831

1826-
class QgsProcessingParameterFileOutput : QgsProcessingDestinationParameter
1832+
class QgsProcessingParameterFileDestination : QgsProcessingDestinationParameter
18271833
{
18281834
%Docstring
1829-
A generic file based output parameter.
1835+
A generic file based destination parameter, for specifying the destination path for a file (non-map layer)
1836+
created by the algorithm.
18301837
.. versionadded:: 3.0
18311838
%End
18321839

@@ -1835,12 +1842,12 @@ class QgsProcessingParameterFileOutput : QgsProcessingDestinationParameter
18351842
%End
18361843
public:
18371844

1838-
QgsProcessingParameterFileOutput( const QString &name, const QString &description = QString(),
1839-
const QString &fileFilter = QString(),
1840-
const QVariant &defaultValue = QVariant(),
1841-
bool optional = false );
1845+
QgsProcessingParameterFileDestination( const QString &name, const QString &description = QString(),
1846+
const QString &fileFilter = QString(),
1847+
const QVariant &defaultValue = QVariant(),
1848+
bool optional = false );
18421849
%Docstring
1843-
Constructor for QgsProcessingParameterFileOutput.
1850+
Constructor for QgsProcessingParameterFileDestination.
18441851
%End
18451852

18461853
static QString typeName();
@@ -1860,14 +1867,14 @@ class QgsProcessingParameterFileOutput : QgsProcessingDestinationParameter
18601867

18611868
QString fileFilter() const;
18621869
%Docstring
1863-
Returns the file filter string for files compatible with this output.
1870+
Returns the file filter string for file destinations compatible with this parameter.
18641871
.. seealso:: setFileFilter()
18651872
:rtype: str
18661873
%End
18671874

18681875
void setFileFilter( const QString &filter );
18691876
%Docstring
1870-
Sets the file ``filter`` string for files compatible with this output.
1877+
Sets the file ``filter`` string for file destinations compatible with this parameter.
18711878
.. seealso:: fileFilter()
18721879
%End
18731880

@@ -1876,18 +1883,20 @@ class QgsProcessingParameterFileOutput : QgsProcessingDestinationParameter
18761883
virtual bool fromVariantMap( const QVariantMap &map );
18771884

18781885

1879-
static QgsProcessingParameterFileOutput *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
1886+
static QgsProcessingParameterFileDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
18801887
%Docstring
18811888
Creates a new parameter using the definition from a script code.
1882-
:rtype: QgsProcessingParameterFileOutput
1889+
:rtype: QgsProcessingParameterFileDestination
18831890
%End
18841891

18851892

18861893
};
18871894

1888-
class QgsProcessingParameterFolderOutput : QgsProcessingDestinationParameter
1895+
class QgsProcessingParameterFolderDestination : QgsProcessingDestinationParameter
18891896
{
18901897
%Docstring
1898+
A folder destination parameter, for specifying the destination path for a folder created
1899+
by the algorithm or used for creating new files within the algorithm.
18911900
A folder output parameter.
18921901
.. versionadded:: 3.0
18931902
%End
@@ -1897,11 +1906,11 @@ class QgsProcessingParameterFolderOutput : QgsProcessingDestinationParameter
18971906
%End
18981907
public:
18991908

1900-
QgsProcessingParameterFolderOutput( const QString &name, const QString &description = QString(),
1901-
const QVariant &defaultValue = QVariant(),
1902-
bool optional = false );
1909+
QgsProcessingParameterFolderDestination( const QString &name, const QString &description = QString(),
1910+
const QVariant &defaultValue = QVariant(),
1911+
bool optional = false );
19031912
%Docstring
1904-
Constructor for QgsProcessingParameterFolderOutput.
1913+
Constructor for QgsProcessingParameterFolderDestination.
19051914
%End
19061915

19071916
static QString typeName();
@@ -1917,10 +1926,10 @@ class QgsProcessingParameterFolderOutput : QgsProcessingDestinationParameter
19171926
virtual QString defaultFileExtension() const;
19181927

19191928

1920-
static QgsProcessingParameterFolderOutput *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
1929+
static QgsProcessingParameterFolderDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/;
19211930
%Docstring
19221931
Creates a new parameter using the definition from a script code.
1923-
:rtype: QgsProcessingParameterFolderOutput
1932+
:rtype: QgsProcessingParameterFolderDestination
19241933
%End
19251934

19261935
};

‎python/plugins/processing/algs/qgis/Aspect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from qgis.analysis import QgsAspectFilter
3333
from qgis.core import (QgsProcessingParameterRasterLayer,
3434
QgsProcessingParameterNumber,
35-
QgsProcessingParameterRasterOutput,
35+
QgsProcessingParameterRasterDestination,
3636
QgsProcessingOutputRasterLayer,
3737
QgsFeatureSink)
3838
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
@@ -65,7 +65,7 @@ def __init__(self):
6565
self.addParameter(QgsProcessingParameterNumber(self.Z_FACTOR,
6666
self.tr('Z factor'), QgsProcessingParameterNumber.Double,
6767
1, False, 1, 999999.99))
68-
self.addParameter(QgsProcessingParameterRasterOutput(self.OUTPUT, self.tr('Aspect')))
68+
self.addParameter(QgsProcessingParameterRasterDestination(self.OUTPUT, self.tr('Aspect')))
6969
self.addOutput(QgsProcessingOutputRasterLayer(self.OUTPUT, self.tr('Aspect')))
7070

7171
def name(self):

‎python/plugins/processing/algs/qgis/BarPlot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
QgsProcessingUtils,
3535
QgsProcessingParameterFeatureSource,
3636
QgsProcessingParameterField,
37-
QgsProcessingParameterFileOutput,
37+
QgsProcessingParameterFileDestination,
3838
QgsProcessingOutputHtml)
3939
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
4040
from processing.tools import vector
@@ -62,7 +62,7 @@ def __init__(self):
6262
self.tr('Value field'),
6363
None, self.INPUT, QgsProcessingParameterField.Numeric))
6464

65-
self.addParameter(QgsProcessingParameterFileOutput(self.OUTPUT, self.tr('Added'), self.tr('HTML files (*.html)')))
65+
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT, self.tr('Added'), self.tr('HTML files (*.html)')))
6666

6767
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT, self.tr('Bar plot')))
6868

‎python/plugins/processing/algs/qgis/BasicStatistics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
QgsProcessingUtils,
4040
QgsProcessingParameterFeatureSource,
4141
QgsProcessingParameterField,
42-
QgsProcessingParameterFileOutput,
42+
QgsProcessingParameterFileDestination,
4343
QgsProcessingOutputHtml,
4444
QgsProcessingOutputNumber)
4545

@@ -95,7 +95,7 @@ def __init__(self):
9595
self.tr('Field to calculate statistics on'),
9696
None, self.INPUT_LAYER, QgsProcessingParameterField.Any))
9797

98-
self.addParameter(QgsProcessingParameterFileOutput(self.OUTPUT_HTML_FILE, self.tr('Statistics'), self.tr('HTML files (*.html)'), None, True))
98+
self.addParameter(QgsProcessingParameterFileDestination(self.OUTPUT_HTML_FILE, self.tr('Statistics'), self.tr('HTML files (*.html)'), None, True))
9999
self.addOutput(QgsProcessingOutputHtml(self.OUTPUT_HTML_FILE, self.tr('Statistics')))
100100

101101
self.addOutput(QgsProcessingOutputNumber(self.COUNT, self.tr('Count')))

‎python/plugins/processing/algs/qgis/VectorSplit.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
QgsFeatureSink,
3333
QgsProcessingParameterFeatureSource,
3434
QgsProcessingParameterField,
35-
QgsProcessingParameterFolderOutput,
35+
QgsProcessingParameterFolderDestination,
3636
QgsProcessingOutputFolder,
3737
QgsExpression,
3838
QgsFeatureRequest)
@@ -61,8 +61,8 @@ def __init__(self):
6161
self.addParameter(QgsProcessingParameterField(self.FIELD,
6262
self.tr('Unique ID field'), None, self.INPUT))
6363

64-
self.addParameter(QgsProcessingParameterFolderOutput(self.OUTPUT,
65-
self.tr('Output directory')))
64+
self.addParameter(QgsProcessingParameterFolderDestination(self.OUTPUT,
65+
self.tr('Output directory')))
6666

6767
self.addOutput(QgsProcessingOutputFolder(self.OUTPUT, self.tr('Output directory')))
6868

‎python/plugins/processing/gui/AlgorithmDialog.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
QgsProcessingOutputVectorLayer,
4343
QgsProcessingAlgRunnerTask,
4444
QgsProcessingOutputHtml,
45-
QgsProcessingParameterVectorOutput,
45+
QgsProcessingParameterVectorDestination,
4646
QgsProcessingOutputLayerDefinition,
4747
QgsProcessingParameterFeatureSink,
48-
QgsProcessingParameterRasterOutput,
48+
QgsProcessingParameterRasterDestination,
4949
QgsProcessingAlgorithm)
5050
from qgis.gui import QgsMessageBar
5151
from qgis.utils import iface
@@ -119,7 +119,7 @@ def getParamValues(self):
119119
else:
120120
dest_project = None
121121
if not param.flags() & QgsProcessingParameterDefinition.FlagHidden and \
122-
isinstance(param, (QgsProcessingParameterRasterOutput, QgsProcessingParameterFeatureSink, QgsProcessingParameterVectorOutput)):
122+
isinstance(param, (QgsProcessingParameterRasterDestination, QgsProcessingParameterFeatureSink, QgsProcessingParameterVectorDestination)):
123123
if self.mainWidget.checkBoxes[param.name()].isChecked():
124124
dest_project = QgsProject.instance()
125125

‎python/plugins/processing/gui/BatchAlgorithmDialog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from qgis.PyQt.QtCore import Qt
3535

3636
from qgis.core import (QgsProcessingParameterDefinition,
37-
QgsProcessingParameterRasterOutput,
37+
QgsProcessingParameterRasterDestination,
3838
QgsProcessingParameterFeatureSink,
3939
QgsProcessingOutputLayerDefinition,
4040
QgsProcessingOutputHtml,
@@ -104,7 +104,7 @@ def accept(self):
104104
widget = self.mainWidget.tblParameters.cellWidget(row, col)
105105
text = widget.getValue()
106106
if param.checkValueIsAcceptable(text, context):
107-
if isinstance(out, (QgsProcessingParameterRasterOutput,
107+
if isinstance(out, (QgsProcessingParameterRasterDestination,
108108
QgsProcessingParameterFeatureSink)):
109109
# load rasters and sinks on completion
110110
parameters[out.name()] = QgsProcessingOutputLayerDefinition(text, context.project())

‎python/plugins/processing/gui/BatchOutputSelectionPanel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
from qgis.core import (QgsMapLayer,
3535
QgsSettings,
36-
QgsProcessingParameterFolderOutput,
36+
QgsProcessingParameterFolderDestination,
3737
QgsProcessingParameterRasterLayer,
3838
QgsProcessingParameterFeatureSource,
3939
QgsProcessingParameterVectorLayer,
@@ -73,7 +73,7 @@ def __init__(self, output, alg, row, col, panel):
7373
self.setLayout(self.horizontalLayout)
7474

7575
def showSelectionDialog(self):
76-
if isinstance(self.output, QgsProcessingParameterFolderOutput):
76+
if isinstance(self.output, QgsProcessingParameterFolderDestination):
7777
self.selectDirectory()
7878
return
7979

‎python/plugins/processing/gui/DestinationSelectionPanel.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
QgsProcessingParameterFeatureSink,
4242
QgsProcessingOutputLayerDefinition,
4343
QgsProcessingParameterDefinition,
44-
QgsProcessingParameterFolderOutput)
44+
QgsProcessingParameterFolderDestination)
4545
from processing.core.ProcessingConfig import ProcessingConfig
4646
from processing.tools.dataobjects import createContext
4747
from processing.gui.PostgisTableSelector import PostgisTableSelector
@@ -79,7 +79,7 @@ def __init__(self, parameter, alg):
7979
and alg.provider().supportsNonFileBasedOutput():
8080
# use memory layers for temporary files if supported
8181
self.leText.setPlaceholderText(self.SAVE_TO_TEMP_LAYER)
82-
elif not isinstance(self.parameter, QgsProcessingParameterFolderOutput):
82+
elif not isinstance(self.parameter, QgsProcessingParameterFolderDestination):
8383
self.leText.setPlaceholderText(self.SAVE_TO_TEMP_FILE)
8484

8585
self.btnSelect.clicked.connect(self.selectOutput)
@@ -94,7 +94,7 @@ def skipOutput(self):
9494
self.use_temporary = False
9595

9696
def selectOutput(self):
97-
if isinstance(self.parameter, QgsProcessingParameterFolderOutput):
97+
if isinstance(self.parameter, QgsProcessingParameterFolderDestination):
9898
self.selectDirectory()
9999
else:
100100
popupMenu = QMenu()
@@ -275,7 +275,7 @@ def getValue(self):
275275
if not key and self.parameter.flags() & QgsProcessingParameterDefinition.FlagOptional:
276276
return None
277277

278-
if isinstance(self.parameter, QgsProcessingParameterFolderOutput):
278+
if isinstance(self.parameter, QgsProcessingParameterFolderDestination):
279279
return self.leText.text()
280280

281281
value = QgsProcessingOutputLayerDefinition(key)

‎python/plugins/processing/gui/ParameterGuiUtils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ def getFileFilter(param):
5656
for i in range(len(exts)):
5757
exts[i] = tr('{0} files (*.{1})', 'QgsProcessingParameterMultipleLayers').format(exts[i].upper(), exts[i].lower())
5858
return ';;'.join(exts)
59-
elif param.type() in ('raster', 'rasterOut'):
59+
elif param.type() in ('raster', 'rasterDestination'):
6060
exts = dataobjects.getSupportedOutputRasterLayerExtensions()
6161
for i in range(len(exts)):
62-
exts[i] = tr('{0} files (*.{1})', 'QgsProcessingParameterRasterOutput').format(exts[i].upper(), exts[i].lower())
62+
exts[i] = tr('{0} files (*.{1})', 'QgsProcessingParameterRasterDestination').format(exts[i].upper(), exts[i].lower())
6363
return ';;'.join(exts)
6464
elif param.type() == 'table':
6565
exts = ['csv', 'dbf']

‎python/plugins/processing/gui/ParametersPanel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
QgsProcessingParameterFeatureSource,
3838
QgsProcessingOutputVectorLayer,
3939
QgsProcessingOutputRasterLayer,
40-
QgsProcessingParameterRasterOutput,
40+
QgsProcessingParameterRasterDestination,
4141
QgsProcessingParameterFeatureSink,
42-
QgsProcessingParameterVectorOutput)
42+
QgsProcessingParameterVectorDestination)
4343
from qgis.PyQt import uic
4444
from qgis.PyQt.QtCore import QCoreApplication, Qt
4545
from qgis.PyQt.QtWidgets import (QWidget, QHBoxLayout, QToolButton,
@@ -158,7 +158,7 @@ def initWidgets(self):
158158
widget = DestinationSelectionPanel(output, self.alg)
159159
self.layoutMain.insertWidget(self.layoutMain.count() - 1, label)
160160
self.layoutMain.insertWidget(self.layoutMain.count() - 1, widget)
161-
if isinstance(output, (QgsProcessingParameterRasterOutput, QgsProcessingParameterFeatureSink, QgsProcessingParameterVectorOutput)):
161+
if isinstance(output, (QgsProcessingParameterRasterDestination, QgsProcessingParameterFeatureSink, QgsProcessingParameterVectorDestination)):
162162
check = QCheckBox()
163163
check.setText(self.tr('Open output file after running algorithm'))
164164
check.setChecked(True)

‎python/plugins/processing/modeler/ModelerParametersDialog.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
QgsProcessingParameterExtent,
3939
QgsProcessingModelAlgorithm,
4040
QgsProcessingParameterFeatureSink,
41-
QgsProcessingParameterRasterOutput,
42-
QgsProcessingParameterFileOutput,
43-
QgsProcessingParameterFolderOutput,
41+
QgsProcessingParameterRasterDestination,
42+
QgsProcessingParameterFileDestination,
43+
QgsProcessingParameterFolderDestination,
4444
QgsProcessingOutputDefinition)
4545

4646
from qgis.gui import (QgsMessageBar,
@@ -150,8 +150,8 @@ def setupUi(self):
150150
for dest in self._alg.destinationParameterDefinitions():
151151
if dest.flags() & QgsProcessingParameterDefinition.FlagHidden:
152152
continue
153-
if isinstance(dest, (QgsProcessingParameterRasterOutput, QgsProcessingParameterFeatureSink,
154-
QgsProcessingParameterFileOutput, QgsProcessingParameterFolderOutput)):
153+
if isinstance(dest, (QgsProcessingParameterRasterDestination, QgsProcessingParameterFeatureSink,
154+
QgsProcessingParameterFileDestination, QgsProcessingParameterFolderDestination)):
155155
label = QLabel(dest.description())
156156
item = QLineEdit()
157157
if hasattr(item, 'setPlaceholderText'):

‎python/plugins/processing/tests/testdata/scripts/selectbyattribute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#inputs
55

66
##INPUT_LAYER=vector
7-
##OUTPUT_LAYER=vectorOut
7+
##OUTPUT_LAYER=vectorDestination
88

99
#outputs
1010

‎python/plugins/processing/tests/testdata/scripts/selectbyexpression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#inputs
55

66
##INPUT_LAYER=vector
7-
##OUTPUT_LAYER=vectorOut
7+
##OUTPUT_LAYER=vectorDestination
88

99
#outputs
1010

‎python/plugins/processing/tools/general.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
from qgis.core import (QgsApplication,
3939
QgsProcessingAlgorithm,
4040
QgsProcessingParameterFeatureSink,
41-
QgsProcessingParameterVectorOutput,
42-
QgsProcessingParameterRasterOutput,
41+
QgsProcessingParameterVectorDestination,
42+
QgsProcessingParameterRasterDestination,
4343
QgsProcessingOutputLayerDefinition,
4444
QgsProject)
4545
from processing.core.Processing import Processing
@@ -96,7 +96,7 @@ def runAndLoadResults(algOrName, parameters, feedback=None, context=None):
9696
if not param.name() in parameters:
9797
continue
9898

99-
if isinstance(param, (QgsProcessingParameterFeatureSink, QgsProcessingParameterVectorOutput, QgsProcessingParameterRasterOutput)):
99+
if isinstance(param, (QgsProcessingParameterFeatureSink, QgsProcessingParameterVectorDestination, QgsProcessingParameterRasterDestination)):
100100
p = parameters[param.name()]
101101
if not isinstance(p, QgsProcessingOutputLayerDefinition):
102102
parameters[param.name()] = QgsProcessingOutputLayerDefinition(p, QgsProject.instance())

‎src/core/processing/qgsprocessingparameters.cpp

Lines changed: 53 additions & 53 deletions
Large diffs are not rendered by default.

‎src/core/processing/qgsprocessingparameters.h

Lines changed: 56 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,14 @@ class CORE_EXPORT QgsProcessingParameterDefinition
223223
sipType = sipType_QgsProcessingParameterFeatureSource;
224224
else if ( sipCpp->type() == QgsProcessingParameterFeatureSink::typeName() )
225225
sipType = sipType_QgsProcessingParameterFeatureSink;
226-
else if ( sipCpp->type() == QgsProcessingParameterVectorOutput::typeName() )
227-
sipType = sipType_QgsProcessingParameterVectorOutput;
228-
else if ( sipCpp->type() == QgsProcessingParameterRasterOutput::typeName() )
229-
sipType = sipType_QgsProcessingParameterRasterOutput;
230-
else if ( sipCpp->type() == QgsProcessingParameterFileOutput::typeName() )
231-
sipType = sipType_QgsProcessingParameterFileOutput;
232-
else if ( sipCpp->type() == QgsProcessingParameterFolderOutput::typeName() )
233-
sipType = sipType_QgsProcessingParameterFolderOutput;
226+
else if ( sipCpp->type() == QgsProcessingParameterVectorDestination::typeName() )
227+
sipType = sipType_QgsProcessingParameterVectorDestination;
228+
else if ( sipCpp->type() == QgsProcessingParameterRasterDestination::typeName() )
229+
sipType = sipType_QgsProcessingParameterRasterDestination;
230+
else if ( sipCpp->type() == QgsProcessingParameterFileDestination::typeName() )
231+
sipType = sipType_QgsProcessingParameterFileDestination;
232+
else if ( sipCpp->type() == QgsProcessingParameterFolderDestination::typeName() )
233+
sipType = sipType_QgsProcessingParameterFolderDestination;
234234
SIP_END
235235
#endif
236236

@@ -1625,26 +1625,29 @@ class CORE_EXPORT QgsProcessingParameterFeatureSink : public QgsProcessingDestin
16251625

16261626

16271627
/**
1628-
* \class QgsProcessingParameterVectorOutput
1628+
* \class QgsProcessingParameterVectorDestination
16291629
* \ingroup core
1630-
* A vector layer output parameter. Consider using the more flexible QgsProcessingParameterFeatureSink wherever
1630+
* A vector layer destination parameter, for specifying the destination path for a vector layer
1631+
* created by the algorithm.
1632+
*
1633+
* \note Consider using the more flexible QgsProcessingParameterFeatureSink wherever
16311634
* possible.
16321635
* \since QGIS 3.0
16331636
*/
1634-
class CORE_EXPORT QgsProcessingParameterVectorOutput : public QgsProcessingDestinationParameter
1637+
class CORE_EXPORT QgsProcessingParameterVectorDestination : public QgsProcessingDestinationParameter
16351638
{
16361639
public:
16371640

16381641
/**
1639-
* Constructor for QgsProcessingParameterVectorOutput.
1642+
* Constructor for QgsProcessingParameterVectorDestination.
16401643
*/
1641-
QgsProcessingParameterVectorOutput( const QString &name, const QString &description = QString(), QgsProcessing::LayerType type = QgsProcessing::TypeVectorAny, const QVariant &defaultValue = QVariant(),
1642-
bool optional = false );
1644+
QgsProcessingParameterVectorDestination( const QString &name, const QString &description = QString(), QgsProcessing::LayerType type = QgsProcessing::TypeVectorAny, const QVariant &defaultValue = QVariant(),
1645+
bool optional = false );
16431646

16441647
/**
16451648
* Returns the type name for the parameter class.
16461649
*/
1647-
static QString typeName() { return QStringLiteral( "vectorOut" ); }
1650+
static QString typeName() { return QStringLiteral( "vectorDestination" ); }
16481651
QString type() const override { return typeName(); }
16491652
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
16501653
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
@@ -1653,19 +1656,19 @@ class CORE_EXPORT QgsProcessingParameterVectorOutput : public QgsProcessingDesti
16531656
QString defaultFileExtension() const override;
16541657

16551658
/**
1656-
* Returns the layer type for layers associated with the parameter.
1659+
* Returns the layer type for this created vector layer.
16571660
* \see setDataType()
16581661
*/
16591662
QgsProcessing::LayerType dataType() const;
16601663

16611664
/**
1662-
* Returns true if the layer is likely to include geometries. In cases were presence of geometry
1665+
* Returns true if the created layer is likely to include geometries. In cases were presence of geometry
16631666
* cannot be reliably determined in advance, this method will default to returning true.
16641667
*/
16651668
bool hasGeometry() const;
16661669

16671670
/**
1668-
* Sets the layer \a type for the layers associated with the parameter.
1671+
* Sets the layer \a type for the created vector layer.
16691672
* \see dataType()
16701673
*/
16711674
void setDataType( QgsProcessing::LayerType type );
@@ -1676,7 +1679,7 @@ class CORE_EXPORT QgsProcessingParameterVectorOutput : public QgsProcessingDesti
16761679
/**
16771680
* Creates a new parameter using the definition from a script code.
16781681
*/
1679-
static QgsProcessingParameterVectorOutput *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1682+
static QgsProcessingParameterVectorDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
16801683

16811684

16821685
private:
@@ -1685,26 +1688,27 @@ class CORE_EXPORT QgsProcessingParameterVectorOutput : public QgsProcessingDesti
16851688
};
16861689

16871690
/**
1688-
* \class QgsProcessingParameterRasterOutput
1691+
* \class QgsProcessingParameterRasterDestination
16891692
* \ingroup core
1690-
* A raster layer output parameter.
1693+
* A raster layer destination parameter, for specifying the destination path for a raster layer
1694+
* created by the algorithm.
16911695
* \since QGIS 3.0
16921696
*/
1693-
class CORE_EXPORT QgsProcessingParameterRasterOutput : public QgsProcessingDestinationParameter
1697+
class CORE_EXPORT QgsProcessingParameterRasterDestination : public QgsProcessingDestinationParameter
16941698
{
16951699
public:
16961700

16971701
/**
1698-
* Constructor for QgsProcessingParameterRasterOutput.
1702+
* Constructor for QgsProcessingParameterRasterDestination.
16991703
*/
1700-
QgsProcessingParameterRasterOutput( const QString &name, const QString &description = QString(),
1701-
const QVariant &defaultValue = QVariant(),
1702-
bool optional = false );
1704+
QgsProcessingParameterRasterDestination( const QString &name, const QString &description = QString(),
1705+
const QVariant &defaultValue = QVariant(),
1706+
bool optional = false );
17031707

17041708
/**
17051709
* Returns the type name for the parameter class.
17061710
*/
1707-
static QString typeName() { return QStringLiteral( "rasterOut" ); }
1711+
static QString typeName() { return QStringLiteral( "rasterDestination" ); }
17081712
QString type() const override { return typeName(); }
17091713
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
17101714
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
@@ -1714,45 +1718,46 @@ class CORE_EXPORT QgsProcessingParameterRasterOutput : public QgsProcessingDesti
17141718
/**
17151719
* Creates a new parameter using the definition from a script code.
17161720
*/
1717-
static QgsProcessingParameterRasterOutput *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1721+
static QgsProcessingParameterRasterDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
17181722
};
17191723

17201724
/**
1721-
* \class QgsProcessingParameterFileOutput
1725+
* \class QgsProcessingParameterFileDestination
17221726
* \ingroup core
1723-
* A generic file based output parameter.
1727+
* A generic file based destination parameter, for specifying the destination path for a file (non-map layer)
1728+
* created by the algorithm.
17241729
* \since QGIS 3.0
17251730
*/
1726-
class CORE_EXPORT QgsProcessingParameterFileOutput : public QgsProcessingDestinationParameter
1731+
class CORE_EXPORT QgsProcessingParameterFileDestination : public QgsProcessingDestinationParameter
17271732
{
17281733
public:
17291734

17301735
/**
1731-
* Constructor for QgsProcessingParameterFileOutput.
1736+
* Constructor for QgsProcessingParameterFileDestination.
17321737
*/
1733-
QgsProcessingParameterFileOutput( const QString &name, const QString &description = QString(),
1734-
const QString &fileFilter = QString(),
1735-
const QVariant &defaultValue = QVariant(),
1736-
bool optional = false );
1738+
QgsProcessingParameterFileDestination( const QString &name, const QString &description = QString(),
1739+
const QString &fileFilter = QString(),
1740+
const QVariant &defaultValue = QVariant(),
1741+
bool optional = false );
17371742

17381743
/**
17391744
* Returns the type name for the parameter class.
17401745
*/
1741-
static QString typeName() { return QStringLiteral( "fileOut" ); }
1746+
static QString typeName() { return QStringLiteral( "fileDestination" ); }
17421747
QString type() const override { return typeName(); }
17431748
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
17441749
QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
17451750
QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
17461751
QString defaultFileExtension() const override;
17471752

17481753
/**
1749-
* Returns the file filter string for files compatible with this output.
1754+
* Returns the file filter string for file destinations compatible with this parameter.
17501755
* \see setFileFilter()
17511756
*/
17521757
QString fileFilter() const;
17531758

17541759
/**
1755-
* Sets the file \a filter string for files compatible with this output.
1760+
* Sets the file \a filter string for file destinations compatible with this parameter.
17561761
* \see fileFilter()
17571762
*/
17581763
void setFileFilter( const QString &filter );
@@ -1763,7 +1768,7 @@ class CORE_EXPORT QgsProcessingParameterFileOutput : public QgsProcessingDestina
17631768
/**
17641769
* Creates a new parameter using the definition from a script code.
17651770
*/
1766-
static QgsProcessingParameterFileOutput *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1771+
static QgsProcessingParameterFileDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
17671772

17681773

17691774
private:
@@ -1772,26 +1777,28 @@ class CORE_EXPORT QgsProcessingParameterFileOutput : public QgsProcessingDestina
17721777
};
17731778

17741779
/**
1775-
* \class QgsProcessingParameterFolderOutput
1780+
* \class QgsProcessingParameterFolderDestination
17761781
* \ingroup core
1782+
* A folder destination parameter, for specifying the destination path for a folder created
1783+
* by the algorithm or used for creating new files within the algorithm.
17771784
* A folder output parameter.
1778-
* \since QGIS 3.0
1785+
* \since QGIS 3.0
17791786
*/
1780-
class CORE_EXPORT QgsProcessingParameterFolderOutput : public QgsProcessingDestinationParameter
1787+
class CORE_EXPORT QgsProcessingParameterFolderDestination : public QgsProcessingDestinationParameter
17811788
{
17821789
public:
17831790

17841791
/**
1785-
* Constructor for QgsProcessingParameterFolderOutput.
1792+
* Constructor for QgsProcessingParameterFolderDestination.
17861793
*/
1787-
QgsProcessingParameterFolderOutput( const QString &name, const QString &description = QString(),
1788-
const QVariant &defaultValue = QVariant(),
1789-
bool optional = false );
1794+
QgsProcessingParameterFolderDestination( const QString &name, const QString &description = QString(),
1795+
const QVariant &defaultValue = QVariant(),
1796+
bool optional = false );
17901797

17911798
/**
17921799
* Returns the type name for the parameter class.
17931800
*/
1794-
static QString typeName() { return QStringLiteral( "folderOut" ); }
1801+
static QString typeName() { return QStringLiteral( "folderDestination" ); }
17951802
QString type() const override { return typeName(); }
17961803
bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
17971804
QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
@@ -1800,7 +1807,7 @@ class CORE_EXPORT QgsProcessingParameterFolderOutput : public QgsProcessingDesti
18001807
/**
18011808
* Creates a new parameter using the definition from a script code.
18021809
*/
1803-
static QgsProcessingParameterFolderOutput *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1810+
static QgsProcessingParameterFolderDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
18041811

18051812
};
18061813

‎tests/src/core/testqgsprocessing.cpp

Lines changed: 40 additions & 40 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.