Skip to content
Permalink
Browse files

Remove no longer required _resolveLayers method

  • Loading branch information
nyalldawson committed Jun 5, 2017
1 parent ba03f1a commit 416770b197a759d535cd42164148a296d7d0ed14
@@ -23,7 +23,7 @@

from processing.gui.wrappers import WidgetWrapper, DIALOG_STANDARD
from processing.tools import dataobjects
from processing.core.parameters import _resolveLayers

import os
from qgis.PyQt import uic
from qgis.gui import QgsDoubleSpinBox
@@ -193,7 +193,7 @@ def parentLayerChanged(self, wrapper):
def setLayer(self, layer):
context = dataobjects.createContext()
if isinstance(layer, str):
layer = QgsProcessingUtils.mapLayerFromString(_resolveLayers(layer), context)
layer = QgsProcessingUtils.mapLayerFromString(layer, context)
self.widget.setLayer(layer)

def radiusChanged(self, wrapper):
@@ -91,18 +91,6 @@ def _expressionContext():
return context


def _resolveLayers(value):
layers = QgsProcessingUtils.compatibleLayers(QgsProject.instance())
if value:
inputlayers = value.split(';')
for i, inputlayer in enumerate(inputlayers):
for layer in layers:
if layer.name() == inputlayer:
inputlayers[i] = layer.source()
break
return ";".join(inputlayers)


class Parameter(object):

"""
@@ -154,9 +142,6 @@ def tr(self, string, context=''):
def evaluate(self, alg):
pass

def evaluateForModeler(self, value, model):
return value


class ParameterBoolean(Parameter):

@@ -282,9 +267,6 @@ def getValueAsCommandLineParameter(self):
s = '"%s"' % s
return s

def evaluate(self, alg):
self.value = _resolveLayers(self.value)


class ParameterExtent(Parameter):

@@ -704,9 +686,6 @@ def fromScriptCode(self, line):
return ParameterMultipleInput(name, definition,
dataobjects.TYPE_VECTOR_ANY, isOptional)

def evaluate(self, alg):
self.value = _resolveLayers(self.value)


class ParameterNumber(Parameter):

@@ -99,8 +99,7 @@
ParameterTableField,
ParameterExtent,
ParameterFixedTable,
ParameterCrs,
_resolveLayers)
ParameterCrs)
from processing.core.ProcessingConfig import ProcessingConfig
from processing.gui.FileSelectionPanel import FileSelectionPanel
from processing.core.outputs import (OutputFile, OutputRaster, OutputVector,
@@ -967,7 +966,7 @@ def parentLayerChanged(self, wrapper):
def setLayer(self, layer):
context = dataobjects.createContext()
if isinstance(layer, str):
layer = QgsProcessingUtils.mapLayerFromString(_resolveLayers(layer), context)
layer = QgsProcessingUtils.mapLayerFromString(layer, context)
self.widget.setLayer(layer)

def setValue(self, value):
@@ -1136,7 +1135,7 @@ def parentValueChanged(self, wrapper):
def setLayer(self, layer):
context = dataobjects.createContext()
if isinstance(layer, str):
layer = QgsProcessingUtils.mapLayerFromString(_resolveLayers(layer), context)
layer = QgsProcessingUtils.mapLayerFromString(layer, context)
self._layer = layer
self.refreshItems()

@@ -1195,6 +1194,7 @@ def validator(v):


class WidgetWrapperFactory:

"""
Factory for parameter widget wrappers
"""

0 comments on commit 416770b

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