mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
fix use layer source and managed string parsing in case of translation
This commit is contained in:
parent
faf9716a52
commit
1bc1bb2f13
@ -230,7 +230,7 @@ class RasterCalculator(QgisAlgorithm):
|
|||||||
def mappedNameToLayer(self, lyr, expression, layersDict, context):
|
def mappedNameToLayer(self, lyr, expression, layersDict, context):
|
||||||
'''Try to identify if a real layer is mapped in the expression with a symbolic name.'''
|
'''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
|
# check for layers directly added in the expression
|
||||||
if (nameToMap + "@") in expression:
|
if (nameToMap + "@") in expression:
|
||||||
@ -249,12 +249,12 @@ class RasterCalculator(QgisAlgorithm):
|
|||||||
varDescription = None
|
varDescription = None
|
||||||
for varName in expContextAlgInputsScope.variableNames():
|
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
|
continue
|
||||||
|
|
||||||
if isinstance(layer, QgsMapLayer) and nameToMap not in layer.source():
|
if isinstance(layerInContext, QgsMapLayer) and nameToMap not in layerInContext.source():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
varDescription = expContextAlgInputsScope.description(varName)
|
varDescription = expContextAlgInputsScope.description(varName)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user