Skip to content

Commit 4a11a1a

Browse files
committedApr 27, 2016
[Processing][Modeler] Use default value instead of None
In Modeler algorithm, when a algorithm's parameter was not defined it's value was set to None. Before the possibility to defined optional parameters, None value is equal to set value to default one. Now, it's important to use default value instead of None.
1 parent e9bc8ae commit 4a11a1a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ def prepareAlgorithm(self, alg):
389389
iface.messageBar().pushMessage(self.tr("Warning"),
390390
self.tr("Parameter %s in algorithm %s in the model is run with default value! Edit the model to make sure that this is correct.") % (param.name, alg.name),
391391
QgsMessageBar.WARNING, 4)
392-
value = None
392+
value = param.default
393393
if value is None and isinstance(param, ParameterExtent):
394394
value = self.getMinCoveringExtent()
395395
# We allow unexistent filepaths, since that allows

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def setPreviousValues(self):
454454
if param.name in alg.params:
455455
value = alg.params[param.name]
456456
else:
457-
value = None
457+
value = param.default
458458
if isinstance(param, (
459459
ParameterRaster,
460460
ParameterVector,

0 commit comments

Comments
 (0)
Please sign in to comment.