Skip to content
Permalink
Browse files

fix adding relation with multiple field pairs from dialog

  • Loading branch information
github-actions authored and nyalldawson committed Jul 7, 2020
1 parent 78e08c3 commit df111bf3fe3f5199312277614655631e8e48c8b4
Showing with 5 additions and 1 deletion.
  1. +2 −0 src/app/qgsrelationadddlg.cpp
  2. +3 −1 src/app/qgsrelationmanagerdialog.cpp
@@ -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 );
@@ -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() );

0 comments on commit df111bf

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