Skip to content

Commit

Permalink
fix adding relation with multiple field pairs from dialog (#37640)
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jul 7, 2020
1 parent d14b349 commit ed000d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/app/qgsrelationadddlg.cpp
Expand Up @@ -239,6 +239,8 @@ QList< QPair< QString, QString > > QgsRelationAddDlg::references()
QList< QPair< QString, QString > > references;
for ( int i = 0; i < mFieldPairWidgets.count(); i++ )
{
if ( !mFieldPairWidgets.at( i )->isPairEnabled() )
continue;
QString referencingField = mFieldPairWidgets.at( i )->referencingField();
QString referencedField = mFieldPairWidgets.at( i )->referencedField();
references << qMakePair( referencingField, referencedField );
Expand Down
4 changes: 3 additions & 1 deletion src/app/qgsrelationmanagerdialog.cpp
Expand Up @@ -138,7 +138,9 @@ void QgsRelationManagerDialog::mBtnAddRelation_clicked()
++suffix;
}
relation.setId( relationId );
relation.addFieldPair( addDlg.references().at( 0 ).first, addDlg.references().at( 0 ).second );
const auto references = addDlg.references();
for ( const auto &reference : references )
relation.addFieldPair( reference.first, reference.second );
relation.setName( addDlg.relationName() );
relation.setStrength( addDlg.relationStrength() );

Expand Down

0 comments on commit ed000d4

Please sign in to comment.