Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] fixes for issues with 3rd party providers being loaded a…
…nd unloaded
  • Loading branch information
volaya committed Jun 1, 2016
1 parent b0a9a84 commit 61e26fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions python/plugins/processing/core/Processing.py
Expand Up @@ -112,9 +112,12 @@ def removeProvider(provider):
"""
try:
provider.unload()
Processing.providers.remove(provider)
algList.remove(provider.getName())
del Processing.actions[provider.getName()]
for p in Processing.providers:
if p.getName() == provider.getName():
Processing.providers.remove(p)
algList.removeProvider(provider.getName())
if provider.getName() in Processing.actions:
del Processing.actions[provider.getName()]
for act in provider.contextMenuActions:
Processing.contextMenuActions.remove(act)
except:
Expand All @@ -131,7 +134,7 @@ def getProviderFromName(name):

@staticmethod
def initialize():
if Processing.providers:
if "model" in [p.getName() for p in Processing.providers]:
return
# Add the basic providers
for c in AlgorithmProvider.__subclasses__():
Expand Down
3 changes: 2 additions & 1 deletion python/plugins/processing/core/alglist.py
Expand Up @@ -45,7 +45,8 @@ def removeProvider(self, providerName):
if p.getName() == providerName:
self.providers.remove(p)
break
self.algs.remove(providerName)
if providerName in self.algs:
del self.algs[providerName]
self.providerRemoved.emit(providerName)

def reloadProvider(self, providerName):
Expand Down

0 comments on commit 61e26fd

Please sign in to comment.