Skip to content

Commit 636a37f

Browse files
committedMay 1, 2017
[processing] Fix editing existing model has no algorithms shown
1 parent 77d9590 commit 636a37f

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed
 

‎python/plugins/processing/modeler/ModelerAlgorithm.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def todict(self):
114114
@property
115115
def algorithm(self):
116116
if self._algInstance is None:
117-
self._algInstance = QgsApplication.processingRegistry().algorithmById(self.consoleName).getCopy()
117+
self._algInstance = QgsApplication.processingRegistry().algorithmById(self.consoleName)
118118
return self._algInstance
119119

120120
def setName(self, model):
@@ -226,7 +226,7 @@ class ModelerAlgorithm(GeoAlgorithm):
226226
CANVAS_SIZE = 4000
227227

228228
def getCopy(self):
229-
newone = self
229+
newone = ModelerAlgorithm()
230230

231231
newone.algs = {}
232232
for algname, alg in self.algs.items():
@@ -612,14 +612,6 @@ def _import(name):
612612
clazz = getattr(module, className)
613613
instance = clazz()
614614
for k, v in list(values.items()):
615-
# upgrade old model files
616-
if k == 'group':
617-
k = '_group'
618-
elif k == 'name':
619-
instance.__dict__['_name'] = v
620-
k = 'modeler_name'
621-
if not issubclass(clazz, GeoAlgorithm):
622-
instance.__dict__['name'] = v
623615
instance.__dict__[k] = v
624616
return instance
625617
except KeyError:

0 commit comments

Comments
 (0)