Skip to content
Permalink
Browse files

add skip kwarg

  • Loading branch information
roya0045 authored and nyalldawson committed Jan 5, 2021
1 parent b3794ce commit d45b6144e4e517eceb808b2d52253f9ac9245521
@@ -194,7 +194,7 @@ def initWidgets(self):
for wrapper in list(self.wrappers.values()):
wrapper.postInitialize(list(self.wrappers.values()))

def createProcessingParameters(self):
def createProcessingParameters(self, skip_defaults=False):
parameters = {}
for p, v in self.extra_parameters.items():
parameters[p] = v
@@ -221,7 +221,7 @@ def createProcessingParameters(self):
continue

value = wrapper.parameterValue()
if param.defaultValue() != value:
if (param.defaultValue() != value and skip_defaults):
parameters[param.name()] = value

if not param.checkValueIsAcceptable(value):
@@ -245,7 +245,7 @@ def createProcessingParameters(self):

if value and isinstance(value, QgsProcessingOutputLayerDefinition):
value.destinationProject = dest_project
if value and param.defaultValue() != value:
if value and (param.defaultValue() != value and skip_defaults):
parameters[param.name()] = value

context = createContext()
@@ -143,7 +143,7 @@ def on_finished(successful, results):
dlg.exec_()

if dlg.wasExecuted():
self.model().setDesignerParameterValues(dlg.createProcessingParameters())
self.model().setDesignerParameterValues(dlg.createProcessingParameters(skip_defaults=True))

def saveInProject(self):
if not self.validateSave():

0 comments on commit d45b614

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