Skip to content

Commit 1bc1bb2

Browse files
committedAug 28, 2018
fix use layer source and managed string parsing in case of translation
1 parent faf9716 commit 1bc1bb2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎python/plugins/processing/algs/qgis/RasterCalculator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def processBeforeAddingToModeler(self, algorithm, model):
230230
def mappedNameToLayer(self, lyr, expression, layersDict, context):
231231
'''Try to identify if a real layer is mapped in the expression with a symbolic name.'''
232232

233-
nameToMap = lyr.name()
233+
nameToMap = lyr.source()
234234

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

252-
layer = expContextAlgInputsScope.variable(varName)
252+
layerInContext = expContextAlgInputsScope.variable(varName)
253253

254-
if not isinstance(layer, str) and not isinstance(layer, QgsMapLayer):
254+
if not isinstance(layerInContext, str) and not isinstance(layerInContext, QgsMapLayer):
255255
continue
256256

257-
if isinstance(layer, QgsMapLayer) and nameToMap not in layer.source():
257+
if isinstance(layerInContext, QgsMapLayer) and nameToMap not in layerInContext.source():
258258
continue
259259

260260
varDescription = expContextAlgInputsScope.description(varName)

0 commit comments

Comments
 (0)
Please sign in to comment.