Skip to content

Commit 2d2fe8b

Browse files
committedNov 6, 2016
[processing] Fix BatchOutputSelectionPanel with QgsMapLayer instances
1 parent 93be141 commit 2d2fe8b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed
 

‎python/plugins/processing/gui/BatchOutputSelectionPanel.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import os
3232
import re
3333

34+
from qgis.core import QgsMapLayer
3435
from qgis.PyQt.QtWidgets import QWidget, QPushButton, QLineEdit, QHBoxLayout, QSizePolicy, QFileDialog
3536
from qgis.PyQt.QtCore import QSettings
3637

@@ -113,9 +114,12 @@ def showSelectionDialog(self):
113114
if isinstance(param, (ParameterRaster,
114115
ParameterVector, ParameterTable,
115116
ParameterMultipleInput)):
116-
s = str(widget.getText())
117-
s = os.path.basename(s)
118-
s = os.path.splitext(s)[0]
117+
v = widget.value()
118+
if isinstance(v, QgsMapLayer):
119+
s = v.name()
120+
else:
121+
s = os.path.basename(v)
122+
s = os.path.splitext(s)[0]
119123
elif isinstance(param, ParameterBoolean):
120124
s = str(widget.currentIndex() == 0)
121125
elif isinstance(param, ParameterSelection):

0 commit comments

Comments
 (0)
Please sign in to comment.