Skip to content

Commit

Permalink
[processing] fixed add model from file
Browse files Browse the repository at this point in the history
fixes #12902
  • Loading branch information
volaya committed Jun 22, 2015
1 parent 5013bb5 commit b6975d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/plugins/processing/modeler/AddModelFromFileAction.py
Expand Up @@ -55,7 +55,7 @@ def execute(self):
if filename:
try:
settings.setValue('Processing/lastModelsDir',
QFileInfo(fileName).absoluteDir().absolutePath())
QFileInfo(filename).absoluteDir().absolutePath())

ModelerAlgorithm.fromFile(filename)
except WrongModelException:
Expand All @@ -68,6 +68,7 @@ def execute(self):
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')

0 comments on commit b6975d6

Please sign in to comment.