mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-15 00:02:52 -04:00
parent
5013bb5600
commit
b6975d6121
@ -55,7 +55,7 @@ class AddModelFromFileAction(ToolboxAction):
|
||||
if filename:
|
||||
try:
|
||||
settings.setValue('Processing/lastModelsDir',
|
||||
QFileInfo(fileName).absoluteDir().absolutePath())
|
||||
QFileInfo(filename).absoluteDir().absolutePath())
|
||||
|
||||
ModelerAlgorithm.fromFile(filename)
|
||||
except WrongModelException:
|
||||
@ -68,6 +68,7 @@ class AddModelFromFileAction(ToolboxAction):
|
||||
QMessageBox.warning(self.toolbox,
|
||||
self.tr('Error reading model', 'AddModelFromFileAction'),
|
||||
self.tr('Cannot read file', 'AddModelFromFileAction'))
|
||||
return
|
||||
destFilename = os.path.join(ModelerUtils.modelsFolder(), os.path.basename(filename))
|
||||
shutil.copyfile(filename,destFilename)
|
||||
self.toolbox.updateProvider('model')
|
||||
|
Loading…
x
Reference in New Issue
Block a user