@@ -67,6 +67,8 @@ class Processing:
67
67
listeners = []
68
68
providers = []
69
69
70
+ toolbox = None
71
+
70
72
# A dictionary of algorithms. Keys are names of providers
71
73
# and values are list with all algorithms from that provider
72
74
algs = {}
@@ -79,6 +81,10 @@ class Processing:
79
81
80
82
modeler = ModelerAlgorithmProvider ()
81
83
84
+ @staticmethod
85
+ def setToolbox (toolbox ):
86
+ Processing .toolbox = toolbox
87
+
82
88
@staticmethod
83
89
def addProvider (provider , updateList = False ):
84
90
"""Use this method to add algorithms from external providers.
@@ -91,8 +97,8 @@ def addProvider(provider, updateList=False):
91
97
provider .initializeSettings ()
92
98
Processing .providers .append (provider )
93
99
ProcessingConfig .readSettings ()
94
- if updateList :
95
- Processing .updateAlgsList ()
100
+ if updateList and Processing . toolbox :
101
+ Processing .toolbox . updateTree ()
96
102
except :
97
103
ProcessingLog .addToLog (ProcessingLog .LOG_ERROR ,
98
104
'Could not load provider:'
@@ -111,7 +117,8 @@ def removeProvider(provider):
111
117
provider .unload ()
112
118
Processing .providers .remove (provider )
113
119
ProcessingConfig .readSettings ()
114
- Processing .updateAlgsList ()
120
+ if Processing .toolbox :
121
+ Processing .toolbox .updateTree ()
115
122
except :
116
123
# This try catch block is here to avoid problems if the
117
124
# plugin with a provider is unloaded after the Processing
0 commit comments