Skip to content

Commit

Permalink
fix use layer source and managed string parsing in case of translation
Browse files Browse the repository at this point in the history
  • Loading branch information
luipir committed Aug 28, 2018
1 parent faf9716 commit 1bc1bb2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/plugins/processing/algs/qgis/RasterCalculator.py
Expand Up @@ -230,7 +230,7 @@ def processBeforeAddingToModeler(self, algorithm, model):
def mappedNameToLayer(self, lyr, expression, layersDict, context):
'''Try to identify if a real layer is mapped in the expression with a symbolic name.'''

nameToMap = lyr.name()
nameToMap = lyr.source()

# check for layers directly added in the expression
if (nameToMap + "@") in expression:
Expand All @@ -249,12 +249,12 @@ def mappedNameToLayer(self, lyr, expression, layersDict, context):
varDescription = None
for varName in expContextAlgInputsScope.variableNames():

layer = expContextAlgInputsScope.variable(varName)
layerInContext = expContextAlgInputsScope.variable(varName)

if not isinstance(layer, str) and not isinstance(layer, QgsMapLayer):
if not isinstance(layerInContext, str) and not isinstance(layerInContext, QgsMapLayer):
continue

if isinstance(layer, QgsMapLayer) and nameToMap not in layer.source():
if isinstance(layerInContext, QgsMapLayer) and nameToMap not in layerInContext.source():
continue

varDescription = expContextAlgInputsScope.description(varName)
Expand Down

0 comments on commit 1bc1bb2

Please sign in to comment.