Skip to content
Permalink
Browse files

[BUGFIX][Processing] Infinite loop in refresh algorithms tree

When an algorithm provider is refresh, all algorithm providers are reloaded.
But after each reload,the providerReloaded event is emitted and the provider
algorithms tree is refreshed, and all the algorithm providers are reloaded,
and the infinite loop started.

It fixed #18877 *Maximum recursion depth exceeded after adding a model or
script to the Processing algorithm list (since 2.18.18!)* by removing
`updateAlgsList` when refresh provider algorithms tree item.
  • Loading branch information
rldhont committed May 30, 2018
1 parent cd8ab68 commit ad394acd476db8b4d3cacf78bec626e7d7e6c941
@@ -67,6 +67,8 @@

class Processing:

currentlyUpdatingAlgList = False

providers = []

# Same structure as algs in algList
@@ -179,10 +181,14 @@ def updateAlgsList():
requires the list of algorithms to be created again from
algorithm providers.
"""
if Processing.currentlyUpdatingAlgList:
return
Processing.currentlyUpdatingAlgList = True
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
for p in Processing.providers:
Processing.reloadProvider(p.getName())
QApplication.restoreOverrideCursor()
Processing.currentlyUpdatingAlgList = False

@staticmethod
def reloadProvider(providerName):
@@ -374,7 +374,6 @@ def __init__(self, providerName, tree, toolbox):

def refresh(self):
self.takeChildren()
Processing.updateAlgsList()
self.populate()

def populate(self):

0 comments on commit ad394ac

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