Skip to content

Commit

Permalink
[processing] Fix editing existing model has no algorithms shown
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 1, 2017
1 parent 77d9590 commit 636a37f
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions python/plugins/processing/modeler/ModelerAlgorithm.py
Expand Up @@ -114,7 +114,7 @@ def todict(self):
@property
def algorithm(self):
if self._algInstance is None:
self._algInstance = QgsApplication.processingRegistry().algorithmById(self.consoleName).getCopy()
self._algInstance = QgsApplication.processingRegistry().algorithmById(self.consoleName)
return self._algInstance

def setName(self, model):
Expand Down Expand Up @@ -226,7 +226,7 @@ class ModelerAlgorithm(GeoAlgorithm):
CANVAS_SIZE = 4000

def getCopy(self):
newone = self
newone = ModelerAlgorithm()

newone.algs = {}
for algname, alg in self.algs.items():
Expand Down Expand Up @@ -612,14 +612,6 @@ def _import(name):
clazz = getattr(module, className)
instance = clazz()
for k, v in list(values.items()):
# upgrade old model files
if k == 'group':
k = '_group'
elif k == 'name':
instance.__dict__['_name'] = v
k = 'modeler_name'
if not issubclass(clazz, GeoAlgorithm):
instance.__dict__['name'] = v
instance.__dict__[k] = v
return instance
except KeyError:
Expand Down

0 comments on commit 636a37f

Please sign in to comment.