mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-09 00:35:20 -05:00
Less autos more consts
This commit is contained in:
parent
a295701023
commit
a45a82e8d7
@ -276,13 +276,14 @@ bool QgsValueRelationFieldFormatter::expressionIsUsable( const QString &expressi
|
||||
|
||||
QgsVectorLayer *QgsValueRelationFieldFormatter::resolveLayer( const QVariantMap &config )
|
||||
{
|
||||
auto layer { QgsProject::instance()->mapLayer<QgsVectorLayer *>( config.value( QStringLiteral( "Layer" ) ).toString() ) };
|
||||
QgsVectorLayer *layer { QgsProject::instance()->mapLayer<QgsVectorLayer *>( config.value( QStringLiteral( "Layer" ) ).toString() ) };
|
||||
if ( ! layer )
|
||||
{
|
||||
const auto name { config.value( QStringLiteral( "LayerName" ) ).toString() };
|
||||
if ( ! name.isEmpty() )
|
||||
{
|
||||
for ( QgsMapLayer *l : QgsProject::instance()->mapLayers( true ) )
|
||||
const auto constLayers { QgsProject::instance()->mapLayers( true ) };
|
||||
for ( QgsMapLayer *l : constLayers )
|
||||
{
|
||||
QgsVectorLayer *vl { qobject_cast<QgsVectorLayer *>( l ) };
|
||||
if ( vl && vl->name() == name )
|
||||
|
Loading…
x
Reference in New Issue
Block a user