[processing] fixes for issues with 3rd party providers being loaded and unloaded

This commit is contained in:
volaya 2016-06-01 15:20:27 +02:00
parent b0a9a84cee
commit 61e26fd8f3
2 changed files with 9 additions and 5 deletions

View File

@ -112,9 +112,12 @@ class Processing:
"""
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:
@ -131,7 +134,7 @@ class Processing:
@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__():

View File

@ -45,7 +45,8 @@ class AlgorithmList(QObject):
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):