Skip to content
Permalink
Browse files

Merge pull request #5617 from signedav/longrelationids

Autogenerated relation names in dialog instead of ids
  • Loading branch information
m-kuhn committed Nov 20, 2017
2 parents 67b68a8 + b02133f commit e9ce901adcf3f0a254fa1d7137a97f418efaedf5
Showing with 6 additions and 3 deletions.
  1. +2 −2 src/app/qgsrelationmanagerdialog.cpp
  2. +4 −1 src/gui/editorwidgets/qgsrelationreferenceconfigdlg.cpp
@@ -106,9 +106,9 @@ void QgsRelationManagerDialog::mBtnAddRelation_clicked()
QString relationId = addDlg.relationId();
if ( addDlg.relationId().isEmpty() )
relationId = QStringLiteral( "%1_%2_%3_%4" )
.arg( addDlg.referencingLayerId(),
.arg( addDlg.referencingLayerId().left( 10 ),
addDlg.references().at( 0 ).first,
addDlg.referencedLayerId(),
addDlg.referencedLayerId().left( 10 ),
addDlg.references().at( 0 ).second );

QStringList existingNames;
@@ -36,7 +36,10 @@ QgsRelationReferenceConfigDlg::QgsRelationReferenceConfigDlg( QgsVectorLayer *vl

Q_FOREACH ( const QgsRelation &relation, vl->referencingRelations( fieldIdx ) )
{
mComboRelation->addItem( QStringLiteral( "%1 (%2)" ).arg( relation.id(), relation.referencedLayerId() ), relation.id() );
if ( relation.name().isEmpty() )
mComboRelation->addItem( QStringLiteral( "%1 (%2)" ).arg( relation.id(), relation.referencedLayerId() ), relation.id() );
else
mComboRelation->addItem( QStringLiteral( "%1 (%2)" ).arg( relation.name(), relation.referencedLayerId() ), relation.id() );
if ( relation.referencedLayer() )
{
mExpressionWidget->setField( relation.referencedLayer()->displayExpression() );

0 comments on commit e9ce901

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