Skip to content

Commit

Permalink
[BUGFIX][Processing] Infinite loop in refresh algorithms tree
Browse files Browse the repository at this point in the history
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 Jun 11, 2018
1 parent cd8ab68 commit ad394ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions python/plugins/processing/core/Processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@

class Processing:

currentlyUpdatingAlgList = False

providers = []

# Same structure as algs in algList
Expand Down Expand Up @@ -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):
Expand Down
1 change: 0 additions & 1 deletion python/plugins/processing/gui/ProcessingToolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@ def __init__(self, providerName, tree, toolbox):

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

def populate(self):
Expand Down

0 comments on commit ad394ac

Please sign in to comment.