Skip to content
Permalink
Browse files

[processing] Fix crash when an algorithm dialog is left open and

processing options are changed

Make sure the algorithm dialogs use their own copy of algorithms,
instead of the copies owned by the processing registry. Opening
processing options triggers a full reload of providers, deleting
all existing algorithm instances from the registry first.
  • Loading branch information
nyalldawson committed Sep 25, 2018
1 parent c2dab4f commit 6e06c32a1012e36c6a910627e1938c73db26d887
@@ -201,7 +201,7 @@ def showPopupMenu(self, point):
popupmenu.exec_(self.algorithmTree.mapToGlobal(point))

def editRenderingStyles(self):
alg = self.algorithmTree.selectedAlgorithm()
alg = self.algorithmTree.selectedAlgorithm().create() if self.algorithmTree.selectedAlgorithm() is not None else None
if alg is not None:
dlg = EditRenderingStylesDialog(alg)
dlg.exec_()
@@ -210,14 +210,14 @@ def activateCurrent(self):
self.executeAlgorithm()

def executeAlgorithmAsBatchProcess(self):
alg = self.algorithmTree.selectedAlgorithm()
alg = self.algorithmTree.selectedAlgorithm().create() if self.algorithmTree.selectedAlgorithm() is not None else None
if alg is not None:
dlg = BatchAlgorithmDialog(alg)
dlg.show()
dlg.exec_()

def executeAlgorithm(self):
alg = self.algorithmTree.selectedAlgorithm()
alg = self.algorithmTree.selectedAlgorithm().create() if self.algorithmTree.selectedAlgorithm() is not None else None
if alg is not None:
ok, message = alg.canExecute()
if not ok:
@@ -127,7 +127,7 @@ def createAlgorithmDialog(algOrName, parameters={}):
and delete this dialog.
"""
if isinstance(algOrName, QgsProcessingAlgorithm):
alg = algOrName
alg = algOrName.create()
else:
alg = QgsApplication.processingRegistry().createAlgorithmById(algOrName)

0 comments on commit 6e06c32

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