Skip to content

Commit

Permalink
[processing] alternative way of copying algorithms in a model.
Browse files Browse the repository at this point in the history
should fix #15060 and #15480
  • Loading branch information
volaya authored and alexbruy committed Oct 18, 2016
1 parent eb5fc90 commit 22a6c47
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/plugins/processing/modeler/ModelerAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,11 @@ class ModelerAlgorithm(GeoAlgorithm):
def getCopy(self):
newone = ModelerAlgorithm()
newone.provider = self.provider
newone.algs = copy.deepcopy(self.algs)

newone.algs = {}
for algname, alg in self.algs.iteritems():
newone.algs[algname] = Algorithm()
newone.algs[algname].__dict__.update(copy.deepcopy(alg.todict()))
newone.inputs = copy.deepcopy(self.inputs)
newone.defineCharacteristics()
newone.name = self.name
Expand Down

0 comments on commit 22a6c47

Please sign in to comment.