Skip to content

Commit 827f84e

Browse files
committed
fix joins edition (do not loose target field)
1 parent dcfc538 commit 827f84e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/app/qgsjoindialog.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ QgsJoinDialog::QgsJoinDialog( QgsVectorLayer* layer, QList<QgsMapLayer*> already
3939
alreadyJoinedLayers.append( layer );
4040

4141
mTargetFieldComboBox->setLayer( mLayer );
42+
4243
mJoinLayerComboBox->setExceptedLayerList( alreadyJoinedLayers );
4344
connect( mJoinLayerComboBox, SIGNAL( layerChanged( QgsMapLayer* ) ), mJoinFieldComboBox, SLOT( setLayer( QgsMapLayer* ) ) );
4445
connect( mJoinLayerComboBox, SIGNAL( layerChanged( QgsMapLayer* ) ), this, SLOT( joinedLayerChanged( QgsMapLayer* ) ) );

src/app/qgsvectorlayerproperties.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,6 @@ void QgsVectorLayerProperties::showListOfStylesFromDatabase()
10261026
}
10271027

10281028
}
1029-
10301029
}
10311030

10321031
void QgsVectorLayerProperties::on_mButtonAddJoin_clicked()
@@ -1094,15 +1093,16 @@ void QgsVectorLayerProperties::on_mButtonEditJoin_clicked()
10941093
QgsJoinDialog d( layer, joinedLayers );
10951094
d.setJoinInfo( joins[j] );
10961095

1097-
10981096
if ( d.exec() == QDialog::Accepted )
10991097
{
1098+
QgsVectorJoinInfo info = d.joinInfo();
1099+
11001100
// remove old join
1101-
layer->removeJoin( currentJoinItem->data( 0, Qt::UserRole ).toString() );
1101+
layer->removeJoin( joinLayerId );
11021102
mJoinTreeWidget->takeTopLevelItem( mJoinTreeWidget->indexOfTopLevelItem( currentJoinItem ) );
11031103

11041104
// add the new edited
1105-
QgsVectorJoinInfo info = d.joinInfo();
1105+
11061106

11071107
//create attribute index if possible
11081108
if ( d.createAttributeIndex() )

0 commit comments

Comments
 (0)