Skip to content

Commit b6975d6

Browse files
committedJun 22, 2015
[processing] fixed add model from file
fixes #12902
1 parent 5013bb5 commit b6975d6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎python/plugins/processing/modeler/AddModelFromFileAction.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def execute(self):
5555
if filename:
5656
try:
5757
settings.setValue('Processing/lastModelsDir',
58-
QFileInfo(fileName).absoluteDir().absolutePath())
58+
QFileInfo(filename).absoluteDir().absolutePath())
5959

6060
ModelerAlgorithm.fromFile(filename)
6161
except WrongModelException:
@@ -68,6 +68,7 @@ def execute(self):
6868
QMessageBox.warning(self.toolbox,
6969
self.tr('Error reading model', 'AddModelFromFileAction'),
7070
self.tr('Cannot read file', 'AddModelFromFileAction'))
71+
return
7172
destFilename = os.path.join(ModelerUtils.modelsFolder(), os.path.basename(filename))
7273
shutil.copyfile(filename,destFilename)
7374
self.toolbox.updateProvider('model')

0 commit comments

Comments
 (0)
Please sign in to comment.