Skip to content

Commit

Permalink
[processing] Fix BatchOutputSelectionPanel with QgsMapLayer instances
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-morvan committed Nov 6, 2016
1 parent 93be141 commit 2d2fe8b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/plugins/processing/gui/BatchOutputSelectionPanel.py
Expand Up @@ -31,6 +31,7 @@
import os
import re

from qgis.core import QgsMapLayer
from qgis.PyQt.QtWidgets import QWidget, QPushButton, QLineEdit, QHBoxLayout, QSizePolicy, QFileDialog
from qgis.PyQt.QtCore import QSettings

Expand Down Expand Up @@ -113,9 +114,12 @@ def showSelectionDialog(self):
if isinstance(param, (ParameterRaster,
ParameterVector, ParameterTable,
ParameterMultipleInput)):
s = str(widget.getText())
s = os.path.basename(s)
s = os.path.splitext(s)[0]
v = widget.value()
if isinstance(v, QgsMapLayer):
s = v.name()
else:
s = os.path.basename(v)
s = os.path.splitext(s)[0]
elif isinstance(param, ParameterBoolean):
s = str(widget.currentIndex() == 0)
elif isinstance(param, ParameterSelection):
Expand Down

0 comments on commit 2d2fe8b

Please sign in to comment.