Skip to content

Commit

Permalink
Merge attributes dialog: also skip pk attributes if taking attributes…
Browse files Browse the repository at this point in the history
… from selection
  • Loading branch information
mhugent committed Jul 8, 2013
1 parent 42a3e38 commit aab2537
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/qgsmergeattributesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void QgsMergeAttributesDialog::createTableWidgetContents()

//create combo boxes and insert attribute names
const QgsFields& fields = mVectorLayer->pendingFields();
QgsAttributeList pkAttrList = mVectorLayer->pendingPkAttributesList();
QSet<int> pkAttrList = mVectorLayer->pendingPkAttributesList().toSet();

int col = 0;
for ( int idx = 0; idx < fields.count(); ++idx )
Expand Down Expand Up @@ -483,8 +483,13 @@ void QgsMergeAttributesDialog::on_mFromSelectedPushButton_clicked()
return;
}

QSet<int> pkAttributes = mVectorLayer->pendingPkAttributesList().toSet();
for ( int i = 0; i < mTableWidget->columnCount(); ++i )
{
if ( pkAttributes.contains( i ) )
{
continue;
}
QComboBox* currentComboBox = qobject_cast<QComboBox *>( mTableWidget->cellWidget( 0, i ) );
if ( currentComboBox )
{
Expand Down

0 comments on commit aab2537

Please sign in to comment.