mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-19 00:04:52 -04:00
[processing] Fix editing existing model has no algorithms shown
This commit is contained in:
parent
77d95905a5
commit
636a37f4f7
@ -114,7 +114,7 @@ class Algorithm(object):
|
|||||||
@property
|
@property
|
||||||
def algorithm(self):
|
def algorithm(self):
|
||||||
if self._algInstance is None:
|
if self._algInstance is None:
|
||||||
self._algInstance = QgsApplication.processingRegistry().algorithmById(self.consoleName).getCopy()
|
self._algInstance = QgsApplication.processingRegistry().algorithmById(self.consoleName)
|
||||||
return self._algInstance
|
return self._algInstance
|
||||||
|
|
||||||
def setName(self, model):
|
def setName(self, model):
|
||||||
@ -226,7 +226,7 @@ class ModelerAlgorithm(GeoAlgorithm):
|
|||||||
CANVAS_SIZE = 4000
|
CANVAS_SIZE = 4000
|
||||||
|
|
||||||
def getCopy(self):
|
def getCopy(self):
|
||||||
newone = self
|
newone = ModelerAlgorithm()
|
||||||
|
|
||||||
newone.algs = {}
|
newone.algs = {}
|
||||||
for algname, alg in self.algs.items():
|
for algname, alg in self.algs.items():
|
||||||
@ -612,14 +612,6 @@ class ModelerAlgorithm(GeoAlgorithm):
|
|||||||
clazz = getattr(module, className)
|
clazz = getattr(module, className)
|
||||||
instance = clazz()
|
instance = clazz()
|
||||||
for k, v in list(values.items()):
|
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
|
instance.__dict__[k] = v
|
||||||
return instance
|
return instance
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user