Skip to content
Permalink
Browse files

[processing] Fix incorrect filters in vector layer parameter selections

  • Loading branch information
nyalldawson committed Sep 15, 2017
1 parent ea28c2d commit f282a753c6cf5b633cea7add18bfc0dcd0885ffe
Showing with 5 additions and 2 deletions.
  1. +5 −2 python/plugins/processing/gui/wrappers.py
@@ -1138,19 +1138,22 @@ def createWidget(self):

widget.setLayout(layout)

if ProcessingConfig.getSetting(ProcessingConfig.SHOW_CRS_DEF):
self.combo.setShowCrs(True)
if self.param.flags() & QgsProcessingParameterDefinition.FlagOptional:
self.combo.setAllowEmptyLayer(True)

filters = QgsMapLayerProxyModel.Filters()
if QgsProcessing.TypeVectorAnyGeometry in self.param.dataTypes() or len(self.param.dataTypes()) == 0:
filters = QgsMapLayerProxyModel.VectorLayer
filters = QgsMapLayerProxyModel.HasGeometry
if QgsProcessing.TypeVectorPoint in self.param.dataTypes():
filters |= QgsMapLayerProxyModel.PointLayer
if QgsProcessing.TypeVectorLine in self.param.dataTypes():
filters |= QgsMapLayerProxyModel.LineLayer
if QgsProcessing.TypeVectorPolygon in self.param.dataTypes():
filters |= QgsMapLayerProxyModel.PolygonLayer
self.combo.setFilters(filters)
if filters:
self.combo.setFilters(filters)

self.combo.setExcludedProviders(['grass'])
try:

0 comments on commit f282a75

Please sign in to comment.
You can’t perform that action at this time.