Skip to content
Permalink
Browse files

Replace another expresion with createFieldEqualityExpression, remove …

…unused variables
  • Loading branch information
nyalldawson committed Jul 6, 2017
1 parent 963e25e commit 29c4fcfc16fd1d74b1d660efc14c137cc203fdcb
Showing with 1 addition and 7 deletions.
  1. +1 −7 src/core/qgsrelation.cpp
@@ -168,8 +168,6 @@ QString QgsRelation::getRelatedFeaturesFilter( const QgsFeature &feature ) const

Q_FOREACH ( const QgsRelation::FieldPair &fieldPair, mFieldPairs )
{
int referencingIdx = referencingLayer()->fields().indexFromName( fieldPair.referencingField() );
QgsField referencingField = referencingLayer()->fields().at( referencingIdx );
QVariant val( feature.attribute( fieldPair.referencedField() ) );
conditions << QgsExpression::createFieldEqualityExpression( fieldPair.referencingField(), val );
}
@@ -183,12 +181,8 @@ QgsFeatureRequest QgsRelation::getReferencedFeatureRequest( const QgsAttributes

Q_FOREACH ( const QgsRelation::FieldPair &fieldPair, mFieldPairs )
{
int referencedIdx = referencedLayer()->fields().indexFromName( fieldPair.referencedField() );
int referencingIdx = referencingLayer()->fields().indexFromName( fieldPair.referencingField() );

QgsField referencedField = referencedLayer()->fields().at( referencedIdx );

conditions << QStringLiteral( "%1 = %2" ).arg( QgsExpression::quotedColumnRef( fieldPair.referencedField() ), QgsExpression::quotedValue( attributes.at( referencingIdx ) ) );
conditions << QgsExpression::createFieldEqualityExpression( fieldPair.referencedField(), attributes.at( referencingIdx ) );
}

QgsFeatureRequest myRequest;

0 comments on commit 29c4fcf

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