Skip to content
Permalink
Browse files

make const and better variablenames

  • Loading branch information
signedav committed Dec 16, 2019
1 parent 5e6e756 commit 8e0b9388b862a64813c97b6590163822a2ab1684
@@ -184,11 +184,11 @@ QList<QVariant> QgsRelationReferenceFieldFormatter::availableValues( const QVari
{
QList<QVariant> values;

QgsVectorLayer *referencedLayer = QgsProject::instance()->relationManager()->relation( config[QStringLiteral( "Relation" )].toString() ).referencedLayer();
const QgsVectorLayer *referencedLayer = QgsProject::instance()->relationManager()->relation( config[QStringLiteral( "Relation" )].toString() ).referencedLayer();
if ( referencedLayer )
{
int layerFieldIndex = QgsProject::instance()->relationManager()->relation( config[QStringLiteral( "Relation" )].toString() ).referencedFields().first();
values = referencedLayer->uniqueValues( layerFieldIndex, countLimit ).toList();
int fieldIndex = QgsProject::instance()->relationManager()->relation( config[QStringLiteral( "Relation" )].toString() ).referencedFields().first();
values = referencedLayer->uniqueValues( fieldIndex, countLimit ).toList();
}
return values;
}
@@ -71,7 +71,7 @@ QVariant QgsValueMapFieldFormatter::sortValue( QgsVectorLayer *layer, int fieldI
QList<QVariant> QgsValueMapFieldFormatter::availableValues( const QVariantMap &config, int countLimit ) const
{
QList<QVariant> values;
QList<QVariant> valueList = config.value( QStringLiteral( "map" ) ).toList();
const QList<QVariant> valueList = config.value( QStringLiteral( "map" ) ).toList();
for ( const QVariant &item : valueList )
{
values.append( item.toMap().constBegin().value() );

0 comments on commit 8e0b938

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